alexreinert / piVCCU

piVCCU is a project to install the original Homematic CCU3 firmware inside a virtualized container (lxc) on ARM based single board computers.
Apache License 2.0
302 stars 64 forks source link

GPIO API changed in kernel 6.1: `generic_raw_uart` and `rtc-rx8130` fail to compile #466

Closed tkintscher closed 1 year ago

tkintscher commented 1 year ago

Hi,

I updated my machine to kernel 6.1.1, and now the modules won't build anymore:

make: Entering directory '/usr/lib/modules/6.1.1-arch1-1/build'
  CC [M]  /var/lib/dkms/pivccu-modules/1.0.74/build/generic_raw_uart.o
  CC [M]  /var/lib/dkms/pivccu-modules/1.0.74/build/rtc-rx8130.o
/var/lib/dkms/pivccu-modules/1.0.74/build/rtc-rx8130.c:849:19: error: initialization of ‘void (*)(struct i2c_client *)’ from incompatible pointer type ‘int (*)(struct i2c_client *)’ [-Werror=incompatible-pointer-types]
  849 |         .remove = rx8130_remove,
      |                   ^~~~~~~~~~~~~
/var/lib/dkms/pivccu-modules/1.0.74/build/rtc-rx8130.c:849:19: note: (near initialization for ‘rx8130_driver.remove’)
/var/lib/dkms/pivccu-modules/1.0.74/build/generic_raw_uart.c: In function ‘generic_raw_uart_get_gpio_pin_number’:
/var/lib/dkms/pivccu-modules/1.0.74/build/generic_raw_uart.c:852:31: error: implicit declaration of function ‘fwnode_get_named_gpiod’; did you mean ‘fwnode_get_named_child_node’? [-Werror=implicit-function-declaration]
  852 |     struct gpio_desc *gpiod = fwnode_get_named_gpiod(fwnode, label, 0, GPIOD_ASIS, label);
      |                               ^~~~~~~~~~~~~~~~~~~~~~
      |                               fwnode_get_named_child_node

Regarding the generic_raw_uart module, I think this is due to this change in the kernel's GPIO API in version 6.1: https://lore.kernel.org/lkml/CAMRc=Me+4xEgH8S9C594rrd=2_oBe4wqC+ay5iS0YqmEBCuDPQ@mail.gmail.com/T/

Does anyone have a good idea on how to deal with this change?

alexreinert commented 1 year ago

The modules do not support Kernel 6.x yet. How did you update to Kernel 6.1, I do not know any Debian based distribution supporting Kernel 6.x?

tkintscher commented 1 year ago

I am not running Debian, but ArchLinux (yes, yes, I know...) on the host with raspberrymatic in Docker. Inside the container everything is pretty flexible but unfortunately the modules need to be installed on the host.

For the time being, I downgraded to the 5.15 LTS kernel. Yet, a time will come when the 5.x kernel series reaches end of life and folks will have to upgrade. Since I am not familiar with these modules, I thought I'd draw some attention to it already now.

EDIT: Are these modules maintained by eq3 (which may or may not decide to maintain them) or is it solely on you?

tkintscher commented 1 year ago

In case anyone else runs into this:

It seems that the affected code paths are not entered when using an HM-RF-USB adapter (which is all that I have here for testing). So I have just disabled them for now:

kernel-6.1.patch

kalledausb commented 1 year ago

FYI, I installed pivccu-modules-dkms from current "testing" repo and it works with Kernel 6.1 and 6.2 (on Ubuntu 22.10).

tkintscher commented 1 year ago

Thanks for posting!

It seems to have been fixed some days ago with these changes.

Many thanks to everyone who contributed for fixing this so quickly!