From d7874adbc0e3604c701bd555a3505d7f279f724a Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 12 May 2025 12:23:19 +0200 Subject: [PATCH] 5.4-stable patches added patches: iio-adc-ad7606-fix-serial-register-access.patch iio-adis16201-correct-inclinometer-channel-resolution.patch iio-imu-st_lsm6dsx-fix-possible-lockup-in-st_lsm6dsx_read_fifo.patch iio-imu-st_lsm6dsx-fix-possible-lockup-in-st_lsm6dsx_read_tagged_fifo.patch usb-uhci-platform-make-the-clock-really-optional.patch --- ...dc-ad7606-fix-serial-register-access.patch | 38 ++++++++++++++++++ ...rect-inclinometer-channel-resolution.patch | 40 +++++++++++++++++++ ...sible-lockup-in-st_lsm6dsx_read_fifo.patch | 35 ++++++++++++++++ ...ockup-in-st_lsm6dsx_read_tagged_fifo.patch | 35 ++++++++++++++++ queue-5.4/series | 5 +++ ...tform-make-the-clock-really-optional.patch | 39 ++++++++++++++++++ 6 files changed, 192 insertions(+) create mode 100644 queue-5.4/iio-adc-ad7606-fix-serial-register-access.patch create mode 100644 queue-5.4/iio-adis16201-correct-inclinometer-channel-resolution.patch create mode 100644 queue-5.4/iio-imu-st_lsm6dsx-fix-possible-lockup-in-st_lsm6dsx_read_fifo.patch create mode 100644 queue-5.4/iio-imu-st_lsm6dsx-fix-possible-lockup-in-st_lsm6dsx_read_tagged_fifo.patch create mode 100644 queue-5.4/usb-uhci-platform-make-the-clock-really-optional.patch diff --git a/queue-5.4/iio-adc-ad7606-fix-serial-register-access.patch b/queue-5.4/iio-adc-ad7606-fix-serial-register-access.patch new file mode 100644 index 0000000000..79776c10bf --- /dev/null +++ b/queue-5.4/iio-adc-ad7606-fix-serial-register-access.patch @@ -0,0 +1,38 @@ +From f083f8a21cc785ebe3a33f756a3fa3660611f8db Mon Sep 17 00:00:00 2001 +From: Angelo Dureghello +Date: Fri, 18 Apr 2025 20:37:53 +0200 +Subject: iio: adc: ad7606: fix serial register access + +From: Angelo Dureghello + +commit f083f8a21cc785ebe3a33f756a3fa3660611f8db upstream. + +Fix register read/write routine as per datasheet. + +When reading multiple consecutive registers, only the first one is read +properly. This is due to missing chip select deassert and assert again +between first and second 16bit transfer, as shown in the datasheet +AD7606C-16, rev 0, figure 110. + +Fixes: f2a22e1e172f ("iio: adc: ad7606: Add support for software mode for ad7616") +Reviewed-by: David Lechner +Signed-off-by: Angelo Dureghello +Link: https://patch.msgid.link/20250418-wip-bl-ad7606-fix-reg-access-v3-1-d5eeb440c738@baylibre.com +Cc: +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iio/adc/ad7606_spi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/iio/adc/ad7606_spi.c ++++ b/drivers/iio/adc/ad7606_spi.c +@@ -127,7 +127,7 @@ static int ad7606_spi_reg_read(struct ad + { + .tx_buf = &st->d16[0], + .len = 2, +- .cs_change = 0, ++ .cs_change = 1, + }, { + .rx_buf = &st->d16[1], + .len = 2, diff --git a/queue-5.4/iio-adis16201-correct-inclinometer-channel-resolution.patch b/queue-5.4/iio-adis16201-correct-inclinometer-channel-resolution.patch new file mode 100644 index 0000000000..c0cb5d25f4 --- /dev/null +++ b/queue-5.4/iio-adis16201-correct-inclinometer-channel-resolution.patch @@ -0,0 +1,40 @@ +From 609bc31eca06c7408e6860d8b46311ebe45c1fef Mon Sep 17 00:00:00 2001 +From: Gabriel Shahrouzi +Date: Mon, 21 Apr 2025 09:15:39 -0400 +Subject: iio: adis16201: Correct inclinometer channel resolution + +From: Gabriel Shahrouzi + +commit 609bc31eca06c7408e6860d8b46311ebe45c1fef upstream. + +The inclinometer channels were previously defined with 14 realbits. +However, the ADIS16201 datasheet states the resolution for these output +channels is 12 bits (Page 14, text description; Page 15, table 7). + +Correct the realbits value to 12 to accurately reflect the hardware. + +Fixes: f7fe1d1dd5a5 ("staging: iio: new adis16201 driver") +Cc: stable@vger.kernel.org +Signed-off-by: Gabriel Shahrouzi +Reviewed-by: Marcelo Schmitt +Link: https://patch.msgid.link/20250421131539.912966-1-gshahrouzi@gmail.com +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iio/accel/adis16201.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/iio/accel/adis16201.c ++++ b/drivers/iio/accel/adis16201.c +@@ -214,9 +214,9 @@ static const struct iio_chan_spec adis16 + BIT(IIO_CHAN_INFO_CALIBBIAS), 0, 14), + ADIS_AUX_ADC_CHAN(ADIS16201_AUX_ADC_REG, ADIS16201_SCAN_AUX_ADC, 0, 12), + ADIS_INCLI_CHAN(X, ADIS16201_XINCL_OUT_REG, ADIS16201_SCAN_INCLI_X, +- BIT(IIO_CHAN_INFO_CALIBBIAS), 0, 14), ++ BIT(IIO_CHAN_INFO_CALIBBIAS), 0, 12), + ADIS_INCLI_CHAN(Y, ADIS16201_YINCL_OUT_REG, ADIS16201_SCAN_INCLI_Y, +- BIT(IIO_CHAN_INFO_CALIBBIAS), 0, 14), ++ BIT(IIO_CHAN_INFO_CALIBBIAS), 0, 12), + IIO_CHAN_SOFT_TIMESTAMP(7) + }; + diff --git a/queue-5.4/iio-imu-st_lsm6dsx-fix-possible-lockup-in-st_lsm6dsx_read_fifo.patch b/queue-5.4/iio-imu-st_lsm6dsx-fix-possible-lockup-in-st_lsm6dsx_read_fifo.patch new file mode 100644 index 0000000000..d23984ccf6 --- /dev/null +++ b/queue-5.4/iio-imu-st_lsm6dsx-fix-possible-lockup-in-st_lsm6dsx_read_fifo.patch @@ -0,0 +1,35 @@ +From 159ca7f18129834b6f4c7eae67de48e96c752fc9 Mon Sep 17 00:00:00 2001 +From: Silvano Seva +Date: Tue, 11 Mar 2025 09:49:47 +0100 +Subject: iio: imu: st_lsm6dsx: fix possible lockup in st_lsm6dsx_read_fifo + +From: Silvano Seva + +commit 159ca7f18129834b6f4c7eae67de48e96c752fc9 upstream. + +Prevent st_lsm6dsx_read_fifo from falling in an infinite loop in case +pattern_len is equal to zero and the device FIFO is not empty. + +Fixes: 290a6ce11d93 ("iio: imu: add support to lsm6dsx driver") +Signed-off-by: Silvano Seva +Acked-by: Lorenzo Bianconi +Link: https://patch.msgid.link/20250311085030.3593-2-s.seva@4sigma.it +Cc: +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c ++++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c +@@ -360,6 +360,9 @@ int st_lsm6dsx_read_fifo(struct st_lsm6d + if (fifo_status & cpu_to_le16(ST_LSM6DSX_FIFO_EMPTY_MASK)) + return 0; + ++ if (!pattern_len) ++ pattern_len = ST_LSM6DSX_SAMPLE_SIZE; ++ + fifo_len = (le16_to_cpu(fifo_status) & fifo_diff_mask) * + ST_LSM6DSX_CHAN_SIZE; + fifo_len = (fifo_len / pattern_len) * pattern_len; diff --git a/queue-5.4/iio-imu-st_lsm6dsx-fix-possible-lockup-in-st_lsm6dsx_read_tagged_fifo.patch b/queue-5.4/iio-imu-st_lsm6dsx-fix-possible-lockup-in-st_lsm6dsx_read_tagged_fifo.patch new file mode 100644 index 0000000000..8c806d7511 --- /dev/null +++ b/queue-5.4/iio-imu-st_lsm6dsx-fix-possible-lockup-in-st_lsm6dsx_read_tagged_fifo.patch @@ -0,0 +1,35 @@ +From 8114ef86e2058e2554111b793596f17bee23fa15 Mon Sep 17 00:00:00 2001 +From: Silvano Seva +Date: Tue, 11 Mar 2025 09:49:49 +0100 +Subject: iio: imu: st_lsm6dsx: fix possible lockup in st_lsm6dsx_read_tagged_fifo + +From: Silvano Seva + +commit 8114ef86e2058e2554111b793596f17bee23fa15 upstream. + +Prevent st_lsm6dsx_read_tagged_fifo from falling in an infinite loop in +case pattern_len is equal to zero and the device FIFO is not empty. + +Fixes: 801a6e0af0c6 ("iio: imu: st_lsm6dsx: add support to LSM6DSO") +Signed-off-by: Silvano Seva +Acked-by: Lorenzo Bianconi +Link: https://patch.msgid.link/20250311085030.3593-4-s.seva@4sigma.it +Cc: +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c ++++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c +@@ -541,6 +541,9 @@ int st_lsm6dsx_read_tagged_fifo(struct s + if (!fifo_len) + return 0; + ++ if (!pattern_len) ++ pattern_len = ST_LSM6DSX_TAGGED_SAMPLE_SIZE; ++ + for (read_len = 0; read_len < fifo_len; read_len += pattern_len) { + err = st_lsm6dsx_read_block(hw, + ST_LSM6DSX_REG_FIFO_OUT_TAG_ADDR, diff --git a/queue-5.4/series b/queue-5.4/series index 53825863e2..1b6b24eca2 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -38,3 +38,8 @@ input-synaptics-enable-intertouch-on-dynabook-portege-x30-d.patch input-synaptics-enable-intertouch-on-dynabook-portege-x30l-g.patch input-synaptics-enable-intertouch-on-dell-precision-m3800.patch staging-iio-adc-ad7816-correct-conditional-logic-for-store-mode.patch +iio-adc-ad7606-fix-serial-register-access.patch +iio-adis16201-correct-inclinometer-channel-resolution.patch +iio-imu-st_lsm6dsx-fix-possible-lockup-in-st_lsm6dsx_read_fifo.patch +iio-imu-st_lsm6dsx-fix-possible-lockup-in-st_lsm6dsx_read_tagged_fifo.patch +usb-uhci-platform-make-the-clock-really-optional.patch diff --git a/queue-5.4/usb-uhci-platform-make-the-clock-really-optional.patch b/queue-5.4/usb-uhci-platform-make-the-clock-really-optional.patch new file mode 100644 index 0000000000..0a24fd7e11 --- /dev/null +++ b/queue-5.4/usb-uhci-platform-make-the-clock-really-optional.patch @@ -0,0 +1,39 @@ +From a5c7973539b010874a37a0e846e62ac6f00553ba Mon Sep 17 00:00:00 2001 +From: Alexey Charkov +Date: Fri, 25 Apr 2025 18:11:11 +0400 +Subject: usb: uhci-platform: Make the clock really optional + +From: Alexey Charkov + +commit a5c7973539b010874a37a0e846e62ac6f00553ba upstream. + +Device tree bindings state that the clock is optional for UHCI platform +controllers, and some existing device trees don't provide those - such +as those for VIA/WonderMedia devices. + +The driver however fails to probe now if no clock is provided, because +devm_clk_get returns an error pointer in such case. + +Switch to devm_clk_get_optional instead, so that it could probe again +on those platforms where no clocks are given. + +Cc: stable +Fixes: 26c502701c52 ("usb: uhci: Add clk support to uhci-platform") +Signed-off-by: Alexey Charkov +Link: https://lore.kernel.org/r/20250425-uhci-clock-optional-v1-1-a1d462592f29@gmail.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/host/uhci-platform.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/host/uhci-platform.c ++++ b/drivers/usb/host/uhci-platform.c +@@ -122,7 +122,7 @@ static int uhci_hcd_platform_probe(struc + } + + /* Get and enable clock if any specified */ +- uhci->clk = devm_clk_get(&pdev->dev, NULL); ++ uhci->clk = devm_clk_get_optional(&pdev->dev, NULL); + if (IS_ERR(uhci->clk)) { + ret = PTR_ERR(uhci->clk); + goto err_rmr; -- 2.47.3