* [Buildroot] [PATCH] package/igh-ethercat: backport fix to build with Linux 6.9
@ 2024-07-19 20:39 Thomas Petazzoni via buildroot
2024-07-30 7:35 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-07-19 20:39 UTC (permalink / raw)
To: buildroot; +Cc: Thomas Petazzoni
This commit backports a patch from upstream that fixes the build with
Linux 6.9.
Fixes:
http://autobuild.buildroot.net/results/db2462b1c5c6797a0edca66a513c121dbddd8888/
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
...Remove-dev_base_lock-for-linux-6.9.0.patch | 51 +++++++++++++++++++
1 file changed, 51 insertions(+)
create mode 100644 package/igh-ethercat/0001-Remove-dev_base_lock-for-linux-6.9.0.patch
diff --git a/package/igh-ethercat/0001-Remove-dev_base_lock-for-linux-6.9.0.patch b/package/igh-ethercat/0001-Remove-dev_base_lock-for-linux-6.9.0.patch
new file mode 100644
index 0000000000..a71edb7be6
--- /dev/null
+++ b/package/igh-ethercat/0001-Remove-dev_base_lock-for-linux-6.9.0.patch
@@ -0,0 +1,51 @@
+From 09eb1b9f73d677d10d18039305b9d974e52cc6d5 Mon Sep 17 00:00:00 2001
+From: Nicola Fontana <ntd@entidi.it>
+Date: Mon, 3 Jun 2024 12:45:48 +0200
+Subject: [PATCH] Remove dev_base_lock for linux >= 6.9.0
+
+Kernel commit 1b3ef46cb7f2618cc0b507393220a69810f6da12 removed
+`dev_base_lock` from v6.9 onward.
+
+Use the alternate iterator `for_each_netdev_rcu` introduced by commit
+c6d14c84566d6b70ad9dc1618db0dec87cca9300 in 2.6.33+.
+
+Upstream: https://gitlab.com/etherlab.org/ethercat/-/commit/95c25b50711ca7e1f990bdcbca8fa713c942ab01
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+---
+ devices/generic.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/devices/generic.c b/devices/generic.c
+index 4d4d9bbd..f30f1e17 100644
+--- a/devices/generic.c
++++ b/devices/generic.c
+@@ -420,14 +420,14 @@ int __init ec_gen_init_module(void)
+ INIT_LIST_HEAD(&generic_devices);
+ INIT_LIST_HEAD(&descs);
+
+- read_lock(&dev_base_lock);
+- for_each_netdev(&init_net, netdev) {
++ rcu_read_lock();
++ for_each_netdev_rcu(&init_net, netdev) {
+ if (netdev->type != ARPHRD_ETHER)
+ continue;
+ desc = kmalloc(sizeof(ec_gen_interface_desc_t), GFP_ATOMIC);
+ if (!desc) {
+ ret = -ENOMEM;
+- read_unlock(&dev_base_lock);
++ rcu_read_unlock();
+ goto out_err;
+ }
+ strncpy(desc->name, netdev->name, IFNAMSIZ);
+@@ -436,7 +436,7 @@ int __init ec_gen_init_module(void)
+ memcpy(desc->dev_addr, netdev->dev_addr, ETH_ALEN);
+ list_add_tail(&desc->list, &descs);
+ }
+- read_unlock(&dev_base_lock);
++ rcu_read_unlock();
+
+ list_for_each_entry_safe(desc, next, &descs, list) {
+ ret = offer_device(desc);
+--
+2.45.2
+
--
2.45.2
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Buildroot] [PATCH] package/igh-ethercat: backport fix to build with Linux 6.9
2024-07-19 20:39 [Buildroot] [PATCH] package/igh-ethercat: backport fix to build with Linux 6.9 Thomas Petazzoni via buildroot
@ 2024-07-30 7:35 ` Thomas Petazzoni via buildroot
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-07-30 7:35 UTC (permalink / raw)
To: Thomas Petazzoni via buildroot; +Cc: Thomas Petazzoni
On Fri, 19 Jul 2024 22:39:33 +0200
Thomas Petazzoni via buildroot <buildroot@buildroot.org> wrote:
> This commit backports a patch from upstream that fixes the build with
> Linux 6.9.
>
> Fixes:
>
> http://autobuild.buildroot.net/results/db2462b1c5c6797a0edca66a513c121dbddd8888/
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
> ...Remove-dev_base_lock-for-linux-6.9.0.patch | 51 +++++++++++++++++++
> 1 file changed, 51 insertions(+)
> create mode 100644 package/igh-ethercat/0001-Remove-dev_base_lock-for-linux-6.9.0.patch
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-07-30 7:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-19 20:39 [Buildroot] [PATCH] package/igh-ethercat: backport fix to build with Linux 6.9 Thomas Petazzoni via buildroot
2024-07-30 7:35 ` Thomas Petazzoni via buildroot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox