From: Greg Kroah-Hartman Date: Tue, 10 Sep 2024 08:38:28 +0000 (+0200) Subject: 6.6-stable patches X-Git-Tag: v4.19.322~17 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f772e764f8db2a08a9f1f885740427a50edb6426;p=thirdparty%2Fkernel%2Fstable-queue.git 6.6-stable patches added patches: spi-spi-fsl-lpspi-fix-off-by-one-in-prescale-max.patch --- diff --git a/queue-6.6/series b/queue-6.6/series index 2716e1f4741..41aa8a8c10f 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -263,3 +263,4 @@ ublk_drv-fix-null-pointer-dereference-in-ublk_ctrl_s.patch membarrier-riscv-add-full-memory-barrier-in-switch_mm.patch x86-mm-fix-pti-for-i386-some-more.patch btrfs-fix-race-between-direct-io-write-and-fsync-when-using-same-fd.patch +spi-spi-fsl-lpspi-fix-off-by-one-in-prescale-max.patch diff --git a/queue-6.6/spi-spi-fsl-lpspi-fix-off-by-one-in-prescale-max.patch b/queue-6.6/spi-spi-fsl-lpspi-fix-off-by-one-in-prescale-max.patch new file mode 100644 index 00000000000..02c91c357bc --- /dev/null +++ b/queue-6.6/spi-spi-fsl-lpspi-fix-off-by-one-in-prescale-max.patch @@ -0,0 +1,44 @@ +From ff949d981c775332be94be70397ee1df20bc68e5 Mon Sep 17 00:00:00 2001 +From: Stefan Wahren +Date: Thu, 5 Sep 2024 13:15:37 +0200 +Subject: spi: spi-fsl-lpspi: Fix off-by-one in prescale max + +From: Stefan Wahren + +commit ff949d981c775332be94be70397ee1df20bc68e5 upstream. + +The commit 783bf5d09f86 ("spi: spi-fsl-lpspi: limit PRESCALE bit in +TCR register") doesn't implement the prescaler maximum as intended. +The maximum allowed value for i.MX93 should be 1 and for i.MX7ULP +it should be 7. So this needs also a adjustment of the comparison +in the scldiv calculation. + +Fixes: 783bf5d09f86 ("spi: spi-fsl-lpspi: limit PRESCALE bit in TCR register") +Signed-off-by: Stefan Wahren +Link: https://patch.msgid.link/20240905111537.90389-1-wahrenst@gmx.net +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + drivers/spi/spi-fsl-lpspi.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/spi/spi-fsl-lpspi.c ++++ b/drivers/spi/spi-fsl-lpspi.c +@@ -136,7 +136,7 @@ static struct fsl_lpspi_devtype_data imx + }; + + static struct fsl_lpspi_devtype_data imx7ulp_lpspi_devtype_data = { +- .prescale_max = 8, ++ .prescale_max = 7, + }; + + static const struct of_device_id fsl_lpspi_dt_ids[] = { +@@ -336,7 +336,7 @@ static int fsl_lpspi_set_bitrate(struct + + div = DIV_ROUND_UP(perclk_rate, config.speed_hz); + +- for (prescale = 0; prescale < prescale_max; prescale++) { ++ for (prescale = 0; prescale <= prescale_max; prescale++) { + scldiv = div / (1 << prescale) - 2; + if (scldiv < 256) { + fsl_lpspi->config.prescale = prescale;