From f4b0ddebaa0b74e1b8c8a176c82bfc5dd5fe570a Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Mon, 22 Jan 2024 05:35:06 -0500 Subject: [PATCH] Drop gpiolib-remove-the-gpio-device-from-the-list-when-it.patch Signed-off-by: Sasha Levin --- ...he-gpio-device-from-the-list-when-it.patch | 53 ------------------- queue-6.6/series | 1 - ...he-gpio-device-from-the-list-when-it.patch | 53 ------------------- queue-6.7/series | 1 - 4 files changed, 108 deletions(-) delete mode 100644 queue-6.6/gpiolib-remove-the-gpio-device-from-the-list-when-it.patch delete mode 100644 queue-6.7/gpiolib-remove-the-gpio-device-from-the-list-when-it.patch 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 index 370aed83d93..00000000000 --- a/queue-6.6/gpiolib-remove-the-gpio-device-from-the-list-when-it.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 50b3f1e0bb835b98de62f79e2463147dd6683e60 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -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 - -[ 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 -Reviewed-by: Linus Walleij -Signed-off-by: Sasha Levin ---- - 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 - diff --git a/queue-6.6/series b/queue-6.6/series index 6a951287815..8a0e8467adb 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -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 index 37b9f34e18f..00000000000 --- a/queue-6.7/gpiolib-remove-the-gpio-device-from-the-list-when-it.patch +++ /dev/null @@ -1,53 +0,0 @@ -From f69f8332c435b5d2f7d3003513501168692e63b4 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -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 - -[ 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 -Reviewed-by: Linus Walleij -Signed-off-by: Sasha Levin ---- - 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 - diff --git a/queue-6.7/series b/queue-6.7/series index 861fd0b164c..74411f6d124 100644 --- a/queue-6.7/series +++ b/queue-6.7/series @@ -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 -- 2.47.3