From: Greg Kroah-Hartman Date: Wed, 11 Sep 2024 12:49:40 +0000 (+0200) Subject: drop iio patch from 5.4, 5.10, and 5.15 X-Git-Tag: v4.19.322~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2eb49e405b4611ab590b6eda06e83503a3cdd706;p=thirdparty%2Fkernel%2Fstable-queue.git drop iio patch from 5.4, 5.10, and 5.15 --- diff --git a/queue-5.10/iio-adc-ad7606-remove-frstdata-check-for-serial-mode.patch b/queue-5.10/iio-adc-ad7606-remove-frstdata-check-for-serial-mode.patch deleted file mode 100644 index d952137d3ad..00000000000 --- a/queue-5.10/iio-adc-ad7606-remove-frstdata-check-for-serial-mode.patch +++ /dev/null @@ -1,173 +0,0 @@ -From 90826e08468ba7fb35d8b39645b22d9e80004afe Mon Sep 17 00:00:00 2001 -From: Guillaume Stols -Date: Tue, 2 Jul 2024 12:52:51 +0000 -Subject: iio: adc: ad7606: remove frstdata check for serial mode - -From: Guillaume Stols - -commit 90826e08468ba7fb35d8b39645b22d9e80004afe upstream. - -The current implementation attempts to recover from an eventual glitch -in the clock by checking frstdata state after reading the first -channel's sample: If frstdata is low, it will reset the chip and -return -EIO. - -This will only work in parallel mode, where frstdata pin is set low -after the 2nd sample read starts. - -For the serial mode, according to the datasheet, "The FRSTDATA output -returns to a logic low following the 16th SCLK falling edge.", thus -after the Xth pulse, X being the number of bits in a sample, the check -will always be true, and the driver will not work at all in serial -mode if frstdata(optional) is defined in the devicetree as it will -reset the chip, and return -EIO every time read_sample is called. - -Hence, this check must be removed for serial mode. - -Fixes: b9618c0cacd7 ("staging: IIO: ADC: New driver for AD7606/AD7606-6/AD7606-4") -Signed-off-by: Guillaume Stols -Reviewed-by: Nuno Sa -Link: https://patch.msgid.link/20240702-cleanup-ad7606-v3-1-18d5ea18770e@baylibre.com -Cc: -Signed-off-by: Jonathan Cameron -Signed-off-by: Greg Kroah-Hartman ---- - drivers/iio/adc/ad7606.c | 28 +------------------------ - drivers/iio/adc/ad7606.h | 2 + - drivers/iio/adc/ad7606_par.c | 48 ++++++++++++++++++++++++++++++++++++++++--- - 3 files changed, 49 insertions(+), 29 deletions(-) - ---- a/drivers/iio/adc/ad7606.c -+++ b/drivers/iio/adc/ad7606.c -@@ -48,7 +48,7 @@ static const unsigned int ad7616_oversam - 1, 2, 4, 8, 16, 32, 64, 128, - }; - --static int ad7606_reset(struct ad7606_state *st) -+int ad7606_reset(struct ad7606_state *st) - { - if (st->gpio_reset) { - gpiod_set_value(st->gpio_reset, 1); -@@ -59,6 +59,7 @@ static int ad7606_reset(struct ad7606_st - - return -ENODEV; - } -+EXPORT_SYMBOL_NS_GPL(ad7606_reset, IIO_AD7606); - - static int ad7606_reg_access(struct iio_dev *indio_dev, - unsigned int reg, -@@ -87,31 +88,6 @@ static int ad7606_read_samples(struct ad - { - unsigned int num = st->chip_info->num_channels - 1; - u16 *data = st->data; -- int ret; -- -- /* -- * The frstdata signal is set to high while and after reading the sample -- * of the first channel and low for all other channels. This can be used -- * to check that the incoming data is correctly aligned. During normal -- * operation the data should never become unaligned, but some glitch or -- * electrostatic discharge might cause an extra read or clock cycle. -- * Monitoring the frstdata signal allows to recover from such failure -- * situations. -- */ -- -- if (st->gpio_frstdata) { -- ret = st->bops->read_block(st->dev, 1, data); -- if (ret) -- return ret; -- -- if (!gpiod_get_value(st->gpio_frstdata)) { -- ad7606_reset(st); -- return -EIO; -- } -- -- data++; -- num--; -- } - - return st->bops->read_block(st->dev, num, data); - } ---- a/drivers/iio/adc/ad7606.h -+++ b/drivers/iio/adc/ad7606.h -@@ -153,6 +153,8 @@ int ad7606_probe(struct device *dev, int - const char *name, unsigned int id, - const struct ad7606_bus_ops *bops); - -+int ad7606_reset(struct ad7606_state *st); -+ - enum ad7606_supported_device_ids { - ID_AD7605_4, - ID_AD7606_8, ---- a/drivers/iio/adc/ad7606_par.c -+++ b/drivers/iio/adc/ad7606_par.c -@@ -6,6 +6,7 @@ - */ - - #include -+#include - #include - #include - #include -@@ -20,8 +21,29 @@ static int ad7606_par16_read_block(struc - struct iio_dev *indio_dev = dev_get_drvdata(dev); - struct ad7606_state *st = iio_priv(indio_dev); - -- insw((unsigned long)st->base_address, buf, count); - -+ /* -+ * On the parallel interface, the frstdata signal is set to high while -+ * and after reading the sample of the first channel and low for all -+ * other channels. This can be used to check that the incoming data is -+ * correctly aligned. During normal operation the data should never -+ * become unaligned, but some glitch or electrostatic discharge might -+ * cause an extra read or clock cycle. Monitoring the frstdata signal -+ * allows to recover from such failure situations. -+ */ -+ int num = count; -+ u16 *_buf = buf; -+ -+ if (st->gpio_frstdata) { -+ insw((unsigned long)st->base_address, _buf, 1); -+ if (!gpiod_get_value(st->gpio_frstdata)) { -+ ad7606_reset(st); -+ return -EIO; -+ } -+ _buf++; -+ num--; -+ } -+ insw((unsigned long)st->base_address, _buf, num); - return 0; - } - -@@ -34,8 +56,28 @@ static int ad7606_par8_read_block(struct - { - struct iio_dev *indio_dev = dev_get_drvdata(dev); - struct ad7606_state *st = iio_priv(indio_dev); -- -- insb((unsigned long)st->base_address, buf, count * 2); -+ /* -+ * On the parallel interface, the frstdata signal is set to high while -+ * and after reading the sample of the first channel and low for all -+ * other channels. This can be used to check that the incoming data is -+ * correctly aligned. During normal operation the data should never -+ * become unaligned, but some glitch or electrostatic discharge might -+ * cause an extra read or clock cycle. Monitoring the frstdata signal -+ * allows to recover from such failure situations. -+ */ -+ int num = count; -+ u16 *_buf = buf; -+ -+ if (st->gpio_frstdata) { -+ insb((unsigned long)st->base_address, _buf, 2); -+ if (!gpiod_get_value(st->gpio_frstdata)) { -+ ad7606_reset(st); -+ return -EIO; -+ } -+ _buf++; -+ num--; -+ } -+ insb((unsigned long)st->base_address, _buf, num * 2); - - return 0; - } diff --git a/queue-5.10/series b/queue-5.10/series index 242091ef331..24b38ee5a29 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -158,7 +158,6 @@ nfsv4-add-missing-rescheduling-points-in-nfs_client_.patch staging-iio-frequency-ad9834-validate-frequency-parameter-value.patch iio-buffer-dmaengine-fix-releasing-dma-channel-on-error.patch iio-fix-scale-application-in-iio_convert_raw_to_processed_unlocked.patch -iio-adc-ad7606-remove-frstdata-check-for-serial-mode.patch iio-adc-ad7124-fix-chip-id-mismatch.patch binder-fix-uaf-caused-by-offsets-overwrite.patch nvmem-fix-return-type-of-devm_nvmem_device_get-in-kerneldoc.patch diff --git a/queue-5.15/iio-adc-ad7606-remove-frstdata-check-for-serial-mode.patch b/queue-5.15/iio-adc-ad7606-remove-frstdata-check-for-serial-mode.patch deleted file mode 100644 index d952137d3ad..00000000000 --- a/queue-5.15/iio-adc-ad7606-remove-frstdata-check-for-serial-mode.patch +++ /dev/null @@ -1,173 +0,0 @@ -From 90826e08468ba7fb35d8b39645b22d9e80004afe Mon Sep 17 00:00:00 2001 -From: Guillaume Stols -Date: Tue, 2 Jul 2024 12:52:51 +0000 -Subject: iio: adc: ad7606: remove frstdata check for serial mode - -From: Guillaume Stols - -commit 90826e08468ba7fb35d8b39645b22d9e80004afe upstream. - -The current implementation attempts to recover from an eventual glitch -in the clock by checking frstdata state after reading the first -channel's sample: If frstdata is low, it will reset the chip and -return -EIO. - -This will only work in parallel mode, where frstdata pin is set low -after the 2nd sample read starts. - -For the serial mode, according to the datasheet, "The FRSTDATA output -returns to a logic low following the 16th SCLK falling edge.", thus -after the Xth pulse, X being the number of bits in a sample, the check -will always be true, and the driver will not work at all in serial -mode if frstdata(optional) is defined in the devicetree as it will -reset the chip, and return -EIO every time read_sample is called. - -Hence, this check must be removed for serial mode. - -Fixes: b9618c0cacd7 ("staging: IIO: ADC: New driver for AD7606/AD7606-6/AD7606-4") -Signed-off-by: Guillaume Stols -Reviewed-by: Nuno Sa -Link: https://patch.msgid.link/20240702-cleanup-ad7606-v3-1-18d5ea18770e@baylibre.com -Cc: -Signed-off-by: Jonathan Cameron -Signed-off-by: Greg Kroah-Hartman ---- - drivers/iio/adc/ad7606.c | 28 +------------------------ - drivers/iio/adc/ad7606.h | 2 + - drivers/iio/adc/ad7606_par.c | 48 ++++++++++++++++++++++++++++++++++++++++--- - 3 files changed, 49 insertions(+), 29 deletions(-) - ---- a/drivers/iio/adc/ad7606.c -+++ b/drivers/iio/adc/ad7606.c -@@ -48,7 +48,7 @@ static const unsigned int ad7616_oversam - 1, 2, 4, 8, 16, 32, 64, 128, - }; - --static int ad7606_reset(struct ad7606_state *st) -+int ad7606_reset(struct ad7606_state *st) - { - if (st->gpio_reset) { - gpiod_set_value(st->gpio_reset, 1); -@@ -59,6 +59,7 @@ static int ad7606_reset(struct ad7606_st - - return -ENODEV; - } -+EXPORT_SYMBOL_NS_GPL(ad7606_reset, IIO_AD7606); - - static int ad7606_reg_access(struct iio_dev *indio_dev, - unsigned int reg, -@@ -87,31 +88,6 @@ static int ad7606_read_samples(struct ad - { - unsigned int num = st->chip_info->num_channels - 1; - u16 *data = st->data; -- int ret; -- -- /* -- * The frstdata signal is set to high while and after reading the sample -- * of the first channel and low for all other channels. This can be used -- * to check that the incoming data is correctly aligned. During normal -- * operation the data should never become unaligned, but some glitch or -- * electrostatic discharge might cause an extra read or clock cycle. -- * Monitoring the frstdata signal allows to recover from such failure -- * situations. -- */ -- -- if (st->gpio_frstdata) { -- ret = st->bops->read_block(st->dev, 1, data); -- if (ret) -- return ret; -- -- if (!gpiod_get_value(st->gpio_frstdata)) { -- ad7606_reset(st); -- return -EIO; -- } -- -- data++; -- num--; -- } - - return st->bops->read_block(st->dev, num, data); - } ---- a/drivers/iio/adc/ad7606.h -+++ b/drivers/iio/adc/ad7606.h -@@ -153,6 +153,8 @@ int ad7606_probe(struct device *dev, int - const char *name, unsigned int id, - const struct ad7606_bus_ops *bops); - -+int ad7606_reset(struct ad7606_state *st); -+ - enum ad7606_supported_device_ids { - ID_AD7605_4, - ID_AD7606_8, ---- a/drivers/iio/adc/ad7606_par.c -+++ b/drivers/iio/adc/ad7606_par.c -@@ -6,6 +6,7 @@ - */ - - #include -+#include - #include - #include - #include -@@ -20,8 +21,29 @@ static int ad7606_par16_read_block(struc - struct iio_dev *indio_dev = dev_get_drvdata(dev); - struct ad7606_state *st = iio_priv(indio_dev); - -- insw((unsigned long)st->base_address, buf, count); - -+ /* -+ * On the parallel interface, the frstdata signal is set to high while -+ * and after reading the sample of the first channel and low for all -+ * other channels. This can be used to check that the incoming data is -+ * correctly aligned. During normal operation the data should never -+ * become unaligned, but some glitch or electrostatic discharge might -+ * cause an extra read or clock cycle. Monitoring the frstdata signal -+ * allows to recover from such failure situations. -+ */ -+ int num = count; -+ u16 *_buf = buf; -+ -+ if (st->gpio_frstdata) { -+ insw((unsigned long)st->base_address, _buf, 1); -+ if (!gpiod_get_value(st->gpio_frstdata)) { -+ ad7606_reset(st); -+ return -EIO; -+ } -+ _buf++; -+ num--; -+ } -+ insw((unsigned long)st->base_address, _buf, num); - return 0; - } - -@@ -34,8 +56,28 @@ static int ad7606_par8_read_block(struct - { - struct iio_dev *indio_dev = dev_get_drvdata(dev); - struct ad7606_state *st = iio_priv(indio_dev); -- -- insb((unsigned long)st->base_address, buf, count * 2); -+ /* -+ * On the parallel interface, the frstdata signal is set to high while -+ * and after reading the sample of the first channel and low for all -+ * other channels. This can be used to check that the incoming data is -+ * correctly aligned. During normal operation the data should never -+ * become unaligned, but some glitch or electrostatic discharge might -+ * cause an extra read or clock cycle. Monitoring the frstdata signal -+ * allows to recover from such failure situations. -+ */ -+ int num = count; -+ u16 *_buf = buf; -+ -+ if (st->gpio_frstdata) { -+ insb((unsigned long)st->base_address, _buf, 2); -+ if (!gpiod_get_value(st->gpio_frstdata)) { -+ ad7606_reset(st); -+ return -EIO; -+ } -+ _buf++; -+ num--; -+ } -+ insb((unsigned long)st->base_address, _buf, num * 2); - - return 0; - } diff --git a/queue-5.15/series b/queue-5.15/series index 6335ab93a8f..db3fabf2f43 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -175,7 +175,6 @@ staging-iio-frequency-ad9834-validate-frequency-parameter-value.patch iio-buffer-dmaengine-fix-releasing-dma-channel-on-error.patch iio-fix-scale-application-in-iio_convert_raw_to_processed_unlocked.patch iio-adc-ad7124-fix-config-comparison.patch -iio-adc-ad7606-remove-frstdata-check-for-serial-mode.patch iio-adc-ad7124-fix-chip-id-mismatch.patch usb-dwc3-core-update-lc-timer-as-per-usb-spec-v3.2.patch binder-fix-uaf-caused-by-offsets-overwrite.patch diff --git a/queue-5.4/iio-adc-ad7606-remove-frstdata-check-for-serial-mode.patch b/queue-5.4/iio-adc-ad7606-remove-frstdata-check-for-serial-mode.patch deleted file mode 100644 index d952137d3ad..00000000000 --- a/queue-5.4/iio-adc-ad7606-remove-frstdata-check-for-serial-mode.patch +++ /dev/null @@ -1,173 +0,0 @@ -From 90826e08468ba7fb35d8b39645b22d9e80004afe Mon Sep 17 00:00:00 2001 -From: Guillaume Stols -Date: Tue, 2 Jul 2024 12:52:51 +0000 -Subject: iio: adc: ad7606: remove frstdata check for serial mode - -From: Guillaume Stols - -commit 90826e08468ba7fb35d8b39645b22d9e80004afe upstream. - -The current implementation attempts to recover from an eventual glitch -in the clock by checking frstdata state after reading the first -channel's sample: If frstdata is low, it will reset the chip and -return -EIO. - -This will only work in parallel mode, where frstdata pin is set low -after the 2nd sample read starts. - -For the serial mode, according to the datasheet, "The FRSTDATA output -returns to a logic low following the 16th SCLK falling edge.", thus -after the Xth pulse, X being the number of bits in a sample, the check -will always be true, and the driver will not work at all in serial -mode if frstdata(optional) is defined in the devicetree as it will -reset the chip, and return -EIO every time read_sample is called. - -Hence, this check must be removed for serial mode. - -Fixes: b9618c0cacd7 ("staging: IIO: ADC: New driver for AD7606/AD7606-6/AD7606-4") -Signed-off-by: Guillaume Stols -Reviewed-by: Nuno Sa -Link: https://patch.msgid.link/20240702-cleanup-ad7606-v3-1-18d5ea18770e@baylibre.com -Cc: -Signed-off-by: Jonathan Cameron -Signed-off-by: Greg Kroah-Hartman ---- - drivers/iio/adc/ad7606.c | 28 +------------------------ - drivers/iio/adc/ad7606.h | 2 + - drivers/iio/adc/ad7606_par.c | 48 ++++++++++++++++++++++++++++++++++++++++--- - 3 files changed, 49 insertions(+), 29 deletions(-) - ---- a/drivers/iio/adc/ad7606.c -+++ b/drivers/iio/adc/ad7606.c -@@ -48,7 +48,7 @@ static const unsigned int ad7616_oversam - 1, 2, 4, 8, 16, 32, 64, 128, - }; - --static int ad7606_reset(struct ad7606_state *st) -+int ad7606_reset(struct ad7606_state *st) - { - if (st->gpio_reset) { - gpiod_set_value(st->gpio_reset, 1); -@@ -59,6 +59,7 @@ static int ad7606_reset(struct ad7606_st - - return -ENODEV; - } -+EXPORT_SYMBOL_NS_GPL(ad7606_reset, IIO_AD7606); - - static int ad7606_reg_access(struct iio_dev *indio_dev, - unsigned int reg, -@@ -87,31 +88,6 @@ static int ad7606_read_samples(struct ad - { - unsigned int num = st->chip_info->num_channels - 1; - u16 *data = st->data; -- int ret; -- -- /* -- * The frstdata signal is set to high while and after reading the sample -- * of the first channel and low for all other channels. This can be used -- * to check that the incoming data is correctly aligned. During normal -- * operation the data should never become unaligned, but some glitch or -- * electrostatic discharge might cause an extra read or clock cycle. -- * Monitoring the frstdata signal allows to recover from such failure -- * situations. -- */ -- -- if (st->gpio_frstdata) { -- ret = st->bops->read_block(st->dev, 1, data); -- if (ret) -- return ret; -- -- if (!gpiod_get_value(st->gpio_frstdata)) { -- ad7606_reset(st); -- return -EIO; -- } -- -- data++; -- num--; -- } - - return st->bops->read_block(st->dev, num, data); - } ---- a/drivers/iio/adc/ad7606.h -+++ b/drivers/iio/adc/ad7606.h -@@ -153,6 +153,8 @@ int ad7606_probe(struct device *dev, int - const char *name, unsigned int id, - const struct ad7606_bus_ops *bops); - -+int ad7606_reset(struct ad7606_state *st); -+ - enum ad7606_supported_device_ids { - ID_AD7605_4, - ID_AD7606_8, ---- a/drivers/iio/adc/ad7606_par.c -+++ b/drivers/iio/adc/ad7606_par.c -@@ -6,6 +6,7 @@ - */ - - #include -+#include - #include - #include - #include -@@ -20,8 +21,29 @@ static int ad7606_par16_read_block(struc - struct iio_dev *indio_dev = dev_get_drvdata(dev); - struct ad7606_state *st = iio_priv(indio_dev); - -- insw((unsigned long)st->base_address, buf, count); - -+ /* -+ * On the parallel interface, the frstdata signal is set to high while -+ * and after reading the sample of the first channel and low for all -+ * other channels. This can be used to check that the incoming data is -+ * correctly aligned. During normal operation the data should never -+ * become unaligned, but some glitch or electrostatic discharge might -+ * cause an extra read or clock cycle. Monitoring the frstdata signal -+ * allows to recover from such failure situations. -+ */ -+ int num = count; -+ u16 *_buf = buf; -+ -+ if (st->gpio_frstdata) { -+ insw((unsigned long)st->base_address, _buf, 1); -+ if (!gpiod_get_value(st->gpio_frstdata)) { -+ ad7606_reset(st); -+ return -EIO; -+ } -+ _buf++; -+ num--; -+ } -+ insw((unsigned long)st->base_address, _buf, num); - return 0; - } - -@@ -34,8 +56,28 @@ static int ad7606_par8_read_block(struct - { - struct iio_dev *indio_dev = dev_get_drvdata(dev); - struct ad7606_state *st = iio_priv(indio_dev); -- -- insb((unsigned long)st->base_address, buf, count * 2); -+ /* -+ * On the parallel interface, the frstdata signal is set to high while -+ * and after reading the sample of the first channel and low for all -+ * other channels. This can be used to check that the incoming data is -+ * correctly aligned. During normal operation the data should never -+ * become unaligned, but some glitch or electrostatic discharge might -+ * cause an extra read or clock cycle. Monitoring the frstdata signal -+ * allows to recover from such failure situations. -+ */ -+ int num = count; -+ u16 *_buf = buf; -+ -+ if (st->gpio_frstdata) { -+ insb((unsigned long)st->base_address, _buf, 2); -+ if (!gpiod_get_value(st->gpio_frstdata)) { -+ ad7606_reset(st); -+ return -EIO; -+ } -+ _buf++; -+ num--; -+ } -+ insb((unsigned long)st->base_address, _buf, num * 2); - - return 0; - } diff --git a/queue-5.4/series b/queue-5.4/series index e8046f225e4..168c2c3294f 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -95,7 +95,6 @@ nfsv4-add-missing-rescheduling-points-in-nfs_client_.patch staging-iio-frequency-ad9834-validate-frequency-parameter-value.patch iio-buffer-dmaengine-fix-releasing-dma-channel-on-error.patch iio-fix-scale-application-in-iio_convert_raw_to_processed_unlocked.patch -iio-adc-ad7606-remove-frstdata-check-for-serial-mode.patch binder-fix-uaf-caused-by-offsets-overwrite.patch nvmem-fix-return-type-of-devm_nvmem_device_get-in-kerneldoc.patch uio_hv_generic-fix-kernel-null-pointer-dereference-in-hv_uio_rescind.patch