Package: release.debian.org
Severity: normal
Tags: trixie
X-Debbugs-Cc: [email protected]
Control: affects -1 + src:reform-tools
User: [email protected]
Usertags: pu

Hi,

I would like to update reform-tools in Trixie by backporting this upstream
commit which is present in Debian testing since version 1.77.

https://source.mnt.re/reform/reform-tools/-/commit/cc4d5b93e174c58dccaea6b7a218b92e3c058dc6

[ Reason ]

The reform-tools package ships a DKMS module which fails to build with
Linux 6.17 which was uploaded to Trixie-Backports on 2025-11-24. Users
who use the kernel from backports will not be able to build the DKMS
module with the following error message:

CC [M]  reform2_lpc.o
reform2_lpc.c: In function ‘lpc_probe’:
reform2_lpc.c:200:17: error: ‘struct power_supply_config’ has no member named 
‘of_node’; did you mean ‘fwnode’?
200 |         psy_cfg.of_node = spi->dev.of_node;
|                 ^~~~~~~
|                 fwnode

This is because of the following upstream Linux commit:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/include/linux/power_supply.h?h=v6.17.10&id=520c790c83e9e4c915a8e3fc9f2152ece39b6511

[ Impact ]

Users who use Linux from Trixie-backports with reform-tools from Trixie will
not be able to build the reform2_lpc DKMS module and this means that they will
use the battery status information on MNT Reform laptops for which the
reform-tools package is intended.

[ Tests ]

I manually tested the package with the kernel from trixie-backports on an MNT
Reform with RCORE-DSI RK3588:

Setting up reform2-lpc-dkms (1.71-2+deb13u1) ...
Loading new reform2_lpc/1.71 DKMS files...
Building for 6.17.8+1-mnt-reform-arm64

Building initial module reform2_lpc/1.71 for 6.17.8+1-mnt-reform-arm64
Sign command: /lib/modules/6.17.8+1-mnt-reform-arm64/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub

Building module(s).... done.
Signing module /var/lib/dkms/reform2_lpc/1.71/build/reform2_lpc.ko
Installing /lib/modules/6.17.8+1-mnt-reform-arm64/updates/dkms/reform2_lpc.ko.xz
Running depmod....... done.


[ Risks ]

There should be no risks because the changed code is guarded by a preprocessor
directive which should only activate the different code path for Linux kernel
6.17 or later.

[ Checklist ]
  [*] *all* changes are documented in the d/changelog
  [*] I reviewed all changes and I approve them
  [*] attach debdiff against the package in (old)stable
  [*] the issue is verified as fixed in unstable

[ Changes ]

For Linux 6.17 or later, set the fwnode property instead of of_node.

[ Other info ]

I also uploaded reform-tools from testing to trixie-backports (and it's
currently waiting in backports-NEW) but I think users of Debian stable should
be able to use Linux from trixie-backports without also having to use
reform-tools from trixie-backports since the changes made in reform-tools
between the version in trixie and testing are quite disruptive.

Thanks!

cheers, josch
diff -Nru reform-tools-1.71/debian/changelog reform-tools-1.71/debian/changelog
--- reform-tools-1.71/debian/changelog  2025-05-03 23:34:22.000000000 +0200
+++ reform-tools-1.71/debian/changelog  2025-12-03 04:36:58.000000000 +0100
@@ -1,3 +1,9 @@
+reform-tools (1.71-2+deb13u1) trixie; urgency=medium
+
+  * add patch to allow building lpc for linux 6.17 from trixie-backports
+
+ -- Johannes Schauer Marin Rodrigues <[email protected]>  Wed, 03 Dec 2025 
04:36:58 +0100
+
 reform-tools (1.71-2) unstable; urgency=medium
 
   * debian/control: re-introduce dhcpcd-base and iputils-ping which were
diff -Nru 
reform-tools-1.71/debian/patches/0001-reform2_lpc.c-switch-from-of_node-to-fwnode-in-6.17-.patch
 
reform-tools-1.71/debian/patches/0001-reform2_lpc.c-switch-from-of_node-to-fwnode-in-6.17-.patch
--- 
reform-tools-1.71/debian/patches/0001-reform2_lpc.c-switch-from-of_node-to-fwnode-in-6.17-.patch
    1970-01-01 01:00:00.000000000 +0100
+++ 
reform-tools-1.71/debian/patches/0001-reform2_lpc.c-switch-from-of_node-to-fwnode-in-6.17-.patch
    2025-12-03 04:36:58.000000000 +0100
@@ -0,0 +1,30 @@
+From cc4d5b93e174c58dccaea6b7a218b92e3c058dc6 Mon Sep 17 00:00:00 2001
+From: Johannes Schauer Marin Rodrigues <[email protected]>
+Date: Wed, 27 Aug 2025 09:57:43 +0200
+Subject: [PATCH] reform2_lpc.c: switch from of_node to fwnode in 6.17 or later
+
+Link: 
https://lore.kernel.org/r/20250225-psy-core-convert-to-fwnode-v1-4-d5e436993...@collabora.com
+Closes: https://source.mnt.re/reform/reform-tools/-/issues/8
+---
+ lpc/reform2_lpc.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/lpc/reform2_lpc.c b/lpc/reform2_lpc.c
+index f6dad1e..c4f2fac 100644
+--- a/lpc/reform2_lpc.c
++++ b/lpc/reform2_lpc.c
+@@ -183,7 +183,11 @@ static int lpc_probe(struct spi_device *
+               printk(KERN_ERR "%s: device_create_file failed\n", __func__);
+       }
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0)
++      psy_cfg.fwnode = dev_fwnode(&spi->dev);
++#else
+       psy_cfg.of_node = spi->dev.of_node;
++#endif
+       psy_cfg.drv_data = data;
+ 
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)
+-- 
+2.47.3
+
diff -Nru reform-tools-1.71/debian/patches/series 
reform-tools-1.71/debian/patches/series
--- reform-tools-1.71/debian/patches/series     1970-01-01 01:00:00.000000000 
+0100
+++ reform-tools-1.71/debian/patches/series     2025-12-03 04:29:23.000000000 
+0100
@@ -0,0 +1 @@
+0001-reform2_lpc.c-switch-from-of_node-to-fwnode-in-6.17-.patch

Reply via email to