]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Drop gpiolib-remove-the-gpio-device-from-the-list-when-it.patch
authorSasha Levin <sashal@kernel.org>
Mon, 22 Jan 2024 10:35:06 +0000 (05:35 -0500)
committerSasha Levin <sashal@kernel.org>
Mon, 22 Jan 2024 10:35:06 +0000 (05:35 -0500)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-6.6/gpiolib-remove-the-gpio-device-from-the-list-when-it.patch [deleted file]
queue-6.6/series
queue-6.7/gpiolib-remove-the-gpio-device-from-the-list-when-it.patch [deleted file]
queue-6.7/series

diff --git a/queue-6.6/gpiolib-remove-the-gpio-device-from-the-list-when-it.patch b/queue-6.6/gpiolib-remove-the-gpio-device-from-the-list-when-it.patch
deleted file mode 100644 (file)
index 370aed8..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-From 50b3f1e0bb835b98de62f79e2463147dd6683e60 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Tue, 2 Jan 2024 16:59:47 +0100
-Subject: gpiolib: remove the GPIO device from the list when it's unregistered
-
-From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
-[ Upstream commit 48e1b4d369cfe2729138a128afa6b8a55d093eaf ]
-
-If we wait until the GPIO device's .release() callback gets invoked
-before we remove it from the global device list, then we risk that
-someone will look it up using gpio_device_find() between where we
-dropped the last reference and before .release() is done taking a
-reference again to an object that's being released.
-
-The device must be removed when it's being unregistered - just like how
-we remove it from the GPIO bus.
-
-Fixes: ff2b13592299 ("gpio: make the gpiochip a real device")
-Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/gpio/gpiolib.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
-index 1a53e1e5379b..0bb28867cb32 100644
---- a/drivers/gpio/gpiolib.c
-+++ b/drivers/gpio/gpiolib.c
-@@ -572,9 +572,6 @@ static void gpiodev_release(struct device *dev)
- {
-       struct gpio_device *gdev = to_gpio_device(dev);
--      scoped_guard(mutex, &gpio_devices_lock)
--              list_del(&gdev->list);
--
-       ida_free(&gpio_ida, gdev->id);
-       kfree_const(gdev->label);
-       kfree(gdev->descs);
-@@ -989,6 +986,9 @@ void gpiochip_remove(struct gpio_chip *gc)
-               dev_crit(&gdev->dev,
-                        "REMOVING GPIOCHIP WITH GPIOS STILL REQUESTED\n");
-+      scoped_guard(mutex, &gpio_devices_lock)
-+              list_del(&gdev->list);
-+
-       /*
-        * The gpiochip side puts its use of the device to rest here:
-        * if there are no userspace clients, the chardev and device will
--- 
-2.43.0
-
index 6a951287815e313dd59684032442904db6b3650d..8a0e8467adb201cf7707bc970a36b63f7142fe88 100644 (file)
@@ -328,7 +328,6 @@ drm-amdkfd-fix-type-of-dbg_flags-in-struct-kfd_proce.patch
 gpiolib-make-gpio_device_get-and-gpio_device_put-pub.patch
 gpiolib-provide-gpio_device_find.patch
 gpio-sysfs-drop-the-mention-of-gpiochip_find-from-sy.patch
-gpiolib-remove-the-gpio-device-from-the-list-when-it.patch
 ib-iser-prevent-invalidating-wrong-mr.patch
 drm-amdkfd-confirm-list-is-non-empty-before-utilizin.patch
 drm-amd-pm-smu7-fix-a-memleak-in-smu7_hwmgr_backend_.patch
diff --git a/queue-6.7/gpiolib-remove-the-gpio-device-from-the-list-when-it.patch b/queue-6.7/gpiolib-remove-the-gpio-device-from-the-list-when-it.patch
deleted file mode 100644 (file)
index 37b9f34..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-From f69f8332c435b5d2f7d3003513501168692e63b4 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Tue, 2 Jan 2024 16:59:47 +0100
-Subject: gpiolib: remove the GPIO device from the list when it's unregistered
-
-From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
-[ Upstream commit 48e1b4d369cfe2729138a128afa6b8a55d093eaf ]
-
-If we wait until the GPIO device's .release() callback gets invoked
-before we remove it from the global device list, then we risk that
-someone will look it up using gpio_device_find() between where we
-dropped the last reference and before .release() is done taking a
-reference again to an object that's being released.
-
-The device must be removed when it's being unregistered - just like how
-we remove it from the GPIO bus.
-
-Fixes: ff2b13592299 ("gpio: make the gpiochip a real device")
-Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/gpio/gpiolib.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
-index 3518481c433f..74bcdb50c931 100644
---- a/drivers/gpio/gpiolib.c
-+++ b/drivers/gpio/gpiolib.c
-@@ -650,9 +650,6 @@ static void gpiodev_release(struct device *dev)
- {
-       struct gpio_device *gdev = to_gpio_device(dev);
--      scoped_guard(mutex, &gpio_devices_lock)
--              list_del(&gdev->list);
--
-       ida_free(&gpio_ida, gdev->id);
-       kfree_const(gdev->label);
-       kfree(gdev->descs);
-@@ -1067,6 +1064,9 @@ void gpiochip_remove(struct gpio_chip *gc)
-               dev_crit(&gdev->dev,
-                        "REMOVING GPIOCHIP WITH GPIOS STILL REQUESTED\n");
-+      scoped_guard(mutex, &gpio_devices_lock)
-+              list_del(&gdev->list);
-+
-       /*
-        * The gpiochip side puts its use of the device to rest here:
-        * if there are no userspace clients, the chardev and device will
--- 
-2.43.0
-
index 861fd0b164ce71b4ea9b425cd4765b4a05497ec5..74411f6d1241977ebdefe9e38ec884358e57eec5 100644 (file)
@@ -364,7 +364,6 @@ alsa-scarlett2-add-missing-mutex-lock-around-get-met.patch
 mmc-sdhci_am654-fix-ti-soc-dependencies.patch
 mmc-sdhci_omap-fix-ti-soc-dependencies.patch
 drm-amdkfd-fix-type-of-dbg_flags-in-struct-kfd_proce.patch
-gpiolib-remove-the-gpio-device-from-the-list-when-it.patch
 ib-iser-prevent-invalidating-wrong-mr.patch
 drm-amdkfd-confirm-list-is-non-empty-before-utilizin.patch
 drm-amd-pm-smu7-fix-a-memleak-in-smu7_hwmgr_backend_.patch