]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Feb 2026 13:46:32 +0000 (14:46 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Feb 2026 13:46:32 +0000 (14:46 +0100)
added patches:
gpio-omap-do-not-register-driver-in-probe.patch

queue-5.15/gpio-omap-do-not-register-driver-in-probe.patch [new file with mode: 0644]
queue-5.15/series

diff --git a/queue-5.15/gpio-omap-do-not-register-driver-in-probe.patch b/queue-5.15/gpio-omap-do-not-register-driver-in-probe.patch
new file mode 100644 (file)
index 0000000..469c230
--- /dev/null
@@ -0,0 +1,85 @@
+From 730e5ebff40c852e3ea57b71bf02a4b89c69435f Mon Sep 17 00:00:00 2001
+From: Danilo Krummrich <dakr@kernel.org>
+Date: Tue, 27 Jan 2026 21:17:12 +0100
+Subject: gpio: omap: do not register driver in probe()
+
+From: Danilo Krummrich <dakr@kernel.org>
+
+commit 730e5ebff40c852e3ea57b71bf02a4b89c69435f upstream.
+
+Commit 11a78b794496 ("ARM: OMAP: MPUIO wake updates") registers the
+omap_mpuio_driver from omap_mpuio_init(), which is called from
+omap_gpio_probe().
+
+However, it neither makes sense to register drivers from probe()
+callbacks of other drivers, nor does the driver core allow registering
+drivers with a device lock already being held.
+
+The latter was revealed by commit dc23806a7c47 ("driver core: enforce
+device_lock for driver_match_device()") leading to a potential deadlock
+condition described in [1].
+
+Additionally, the omap_mpuio_driver is never unregistered from the
+driver core, even if the module is unloaded.
+
+Hence, register the omap_mpuio_driver from the module initcall and
+unregister it in module_exit().
+
+Link: https://lore.kernel.org/lkml/DFU7CEPUSG9A.1KKGVW4HIPMSH@kernel.org/ [1]
+Fixes: dc23806a7c47 ("driver core: enforce device_lock for driver_match_device()")
+Fixes: 11a78b794496 ("ARM: OMAP: MPUIO wake updates")
+Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Danilo Krummrich <dakr@kernel.org>
+Reviewed-by: Rafael J. Wysocki (Intel) <rafael@kernel.org>
+Link: https://patch.msgid.link/20260127201725.35883-1-dakr@kernel.org
+Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpio/gpio-omap.c |   22 ++++++++++++++++++----
+ 1 file changed, 18 insertions(+), 4 deletions(-)
+
+--- a/drivers/gpio/gpio-omap.c
++++ b/drivers/gpio/gpio-omap.c
+@@ -762,10 +762,13 @@ static struct platform_device omap_mpuio
+ static inline void omap_mpuio_init(struct gpio_bank *bank)
+ {
+-      platform_set_drvdata(&omap_mpuio_device, bank);
++      static bool registered;
+-      if (platform_driver_register(&omap_mpuio_driver) == 0)
+-              (void) platform_device_register(&omap_mpuio_device);
++      platform_set_drvdata(&omap_mpuio_device, bank);
++      if (!registered) {
++              (void)platform_device_register(&omap_mpuio_device);
++              registered = true;
++      }
+ }
+ /*---------------------------------------------------------------------*/
+@@ -1574,13 +1577,24 @@ static struct platform_driver omap_gpio_
+  */
+ static int __init omap_gpio_drv_reg(void)
+ {
+-      return platform_driver_register(&omap_gpio_driver);
++      int ret;
++
++      ret = platform_driver_register(&omap_mpuio_driver);
++      if (ret)
++              return ret;
++
++      ret = platform_driver_register(&omap_gpio_driver);
++      if (ret)
++              platform_driver_unregister(&omap_mpuio_driver);
++
++      return ret;
+ }
+ postcore_initcall(omap_gpio_drv_reg);
+ static void __exit omap_gpio_exit(void)
+ {
+       platform_driver_unregister(&omap_gpio_driver);
++      platform_driver_unregister(&omap_mpuio_driver);
+ }
+ module_exit(omap_gpio_exit);
index 3d80d55900af5b5e603c717f4366c12c6714505a..281678e78c776073a4249ea18e69ebba9caabaa3 100644 (file)
@@ -7,3 +7,4 @@ nilfs2-fix-potential-block-overflow-that-cause-system-hang.patch
 scsi-qla2xxx-validate-sp-before-freeing-associated-memory.patch
 scsi-qla2xxx-delay-module-unload-while-fabric-scan-in-progress.patch
 scsi-qla2xxx-query-fw-again-before-proceeding-with-login.patch
+gpio-omap-do-not-register-driver-in-probe.patch