Syniurge / i2c-amd-mp2

DKMS-ready driver for AMD PCI-E MP2 I2C controllers
22 stars 4 forks source link

Make bad exit status: 2 #2

Closed erifa1 closed 5 years ago

erifa1 commented 5 years ago

Hi, Thank you for your work. I still have some trouble with a lenovo yoga 530. The installation doesn't work well on my laptop.

Thanks for your help!

sudo ./dkms-install.sh

About to run dkms install steps...

Creating symlink /var/lib/dkms/i2c-amd-mp2/1.0.0/source ->
                 /usr/src/i2c-amd-mp2-1.0.0

DKMS: add completed.

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
make -j8 KERNELRELEASE=4.15.0-38-generic -C /lib/modules/4.15.0-38-generic/build M=/var/lib/dkms/i2c-amd-mp2/1.0.0/build...(bad exit status: 2)
ERROR (dkms apport): binary package for i2c-amd-mp2: 1.0.0 not found
Error! Bad return status for module build on kernel: 4.15.0-38-generic (x86_64)
Consult /var/lib/dkms/i2c-amd-mp2/1.0.0/build/make.log for more information.

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
make -j8 KERNELRELEASE=4.15.0-38-generic -C /lib/modules/4.15.0-38-generic/build M=/var/lib/dkms/i2c-amd-mp2/1.0.0/build...(bad exit status: 2)
ERROR (dkms apport): binary package for i2c-amd-mp2: 1.0.0 not found
Error! Bad return status for module build on kernel: 4.15.0-38-generic (x86_64)
Consult /var/lib/dkms/i2c-amd-mp2/1.0.0/build/make.log for more information.
Finished running dkms install steps.

cat /var/lib/dkms/i2c-amd-mp2/1.0.0/build/make.log

DKMS make.log for i2c-amd-mp2-1.0.0 for kernel 4.15.0-38-generic (x86_64)
lundi 12 novembre 2018, 23:42:54 (UTC+0100)
make : on entre dans le répertoire « /usr/src/linux-headers-4.15.0-38-generic »
  CC [M]  /var/lib/dkms/i2c-amd-mp2/1.0.0/build/i2c-amd-mp2-pci.o
  CC [M]  /var/lib/dkms/i2c-amd-mp2/1.0.0/build/i2c-amd-mp2-plat.o
/var/lib/dkms/i2c-amd-mp2/1.0.0/build/i2c-amd-mp2-pci.c: In function ‘amd_mp2_dma_map’:
/var/lib/dkms/i2c-amd-mp2/1.0.0/build/i2c-amd-mp2-pci.c:112:24: error: implicit declaration of function ‘i2c_get_dma_safe_msg_buf’; did you mean ‘__get_dma_pages’? [-Werror=implicit-function-declaration]
  i2c_common->dma_buf = i2c_get_dma_safe_msg_buf(i2c_common->msg, 0);
                        ^~~~~~~~~~~~~~~~~~~~~~~~
                        __get_dma_pages
/var/lib/dkms/i2c-amd-mp2/1.0.0/build/i2c-amd-mp2-pci.c:112:22: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
  i2c_common->dma_buf = i2c_get_dma_safe_msg_buf(i2c_common->msg, 0);
                      ^
cc1: some warnings being treated as errors
scripts/Makefile.build:332: recipe for target '/var/lib/dkms/i2c-amd-mp2/1.0.0/build/i2c-amd-mp2-pci.o' failed
make[1]: *** [/var/lib/dkms/i2c-amd-mp2/1.0.0/build/i2c-amd-mp2-pci.o] Error 1
Makefile:1551: recipe for target '_module_/var/lib/dkms/i2c-amd-mp2/1.0.0/build' failed
make: *** [_module_/var/lib/dkms/i2c-amd-mp2/1.0.0/build] Error 2
make : on quitte le répertoire « /usr/src/linux-headers-4.15.0-38-generic »
Syniurge commented 5 years ago

My bad, i2c_get_dma_safe_msg_buf was only introduced in 4.16, I should've checked older kernels before pushing 167ceecad48c4004d1ac0e90ef19708e689dca54 .

