bmips: add SPI accepted PM patches
authorÁlvaro Fernández Rojas <noltari@gmail.com>
Wed, 24 Feb 2021 17:20:04 +0000 (18:20 +0100)
committerÁlvaro Fernández Rojas <noltari@gmail.com>
Wed, 24 Feb 2021 17:20:04 +0000 (18:20 +0100)
These patches have been accepted upstream.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
target/linux/bmips/patches-5.10/041-v5.12-spi-bcm63xx-spi-fix-pm_runtime.patch [new file with mode: 0644]
target/linux/bmips/patches-5.10/042-v5.12-spi-bcm63xx-hsspi-fix-pm_runtime.patch [new file with mode: 0644]
target/linux/bmips/patches-5.10/205-spi-bcm63xx-spi-disable-auto_runtime_pm.patch [deleted file]
target/linux/bmips/patches-5.10/206-spi-bcm63xx-hsspi-disable-auto_runtime_pm.patch [deleted file]

diff --git a/target/linux/bmips/patches-5.10/041-v5.12-spi-bcm63xx-spi-fix-pm_runtime.patch b/target/linux/bmips/patches-5.10/041-v5.12-spi-bcm63xx-spi-fix-pm_runtime.patch
new file mode 100644 (file)
index 0000000..3fe7a55
--- /dev/null
@@ -0,0 +1,45 @@
+From 73ae625da5c36300fccd809738e7c68f49ebce35 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
+Date: Tue, 23 Feb 2021 16:18:50 +0100
+Subject: [PATCH 1/2] spi: bcm63xx-spi: fix pm_runtime
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The driver sets auto_runtime_pm to true, but it doesn't call
+pm_runtime_enable(), which results in "Failed to power device" when PM support
+is enabled.
+
+Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
+Link: https://lore.kernel.org/r/20210223151851.4110-2-noltari@gmail.com
+Signed-off-by: Mark Brown <broonie@kernel.org>
+---
+ drivers/spi/spi-bcm63xx.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+--- a/drivers/spi/spi-bcm63xx.c
++++ b/drivers/spi/spi-bcm63xx.c
+@@ -593,11 +593,13 @@ static int bcm63xx_spi_probe(struct plat
+       bcm_spi_writeb(bs, SPI_INTR_CLEAR_ALL, SPI_INT_STATUS);
++      pm_runtime_enable(&pdev->dev);
++
+       /* register and we are done */
+       ret = devm_spi_register_master(dev, master);
+       if (ret) {
+               dev_err(dev, "spi register failed\n");
+-              goto out_clk_disable;
++              goto out_pm_disable;
+       }
+       dev_info(dev, "at %pr (irq %d, FIFOs size %d)\n",
+@@ -605,6 +607,8 @@ static int bcm63xx_spi_probe(struct plat
+       return 0;
++out_pm_disable:
++      pm_runtime_disable(&pdev->dev);
+ out_clk_disable:
+       clk_disable_unprepare(clk);
+ out_err:
diff --git a/target/linux/bmips/patches-5.10/042-v5.12-spi-bcm63xx-hsspi-fix-pm_runtime.patch b/target/linux/bmips/patches-5.10/042-v5.12-spi-bcm63xx-hsspi-fix-pm_runtime.patch
new file mode 100644 (file)
index 0000000..47c7565
--- /dev/null
@@ -0,0 +1,48 @@
+From 216e8e80057a9f0b6366327881acf88eaf9f1fd4 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
+Date: Tue, 23 Feb 2021 16:18:51 +0100
+Subject: [PATCH 2/2] spi: bcm63xx-hsspi: fix pm_runtime
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The driver sets auto_runtime_pm to true, but it doesn't call
+pm_runtime_enable(), which results in "Failed to power device" when PM support
+is enabled.
+
+Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
+Link: https://lore.kernel.org/r/20210223151851.4110-3-noltari@gmail.com
+Signed-off-by: Mark Brown <broonie@kernel.org>
+---
+ drivers/spi/spi-bcm63xx-hsspi.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+--- a/drivers/spi/spi-bcm63xx-hsspi.c
++++ b/drivers/spi/spi-bcm63xx-hsspi.c
+@@ -21,6 +21,7 @@
+ #include <linux/mutex.h>
+ #include <linux/of.h>
+ #include <linux/reset.h>
++#include <linux/pm_runtime.h>
+ #define HSSPI_GLOBAL_CTRL_REG                 0x0
+ #define GLOBAL_CTRL_CS_POLARITY_SHIFT         0
+@@ -439,13 +440,17 @@ static int bcm63xx_hsspi_probe(struct pl
+       if (ret)
+               goto out_put_master;
++      pm_runtime_enable(&pdev->dev);
++
+       /* register and we are done */
+       ret = devm_spi_register_master(dev, master);
+       if (ret)
+-              goto out_put_master;
++              goto out_pm_disable;
+       return 0;
++out_pm_disable:
++      pm_runtime_disable(&pdev->dev);
+ out_put_master:
+       spi_master_put(master);
+ out_disable_pll_clk:
diff --git a/target/linux/bmips/patches-5.10/205-spi-bcm63xx-spi-disable-auto_runtime_pm.patch b/target/linux/bmips/patches-5.10/205-spi-bcm63xx-spi-disable-auto_runtime_pm.patch
deleted file mode 100644 (file)
index 43e1ce5..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/drivers/spi/spi-bcm63xx.c
-+++ b/drivers/spi/spi-bcm63xx.c
-@@ -574,7 +574,6 @@ static int bcm63xx_spi_probe(struct plat
-       master->bits_per_word_mask = SPI_BPW_MASK(8);
-       master->max_transfer_size = bcm63xx_spi_max_length;
-       master->max_message_size = bcm63xx_spi_max_length;
--      master->auto_runtime_pm = true;
-       bs->msg_type_shift = bs->reg_offsets[SPI_MSG_TYPE_SHIFT];
-       bs->msg_ctl_width = bs->reg_offsets[SPI_MSG_CTL_WIDTH];
-       bs->tx_io = (u8 *)(bs->regs + bs->reg_offsets[SPI_MSG_DATA]);
diff --git a/target/linux/bmips/patches-5.10/206-spi-bcm63xx-hsspi-disable-auto_runtime_pm.patch b/target/linux/bmips/patches-5.10/206-spi-bcm63xx-hsspi-disable-auto_runtime_pm.patch
deleted file mode 100644 (file)
index a78c864..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/drivers/spi/spi-bcm63xx-hsspi.c
-+++ b/drivers/spi/spi-bcm63xx-hsspi.c
-@@ -417,7 +417,6 @@ static int bcm63xx_hsspi_probe(struct pl
-       master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH |
-                           SPI_RX_DUAL | SPI_TX_DUAL;
-       master->bits_per_word_mask = SPI_BPW_MASK(8);
--      master->auto_runtime_pm = true;
-       platform_set_drvdata(pdev, master);