]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
drop hwmon-sht15-fix-wrong-assumptions-in-device-remove-c.patch from 5.10 and older
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Aug 2022 18:21:59 +0000 (20:21 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Aug 2022 18:21:59 +0000 (20:21 +0200)
queue-4.14/hwmon-sht15-fix-wrong-assumptions-in-device-remove-c.patch [deleted file]
queue-4.14/series
queue-4.19/hwmon-sht15-fix-wrong-assumptions-in-device-remove-c.patch [deleted file]
queue-4.19/series
queue-5.10/hwmon-sht15-fix-wrong-assumptions-in-device-remove-c.patch [deleted file]
queue-5.10/series
queue-5.4/hwmon-sht15-fix-wrong-assumptions-in-device-remove-c.patch [deleted file]
queue-5.4/series

diff --git a/queue-4.14/hwmon-sht15-fix-wrong-assumptions-in-device-remove-c.patch b/queue-4.14/hwmon-sht15-fix-wrong-assumptions-in-device-remove-c.patch
deleted file mode 100644 (file)
index c1ae344..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-From 7f0718f05628f618515e1a2e43a11de1b551106f Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 25 Jul 2022 21:43:44 +0200
-Subject: hwmon: (sht15) Fix wrong assumptions in device remove callback
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
-
-[ Upstream commit 7d4edccc9bbfe1dcdff641343f7b0c6763fbe774 ]
-
-Taking a lock at the beginning of .remove() doesn't prevent new readers.
-With the existing approach it can happen, that a read occurs just when
-the lock was taken blocking the reader until the lock is released at the
-end of the remove callback which then accessed *data that is already
-freed then.
-
-To actually fix this problem the hwmon core needs some adaption. Until
-this is implemented take the optimistic approach of assuming that all
-readers are gone after hwmon_device_unregister() and
-sysfs_remove_group() as most other drivers do. (And once the core
-implements that, taking the lock would deadlock.)
-
-So drop the lock, move the reset to after device unregistration to keep
-the device in a workable state until it's deregistered. Also add a error
-message in case the reset fails and return 0 anyhow. (Returning an error
-code, doesn't stop the platform device unregistration and only results
-in a little helpful error message before the devm cleanup handlers are
-called.)
-
-Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
-Link: https://lore.kernel.org/r/20220725194344.150098-1-u.kleine-koenig@pengutronix.de
-Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/hwmon/sht15.c | 17 ++++++-----------
- 1 file changed, 6 insertions(+), 11 deletions(-)
-
-diff --git a/drivers/hwmon/sht15.c b/drivers/hwmon/sht15.c
-index e4d642b673c6..69fe8946442c 100644
---- a/drivers/hwmon/sht15.c
-+++ b/drivers/hwmon/sht15.c
-@@ -1095,25 +1095,20 @@ static int sht15_probe(struct platform_device *pdev)
- static int sht15_remove(struct platform_device *pdev)
- {
-       struct sht15_data *data = platform_get_drvdata(pdev);
-+      int ret;
--      /*
--       * Make sure any reads from the device are done and
--       * prevent new ones beginning
--       */
--      mutex_lock(&data->read_lock);
--      if (sht15_soft_reset(data)) {
--              mutex_unlock(&data->read_lock);
--              return -EFAULT;
--      }
-       hwmon_device_unregister(data->hwmon_dev);
-       sysfs_remove_group(&pdev->dev.kobj, &sht15_attr_group);
-+
-+      ret = sht15_soft_reset(data);
-+      if (ret)
-+              dev_err(&pdev->dev, "Failed to reset device (%pe)\n", ERR_PTR(ret));
-+
-       if (!IS_ERR(data->reg)) {
-               regulator_unregister_notifier(data->reg, &data->nb);
-               regulator_disable(data->reg);
-       }
--      mutex_unlock(&data->read_lock);
--
-       return 0;
- }
--- 
-2.35.1
-
index ed62cd1184ef1fa336091106c3b2c3b2c3f01190..4ea592e362363d05363b75ec92394afc680139bc 100644 (file)
@@ -44,7 +44,6 @@ arm-dts-imx6ul-fix-qspi-node-compatible.patch
 arm-omap2-display-fix-refcount-leak-bug.patch
 acpi-pm-save-nvs-memory-for-lenovo-g40-45.patch
 acpi-lpss-fix-missing-check-in-register_device_clock.patch
-hwmon-sht15-fix-wrong-assumptions-in-device-remove-c.patch
 pm-hibernate-defer-device-probing-when-resuming-from.patch
 selinux-add-boundary-check-in-put_entry.patch
 arm-findbit-fix-overflowing-offset.patch
diff --git a/queue-4.19/hwmon-sht15-fix-wrong-assumptions-in-device-remove-c.patch b/queue-4.19/hwmon-sht15-fix-wrong-assumptions-in-device-remove-c.patch
deleted file mode 100644 (file)
index ef9d830..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-From a9bd1e939b1769cd41424bcc035f1284de34d8bc Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 25 Jul 2022 21:43:44 +0200
-Subject: hwmon: (sht15) Fix wrong assumptions in device remove callback
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
-
-[ Upstream commit 7d4edccc9bbfe1dcdff641343f7b0c6763fbe774 ]
-
-Taking a lock at the beginning of .remove() doesn't prevent new readers.
-With the existing approach it can happen, that a read occurs just when
-the lock was taken blocking the reader until the lock is released at the
-end of the remove callback which then accessed *data that is already
-freed then.
-
-To actually fix this problem the hwmon core needs some adaption. Until
-this is implemented take the optimistic approach of assuming that all
-readers are gone after hwmon_device_unregister() and
-sysfs_remove_group() as most other drivers do. (And once the core
-implements that, taking the lock would deadlock.)
-
-So drop the lock, move the reset to after device unregistration to keep
-the device in a workable state until it's deregistered. Also add a error
-message in case the reset fails and return 0 anyhow. (Returning an error
-code, doesn't stop the platform device unregistration and only results
-in a little helpful error message before the devm cleanup handlers are
-called.)
-
-Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
-Link: https://lore.kernel.org/r/20220725194344.150098-1-u.kleine-koenig@pengutronix.de
-Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/hwmon/sht15.c | 17 ++++++-----------
- 1 file changed, 6 insertions(+), 11 deletions(-)
-
-diff --git a/drivers/hwmon/sht15.c b/drivers/hwmon/sht15.c
-index 2be77752cd56..0a4578aae85b 100644
---- a/drivers/hwmon/sht15.c
-+++ b/drivers/hwmon/sht15.c
-@@ -1029,25 +1029,20 @@ static int sht15_probe(struct platform_device *pdev)
- static int sht15_remove(struct platform_device *pdev)
- {
-       struct sht15_data *data = platform_get_drvdata(pdev);
-+      int ret;
--      /*
--       * Make sure any reads from the device are done and
--       * prevent new ones beginning
--       */
--      mutex_lock(&data->read_lock);
--      if (sht15_soft_reset(data)) {
--              mutex_unlock(&data->read_lock);
--              return -EFAULT;
--      }
-       hwmon_device_unregister(data->hwmon_dev);
-       sysfs_remove_group(&pdev->dev.kobj, &sht15_attr_group);
-+
-+      ret = sht15_soft_reset(data);
-+      if (ret)
-+              dev_err(&pdev->dev, "Failed to reset device (%pe)\n", ERR_PTR(ret));
-+
-       if (!IS_ERR(data->reg)) {
-               regulator_unregister_notifier(data->reg, &data->nb);
-               regulator_disable(data->reg);
-       }
--      mutex_unlock(&data->read_lock);
--
-       return 0;
- }
--- 
-2.35.1
-
index 17131a46f509b1fd16e1282ee00fc41a3febc5a3..534b71afc691e6f04ec383c114f6eaf655a6e975 100644 (file)
@@ -48,7 +48,6 @@ acpi-ec-remove-duplicate-thinkpad-x1-carbon-6th-entr.patch
 acpi-pm-save-nvs-memory-for-lenovo-g40-45.patch
 acpi-lpss-fix-missing-check-in-register_device_clock.patch
 arm64-dts-qcom-ipq8074-fix-nand-node-name.patch
-hwmon-sht15-fix-wrong-assumptions-in-device-remove-c.patch
 pm-hibernate-defer-device-probing-when-resuming-from.patch
 selinux-add-boundary-check-in-put_entry.patch
 arm-findbit-fix-overflowing-offset.patch
diff --git a/queue-5.10/hwmon-sht15-fix-wrong-assumptions-in-device-remove-c.patch b/queue-5.10/hwmon-sht15-fix-wrong-assumptions-in-device-remove-c.patch
deleted file mode 100644 (file)
index e2a918f..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-From eeb2c8e54dd37082a17c4486e5e54c4de8e3040f Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 25 Jul 2022 21:43:44 +0200
-Subject: hwmon: (sht15) Fix wrong assumptions in device remove callback
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
-
-[ Upstream commit 7d4edccc9bbfe1dcdff641343f7b0c6763fbe774 ]
-
-Taking a lock at the beginning of .remove() doesn't prevent new readers.
-With the existing approach it can happen, that a read occurs just when
-the lock was taken blocking the reader until the lock is released at the
-end of the remove callback which then accessed *data that is already
-freed then.
-
-To actually fix this problem the hwmon core needs some adaption. Until
-this is implemented take the optimistic approach of assuming that all
-readers are gone after hwmon_device_unregister() and
-sysfs_remove_group() as most other drivers do. (And once the core
-implements that, taking the lock would deadlock.)
-
-So drop the lock, move the reset to after device unregistration to keep
-the device in a workable state until it's deregistered. Also add a error
-message in case the reset fails and return 0 anyhow. (Returning an error
-code, doesn't stop the platform device unregistration and only results
-in a little helpful error message before the devm cleanup handlers are
-called.)
-
-Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
-Link: https://lore.kernel.org/r/20220725194344.150098-1-u.kleine-koenig@pengutronix.de
-Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/hwmon/sht15.c | 17 ++++++-----------
- 1 file changed, 6 insertions(+), 11 deletions(-)
-
-diff --git a/drivers/hwmon/sht15.c b/drivers/hwmon/sht15.c
-index 7f4a63959730..ae4d14257a11 100644
---- a/drivers/hwmon/sht15.c
-+++ b/drivers/hwmon/sht15.c
-@@ -1020,25 +1020,20 @@ static int sht15_probe(struct platform_device *pdev)
- static int sht15_remove(struct platform_device *pdev)
- {
-       struct sht15_data *data = platform_get_drvdata(pdev);
-+      int ret;
--      /*
--       * Make sure any reads from the device are done and
--       * prevent new ones beginning
--       */
--      mutex_lock(&data->read_lock);
--      if (sht15_soft_reset(data)) {
--              mutex_unlock(&data->read_lock);
--              return -EFAULT;
--      }
-       hwmon_device_unregister(data->hwmon_dev);
-       sysfs_remove_group(&pdev->dev.kobj, &sht15_attr_group);
-+
-+      ret = sht15_soft_reset(data);
-+      if (ret)
-+              dev_err(&pdev->dev, "Failed to reset device (%pe)\n", ERR_PTR(ret));
-+
-       if (!IS_ERR(data->reg)) {
-               regulator_unregister_notifier(data->reg, &data->nb);
-               regulator_disable(data->reg);
-       }
--      mutex_unlock(&data->read_lock);
--
-       return 0;
- }
--- 
-2.35.1
-
index 5a8d7854d6697be5e394ce21c1c51d4a09ec4f6f..6812cdb4c31403416061b6091ce2391407ce631d 100644 (file)
@@ -100,7 +100,6 @@ arm64-dts-qcom-ipq8074-fix-nand-node-name.patch
 arm64-dts-allwinner-a64-orangepi-win-fix-led-node-na.patch
 arm-shmobile-rcar-gen2-increase-refcount-for-new-ref.patch
 firmware-tegra-fix-error-check-return-value-of-debug.patch
-hwmon-sht15-fix-wrong-assumptions-in-device-remove-c.patch
 pm-hibernate-defer-device-probing-when-resuming-from.patch
 selinux-add-boundary-check-in-put_entry.patch
 powerpc-64s-disable-stack-variable-initialisation-fo.patch
diff --git a/queue-5.4/hwmon-sht15-fix-wrong-assumptions-in-device-remove-c.patch b/queue-5.4/hwmon-sht15-fix-wrong-assumptions-in-device-remove-c.patch
deleted file mode 100644 (file)
index 1d83bea..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-From 4e5fae8cb030e8258f93f13aae690ddda1cbd985 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 25 Jul 2022 21:43:44 +0200
-Subject: hwmon: (sht15) Fix wrong assumptions in device remove callback
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
-
-[ Upstream commit 7d4edccc9bbfe1dcdff641343f7b0c6763fbe774 ]
-
-Taking a lock at the beginning of .remove() doesn't prevent new readers.
-With the existing approach it can happen, that a read occurs just when
-the lock was taken blocking the reader until the lock is released at the
-end of the remove callback which then accessed *data that is already
-freed then.
-
-To actually fix this problem the hwmon core needs some adaption. Until
-this is implemented take the optimistic approach of assuming that all
-readers are gone after hwmon_device_unregister() and
-sysfs_remove_group() as most other drivers do. (And once the core
-implements that, taking the lock would deadlock.)
-
-So drop the lock, move the reset to after device unregistration to keep
-the device in a workable state until it's deregistered. Also add a error
-message in case the reset fails and return 0 anyhow. (Returning an error
-code, doesn't stop the platform device unregistration and only results
-in a little helpful error message before the devm cleanup handlers are
-called.)
-
-Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
-Link: https://lore.kernel.org/r/20220725194344.150098-1-u.kleine-koenig@pengutronix.de
-Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/hwmon/sht15.c | 17 ++++++-----------
- 1 file changed, 6 insertions(+), 11 deletions(-)
-
-diff --git a/drivers/hwmon/sht15.c b/drivers/hwmon/sht15.c
-index 7f4a63959730..ae4d14257a11 100644
---- a/drivers/hwmon/sht15.c
-+++ b/drivers/hwmon/sht15.c
-@@ -1020,25 +1020,20 @@ static int sht15_probe(struct platform_device *pdev)
- static int sht15_remove(struct platform_device *pdev)
- {
-       struct sht15_data *data = platform_get_drvdata(pdev);
-+      int ret;
--      /*
--       * Make sure any reads from the device are done and
--       * prevent new ones beginning
--       */
--      mutex_lock(&data->read_lock);
--      if (sht15_soft_reset(data)) {
--              mutex_unlock(&data->read_lock);
--              return -EFAULT;
--      }
-       hwmon_device_unregister(data->hwmon_dev);
-       sysfs_remove_group(&pdev->dev.kobj, &sht15_attr_group);
-+
-+      ret = sht15_soft_reset(data);
-+      if (ret)
-+              dev_err(&pdev->dev, "Failed to reset device (%pe)\n", ERR_PTR(ret));
-+
-       if (!IS_ERR(data->reg)) {
-               regulator_unregister_notifier(data->reg, &data->nb);
-               regulator_disable(data->reg);
-       }
--      mutex_unlock(&data->read_lock);
--
-       return 0;
- }
--- 
-2.35.1
-
index a638aa4ca71a3d07598edb1dd8c9482aa7d8c3b7..a20c2196db7842926e6cb6efb42d3c7862e78a7e 100644 (file)
@@ -68,7 +68,6 @@ acpi-lpss-fix-missing-check-in-register_device_clock.patch
 arm64-dts-qcom-ipq8074-fix-nand-node-name.patch
 arm64-dts-allwinner-a64-orangepi-win-fix-led-node-na.patch
 arm-shmobile-rcar-gen2-increase-refcount-for-new-ref.patch
-hwmon-sht15-fix-wrong-assumptions-in-device-remove-c.patch
 pm-hibernate-defer-device-probing-when-resuming-from.patch
 selinux-add-boundary-check-in-put_entry.patch
 spi-spi-rspi-fix-pio-fallback-on-rz-platforms.patch