I pushed a quick fix in a branch: https://github.com/Syniurge/i2c-amd-mp2/tree/older-kernels-fix

I can't even compile to test myself right now, will do tomorrow, but it should work.

If you confirm me this evening that it works, I'll merge the commit into master rightaway for other users.

erifa1 commented 5 years ago

Thank you. Ok I can upgrade to the latest kernel too.

This version does'nt work with the current kernel 4.15.0-38

sudo ./dkms-install.sh


About to run dkms install steps...
Error! DKMS tree already contains: i2c-amd-mp2-1.0.0
You cannot add the same module/version combo more than once.

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
make -j8 KERNELRELEASE=4.15.0-38-generic -C /lib/modules/4.15.0-38-generic/build M=/var/lib/dkms/i2c-amd-mp2/1.0.0/build...(bad exit status: 2)
ERROR (dkms apport): binary package for i2c-amd-mp2: 1.0.0 not found
Error! Bad return status for module build on kernel: 4.15.0-38-generic (x86_64)
Consult /var/lib/dkms/i2c-amd-mp2/1.0.0/build/make.log for more information.

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
make -j8 KERNELRELEASE=4.15.0-38-generic -C /lib/modules/4.15.0-38-generic/build M=/var/lib/dkms/i2c-amd-mp2/1.0.0/build...(bad exit status: 2)
ERROR (dkms apport): binary package for i2c-amd-mp2: 1.0.0 not found
Error! Bad return status for module build on kernel: 4.15.0-38-generic (x86_64)
Consult /var/lib/dkms/i2c-amd-mp2/1.0.0/build/make.log for more information.
Finished running dkms install steps.

cat /var/lib/dkms/i2c-amd-mp2/1.0.0/build/make.log


DKMS make.log for i2c-amd-mp2-1.0.0 for kernel 4.15.0-38-generic (x86_64)
mardi 13 novembre 2018, 07:36:00 (UTC+0100)
make : on entre dans le répertoire « /usr/src/linux-headers-4.15.0-38-generic »
  CC [M]  /var/lib/dkms/i2c-amd-mp2/1.0.0/build/i2c-amd-mp2-pci.o
  CC [M]  /var/lib/dkms/i2c-amd-mp2/1.0.0/build/i2c-amd-mp2-plat.o
/var/lib/dkms/i2c-amd-mp2/1.0.0/build/i2c-amd-mp2-pci.c: In function ‘amd_mp2_dma_map’:
/var/lib/dkms/i2c-amd-mp2/1.0.0/build/i2c-amd-mp2-pci.c:112:24: error: implicit declaration of function ‘i2c_get_dma_safe_msg_buf’; did you mean ‘__get_dma_pages’? [-Werror=implicit-function-declaration]
  i2c_common->dma_buf = i2c_get_dma_safe_msg_buf(i2c_common->msg, 0);
                        ^~~~~~~~~~~~~~~~~~~~~~~~
                        __get_dma_pages
/var/lib/dkms/i2c-amd-mp2/1.0.0/build/i2c-amd-mp2-pci.c:112:22: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
  i2c_common->dma_buf = i2c_get_dma_safe_msg_buf(i2c_common->msg, 0);
                      ^
cc1: some warnings being treated as errors
scripts/Makefile.build:332: recipe for target '/var/lib/dkms/i2c-amd-mp2/1.0.0/build/i2c-amd-mp2-pci.o' failed
make[1]: *** [/var/lib/dkms/i2c-amd-mp2/1.0.0/build/i2c-amd-mp2-pci.o] Error 1
Makefile:1551: recipe for target '_module_/var/lib/dkms/i2c-amd-mp2/1.0.0/build' failed
make: *** [_module_/var/lib/dkms/i2c-amd-mp2/1.0.0/build] Error 2
make : on quitte le répertoire « /usr/src/linux-headers-4.15.0-38-generic »
Syniurge commented 5 years ago

Fixed in latest master 0e4040d50d2f17a3e533a5a3c1a4df7d31f95ba8, sorry for breaking the build against <4.16 kernels.

erifa1 commented 5 years ago

No problem for installation but no touchpad with 4.15. I have installed 4.19.1 and it works fine!

