From: Greg Kroah-Hartman Date: Mon, 7 Oct 2024 09:32:51 +0000 (+0200) Subject: 5.4-stable patches X-Git-Tag: v6.6.55~119 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=322f50645af53036f59c915c59b1e2dd79b4b4e8;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: firmware-tegra-bpmp-drop-unused-mbox_client_to_bpmp.patch i2c-stm32f7-do-not-prepare-unprepare-clock-during-runtime-suspend-resume.patch i2c-xiic-wait-for-tx-empty-to-avoid-missed-tx-naks.patch spi-bcm63xx-fix-module-autoloading.patch --- diff --git a/queue-5.4/firmware-tegra-bpmp-drop-unused-mbox_client_to_bpmp.patch b/queue-5.4/firmware-tegra-bpmp-drop-unused-mbox_client_to_bpmp.patch new file mode 100644 index 00000000000..459065e69c1 --- /dev/null +++ b/queue-5.4/firmware-tegra-bpmp-drop-unused-mbox_client_to_bpmp.patch @@ -0,0 +1,37 @@ +From 9c3a62c20f7fb00294a4237e287254456ba8a48b Mon Sep 17 00:00:00 2001 +From: Krzysztof Kozlowski +Date: Fri, 16 Aug 2024 15:57:21 +0200 +Subject: firmware: tegra: bpmp: Drop unused mbox_client_to_bpmp() + +From: Krzysztof Kozlowski + +commit 9c3a62c20f7fb00294a4237e287254456ba8a48b upstream. + +mbox_client_to_bpmp() is not used, W=1 builds: + + drivers/firmware/tegra/bpmp.c:28:1: error: unused function 'mbox_client_to_bpmp' [-Werror,-Wunused-function] + +Fixes: cdfa358b248e ("firmware: tegra: Refactor BPMP driver") +Cc: stable@vger.kernel.org +Signed-off-by: Krzysztof Kozlowski +Signed-off-by: Thierry Reding +Signed-off-by: Greg Kroah-Hartman +--- + drivers/firmware/tegra/bpmp.c | 6 ------ + 1 file changed, 6 deletions(-) + +--- a/drivers/firmware/tegra/bpmp.c ++++ b/drivers/firmware/tegra/bpmp.c +@@ -24,12 +24,6 @@ + #define MSG_RING BIT(1) + #define TAG_SZ 32 + +-static inline struct tegra_bpmp * +-mbox_client_to_bpmp(struct mbox_client *client) +-{ +- return container_of(client, struct tegra_bpmp, mbox.client); +-} +- + static inline const struct tegra_bpmp_ops * + channel_to_ops(struct tegra_bpmp_channel *channel) + { diff --git a/queue-5.4/i2c-stm32f7-do-not-prepare-unprepare-clock-during-runtime-suspend-resume.patch b/queue-5.4/i2c-stm32f7-do-not-prepare-unprepare-clock-during-runtime-suspend-resume.patch new file mode 100644 index 00000000000..480bdebf1fd --- /dev/null +++ b/queue-5.4/i2c-stm32f7-do-not-prepare-unprepare-clock-during-runtime-suspend-resume.patch @@ -0,0 +1,58 @@ +From 048bbbdbf85e5e00258dfb12f5e368f908801d7b Mon Sep 17 00:00:00 2001 +From: Marek Vasut +Date: Mon, 30 Sep 2024 21:27:41 +0200 +Subject: i2c: stm32f7: Do not prepare/unprepare clock during runtime suspend/resume + +From: Marek Vasut + +commit 048bbbdbf85e5e00258dfb12f5e368f908801d7b upstream. + +In case there is any sort of clock controller attached to this I2C bus +controller, for example Versaclock or even an AIC32x4 I2C codec, then +an I2C transfer triggered from the clock controller clk_ops .prepare +callback may trigger a deadlock on drivers/clk/clk.c prepare_lock mutex. + +This is because the clock controller first grabs the prepare_lock mutex +and then performs the prepare operation, including its I2C access. The +I2C access resumes this I2C bus controller via .runtime_resume callback, +which calls clk_prepare_enable(), which attempts to grab the prepare_lock +mutex again and deadlocks. + +Since the clock are already prepared since probe() and unprepared in +remove(), use simple clk_enable()/clk_disable() calls to enable and +disable the clock on runtime suspend and resume, to avoid hitting the +prepare_lock mutex. + +Acked-by: Alain Volmat +Signed-off-by: Marek Vasut +Fixes: 4e7bca6fc07b ("i2c: i2c-stm32f7: add PM Runtime support") +Cc: # v5.0+ +Signed-off-by: Andi Shyti +Signed-off-by: Greg Kroah-Hartman +--- + drivers/i2c/busses/i2c-stm32f7.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/i2c/busses/i2c-stm32f7.c ++++ b/drivers/i2c/busses/i2c-stm32f7.c +@@ -2070,7 +2070,7 @@ static int stm32f7_i2c_runtime_suspend(s + struct stm32f7_i2c_dev *i2c_dev = dev_get_drvdata(dev); + + if (!stm32f7_i2c_is_slave_registered(i2c_dev)) +- clk_disable_unprepare(i2c_dev->clk); ++ clk_disable(i2c_dev->clk); + + return 0; + } +@@ -2081,9 +2081,9 @@ static int stm32f7_i2c_runtime_resume(st + int ret; + + if (!stm32f7_i2c_is_slave_registered(i2c_dev)) { +- ret = clk_prepare_enable(i2c_dev->clk); ++ ret = clk_enable(i2c_dev->clk); + if (ret) { +- dev_err(dev, "failed to prepare_enable clock\n"); ++ dev_err(dev, "failed to enable clock\n"); + return ret; + } + } diff --git a/queue-5.4/i2c-xiic-wait-for-tx-empty-to-avoid-missed-tx-naks.patch b/queue-5.4/i2c-xiic-wait-for-tx-empty-to-avoid-missed-tx-naks.patch new file mode 100644 index 00000000000..b2306b45a1d --- /dev/null +++ b/queue-5.4/i2c-xiic-wait-for-tx-empty-to-avoid-missed-tx-naks.patch @@ -0,0 +1,75 @@ +From 521da1e9225450bd323db5fa5bca942b1dc485b7 Mon Sep 17 00:00:00 2001 +From: Robert Hancock +Date: Tue, 21 Nov 2023 18:11:16 +0000 +Subject: i2c: xiic: Wait for TX empty to avoid missed TX NAKs + +From: Robert Hancock + +commit 521da1e9225450bd323db5fa5bca942b1dc485b7 upstream. + +Frequently an I2C write will be followed by a read, such as a register +address write followed by a read of the register value. In this driver, +when the TX FIFO half empty interrupt was raised and it was determined +that there was enough space in the TX FIFO to send the following read +command, it would do so without waiting for the TX FIFO to actually +empty. + +Unfortunately it appears that in some cases this can result in a NAK +that was raised by the target device on the write, such as due to an +unsupported register address, being ignored and the subsequent read +being done anyway. This can potentially put the I2C bus into an +invalid state and/or result in invalid read data being processed. + +To avoid this, once a message has been fully written to the TX FIFO, +wait for the TX FIFO empty interrupt before moving on to the next +message, to ensure NAKs are handled properly. + +Fixes: e1d5b6598cdc ("i2c: Add support for Xilinx XPS IIC Bus Interface") +Signed-off-by: Robert Hancock +Cc: # v2.6.34+ +Reviewed-by: Manikanta Guntupalli +Acked-by: Michal Simek +Signed-off-by: Andi Shyti +Signed-off-by: Greg Kroah-Hartman +--- + drivers/i2c/busses/i2c-xiic.c | 19 +++++++++---------- + 1 file changed, 9 insertions(+), 10 deletions(-) + +--- a/drivers/i2c/busses/i2c-xiic.c ++++ b/drivers/i2c/busses/i2c-xiic.c +@@ -469,14 +469,17 @@ static irqreturn_t xiic_process(int irq, + goto out; + } + +- xiic_fill_tx_fifo(i2c); +- +- /* current message sent and there is space in the fifo */ +- if (!xiic_tx_space(i2c) && xiic_tx_fifo_space(i2c) >= 2) { ++ if (xiic_tx_space(i2c)) { ++ xiic_fill_tx_fifo(i2c); ++ } else { ++ /* current message fully written */ + dev_dbg(i2c->adap.dev.parent, + "%s end of message sent, nmsgs: %d\n", + __func__, i2c->nmsgs); +- if (i2c->nmsgs > 1) { ++ /* Don't move onto the next message until the TX FIFO empties, ++ * to ensure that a NAK is not missed. ++ */ ++ if (i2c->nmsgs > 1 && (pend & XIIC_INTR_TX_EMPTY_MASK)) { + i2c->nmsgs--; + i2c->tx_msg++; + xfer_more = 1; +@@ -487,11 +490,7 @@ static irqreturn_t xiic_process(int irq, + "%s Got TX IRQ but no more to do...\n", + __func__); + } +- } else if (!xiic_tx_space(i2c) && (i2c->nmsgs == 1)) +- /* current frame is sent and is last, +- * make sure to disable tx half +- */ +- xiic_irq_dis(i2c, XIIC_INTR_TX_HALF_MASK); ++ } + } + out: + dev_dbg(i2c->adap.dev.parent, "%s clr: 0x%x\n", __func__, clr); diff --git a/queue-5.4/series b/queue-5.4/series index 945b0d26bcb..a11a9b3b950 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -241,3 +241,7 @@ ext4-fix-i_data_sem-unlock-order-in-ext4_ind_migrate.patch spi-s3c64xx-fix-timeout-counters-in-flush_fifo.patch selftests-breakpoints-use-remaining-time-to-check-if.patch selftests-vdso-fix-vdso-symbols-lookup-for-powerpc64.patch +i2c-stm32f7-do-not-prepare-unprepare-clock-during-runtime-suspend-resume.patch +i2c-xiic-wait-for-tx-empty-to-avoid-missed-tx-naks.patch +firmware-tegra-bpmp-drop-unused-mbox_client_to_bpmp.patch +spi-bcm63xx-fix-module-autoloading.patch diff --git a/queue-5.4/spi-bcm63xx-fix-module-autoloading.patch b/queue-5.4/spi-bcm63xx-fix-module-autoloading.patch new file mode 100644 index 00000000000..2c2932c1b18 --- /dev/null +++ b/queue-5.4/spi-bcm63xx-fix-module-autoloading.patch @@ -0,0 +1,33 @@ +From 909f34f2462a99bf876f64c5c61c653213e32fce Mon Sep 17 00:00:00 2001 +From: Jinjie Ruan +Date: Mon, 19 Aug 2024 20:33:48 +0800 +Subject: spi: bcm63xx: Fix module autoloading + +From: Jinjie Ruan + +commit 909f34f2462a99bf876f64c5c61c653213e32fce upstream. + +Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded +based on the alias from platform_device_id table. + +Fixes: 44d8fb30941d ("spi/bcm63xx: move register definitions into the driver") +Cc: stable@vger.kernel.org +Signed-off-by: Jinjie Ruan +Reviewed-by: Jonas Gorski +Link: https://patch.msgid.link/20240819123349.4020472-2-ruanjinjie@huawei.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + drivers/spi/spi-bcm63xx.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/spi/spi-bcm63xx.c ++++ b/drivers/spi/spi-bcm63xx.c +@@ -475,6 +475,7 @@ static const struct platform_device_id b + { + }, + }; ++MODULE_DEVICE_TABLE(platform, bcm63xx_spi_dev_match); + + static const struct of_device_id bcm63xx_spi_of_match[] = { + { .compatible = "brcm,bcm6348-spi", .data = &bcm6348_spi_reg_offsets },