Thanks a lot!

Syniurge commented 5 years ago

Oh, it turns out that a few months ago AMD's initial patch was applied to Ubuntu's kernel (4.15 series for 18.04) to support Dell Latitude 5495's touchpad, and the driver is builtin, not even built as a module so there's no way to override it.

Since the initial driver was broken for laptops which uses 2 busses (e.g 1st for the touchpad and 2nd for the touchscreen) newer Ubuntu kernels are borked on those laptops, there's a null dereference error and a couple of other errors, and booting seems random, half of the time it doesn't reach the desktop (I'm guessing MP2's interrupt handler never returns).

I'll get in touch with the guy who applied the patch: https://bugs.launchpad.net/ubuntu/+source/linux-oem/+bug/1773940

tchoumi313 commented 12 months ago
hello, please i am getting the error DKMS make.log for i2c-amd-mp2-1.0.0 for kernel 5.19.0-46-generic (x86_64) Wed Jul 12 03:12:31 AM WAT 2023 make: Entering directory '/usr/src/linux-headers-5.19.0-46-generic' warning: the compiler differs from the one used to build the kernel The kernel was built by: x86_64-linux-gnu-gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0 You are using: gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0 CC [M] /var/lib/dkms/i2c-amd-mp2/1.0.0/build/i2c-amd-mp2-pci.o CC [M] /var/lib/dkms/i2c-amd-mp2/1.0.0/build/i2c-amd-mp2-plat.o /var/lib/dkms/i2c-amd-mp2/1.0.0/build/i2c-amd-mp2-plat.c: In function ‘i2c_amd_probe’: /var/lib/dkms/i2c-amd-mp2/1.0.0/build/i2c-amd-mp2-plat.c:231:13: error: implicit declaration of function ‘acpi_bus_get_device’; did you mean ‘pci_bus_add_device’? [-Werror=implicit-function-declaration] 231 if (acpi_bus_get_device(handle, &adev)) ^~~~~~~ pci_bus_add_device /var/lib/dkms/i2c-amd-mp2/1.0.0/build/i2c-amd-mp2-pci.c: In function ‘amd_mp2_pci_init’: /var/lib/dkms/i2c-amd-mp2/1.0.0/build/i2c-amd-mp2-pci.c:507:14: error: implicit declaration of function ‘pci_set_dma_mask’ [-Werror=implicit-function-declaration] 507 rc = pci_set_dma_mask(pci_dev, DMA_BIT_MASK(64)); ^~~~ /var/lib/dkms/i2c-amd-mp2/1.0.0/build/i2c-amd-mp2-pci.c: In function ‘amd_mp2_find_device’: /var/lib/dkms/i2c-amd-mp2/1.0.0/build/i2c-amd-mp2-pci.c:676:34: error: passing argument 4 of ‘driver_find_device’ from incompatible pointer type [-Werror=incompatible-pointer-types] 676 amd_mp2_device_match); ^~~~~~~~
int ()(struct device , void *)

In file included from ./include/linux/device.h:32, from ./include/linux/dma-mapping.h:7, from /var/lib/dkms/i2c-amd-mp2/1.0.0/build/i2c-amd-mp2-pci.c:10: ./include/linux/device/driver.h:163:41: note: expected ‘int ()(struct device , const void )’ but argument is of type ‘int ()(struct device , void )’ 163 | int (match)(struct device dev, const void *data)); | ~~^~~~~~~~~~~~ cc1: some warnings being treated as errors make[1]: [scripts/Makefile.build:257: /var/lib/dkms/i2c-amd-mp2/1.0.0/build/i2c-amd-mp2-plat.o] Error 1 make[1]: Waiting for unfinished jobs.... cc1: some warnings being treated as errors make[1]: [scripts/Makefile.build:257: /var/lib/dkms/i2c-amd-mp2/1.0.0/build/i2c-amd-mp2-pci.o] Error 1 make: [Makefile:1857: /var/lib/dkms/i2c-amd-mp2/1.0.0/build] Error 2 make: Leaving directory '/usr/src/linux-headers-5.19.0-46-generic'

tchoumi313 commented 12 months ago

Please for help