* [PATCH 0/3] spi: axiado: spi: axiado: fix runtime pm imbalance on probe failure
@ 2026-04-21 14:39 Johan Hovold
2026-04-21 14:39 ` [PATCH 1/3] " Johan Hovold
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Johan Hovold @ 2026-04-21 14:39 UTC (permalink / raw)
To: Mark Brown
Cc: Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang, Prasad Bolisetty,
Harshit Shah, linux-spi, linux-kernel, Johan Hovold
The series fixes some runtime PM related issues in the axiado driver.
Included is also a couple of related cleanups.
Johan
Johan Hovold (3):
spi: axiado: fix runtime pm imbalance on probe failure
spi: axiado: rename probe error labels
spi: axiado: clean up probe return value
drivers/spi/spi-axiado.c | 31 +++++++++++++++++++------------
1 file changed, 19 insertions(+), 12 deletions(-)
--
2.52.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] spi: axiado: fix runtime pm imbalance on probe failure
2026-04-21 14:39 [PATCH 0/3] spi: axiado: spi: axiado: fix runtime pm imbalance on probe failure Johan Hovold
@ 2026-04-21 14:39 ` Johan Hovold
2026-04-21 14:39 ` [PATCH 2/3] spi: axiado: rename probe error labels Johan Hovold
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Johan Hovold @ 2026-04-21 14:39 UTC (permalink / raw)
To: Mark Brown
Cc: Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang, Prasad Bolisetty,
Harshit Shah, linux-spi, linux-kernel, Johan Hovold, stable
Make sure that the controller is active before disabling clocks on late
probe failure and on driver unbind to avoid a clock disable imbalance.
Also make sure that the usage count is balanced on probe failure (e.g.
probe deferral) so that the controller can be suspended when a driver is
later bound.
Note that the runtime PM state can only be set when runtime PM is
disabled.
Fixes: e75a6b00ad79 ("spi: axiado: Add driver for Axiado SPI DB controller")
Cc: stable@vger.kernel.org # 7.0
Cc: Vladimir Moravcevic <vmoravcevic@axiado.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/spi/spi-axiado.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-axiado.c b/drivers/spi/spi-axiado.c
index dc55c55ae63c..6449b376a3a8 100644
--- a/drivers/spi/spi-axiado.c
+++ b/drivers/spi/spi-axiado.c
@@ -842,8 +842,6 @@ static int ax_spi_probe(struct platform_device *pdev)
ctlr->bits_per_word_mask = SPI_BPW_MASK(8);
- pm_runtime_put_autosuspend(&pdev->dev);
-
ctlr->mem_ops = &ax_spi_mem_ops;
ret = spi_register_controller(ctlr);
@@ -852,11 +850,16 @@ static int ax_spi_probe(struct platform_device *pdev)
goto clk_dis_all;
}
+ pm_runtime_put_autosuspend(&pdev->dev);
+
return ret;
clk_dis_all:
- pm_runtime_set_suspended(&pdev->dev);
pm_runtime_disable(&pdev->dev);
+ pm_runtime_put_noidle(&pdev->dev);
+ pm_runtime_set_suspended(&pdev->dev);
+ pm_runtime_dont_use_autosuspend(&pdev->dev);
+
clk_disable_unprepare(xspi->ref_clk);
clk_dis_apb:
clk_disable_unprepare(xspi->pclk);
@@ -877,10 +880,14 @@ static void ax_spi_remove(struct platform_device *pdev)
struct spi_controller *ctlr = platform_get_drvdata(pdev);
struct ax_spi *xspi = spi_controller_get_devdata(ctlr);
+ pm_runtime_get_sync(&pdev->dev);
+
spi_unregister_controller(ctlr);
- pm_runtime_set_suspended(&pdev->dev);
pm_runtime_disable(&pdev->dev);
+ pm_runtime_put_noidle(&pdev->dev);
+ pm_runtime_set_suspended(&pdev->dev);
+ pm_runtime_dont_use_autosuspend(&pdev->dev);
clk_disable_unprepare(xspi->ref_clk);
clk_disable_unprepare(xspi->pclk);
--
2.52.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] spi: axiado: rename probe error labels
2026-04-21 14:39 [PATCH 0/3] spi: axiado: spi: axiado: fix runtime pm imbalance on probe failure Johan Hovold
2026-04-21 14:39 ` [PATCH 1/3] " Johan Hovold
@ 2026-04-21 14:39 ` Johan Hovold
2026-04-21 14:39 ` [PATCH 3/3] spi: axiado: clean up probe return value Johan Hovold
2026-04-22 14:06 ` [PATCH 0/3] spi: axiado: spi: axiado: fix runtime pm imbalance on probe failure Mark Brown
3 siblings, 0 replies; 5+ messages in thread
From: Johan Hovold @ 2026-04-21 14:39 UTC (permalink / raw)
To: Mark Brown
Cc: Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang, Prasad Bolisetty,
Harshit Shah, linux-spi, linux-kernel, Johan Hovold
Rename the probe error labels after what they do.
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/spi/spi-axiado.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/spi/spi-axiado.c b/drivers/spi/spi-axiado.c
index 6449b376a3a8..a347774ae824 100644
--- a/drivers/spi/spi-axiado.c
+++ b/drivers/spi/spi-axiado.c
@@ -785,7 +785,7 @@ static int ax_spi_probe(struct platform_device *pdev)
ret = clk_prepare_enable(xspi->ref_clk);
if (ret) {
dev_err(&pdev->dev, "Unable to enable device clock.\n");
- goto clk_dis_apb;
+ goto err_disable_apb;
}
pm_runtime_use_autosuspend(&pdev->dev);
@@ -815,7 +815,7 @@ static int ax_spi_probe(struct platform_device *pdev)
irq = platform_get_irq(pdev, 0);
if (irq <= 0) {
ret = -ENXIO;
- goto clk_dis_all;
+ goto err_disable_rpm;
}
ret = devm_request_irq(&pdev->dev, irq, ax_spi_irq,
@@ -823,7 +823,7 @@ static int ax_spi_probe(struct platform_device *pdev)
if (ret != 0) {
ret = -ENXIO;
dev_err(&pdev->dev, "request_irq failed\n");
- goto clk_dis_all;
+ goto err_disable_rpm;
}
ctlr->use_gpio_descriptors = true;
@@ -847,21 +847,21 @@ static int ax_spi_probe(struct platform_device *pdev)
ret = spi_register_controller(ctlr);
if (ret) {
dev_err(&pdev->dev, "spi_register_controller failed\n");
- goto clk_dis_all;
+ goto err_disable_rpm;
}
pm_runtime_put_autosuspend(&pdev->dev);
return ret;
-clk_dis_all:
+err_disable_rpm:
pm_runtime_disable(&pdev->dev);
pm_runtime_put_noidle(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev);
pm_runtime_dont_use_autosuspend(&pdev->dev);
clk_disable_unprepare(xspi->ref_clk);
-clk_dis_apb:
+err_disable_apb:
clk_disable_unprepare(xspi->pclk);
return ret;
--
2.52.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] spi: axiado: clean up probe return value
2026-04-21 14:39 [PATCH 0/3] spi: axiado: spi: axiado: fix runtime pm imbalance on probe failure Johan Hovold
2026-04-21 14:39 ` [PATCH 1/3] " Johan Hovold
2026-04-21 14:39 ` [PATCH 2/3] spi: axiado: rename probe error labels Johan Hovold
@ 2026-04-21 14:39 ` Johan Hovold
2026-04-22 14:06 ` [PATCH 0/3] spi: axiado: spi: axiado: fix runtime pm imbalance on probe failure Mark Brown
3 siblings, 0 replies; 5+ messages in thread
From: Johan Hovold @ 2026-04-21 14:39 UTC (permalink / raw)
To: Mark Brown
Cc: Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang, Prasad Bolisetty,
Harshit Shah, linux-spi, linux-kernel, Johan Hovold
Drop the redundant initialisation and return explicit zero on successful
probe to make the code more readable.
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/spi/spi-axiado.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi-axiado.c b/drivers/spi/spi-axiado.c
index a347774ae824..9057a0a8df4a 100644
--- a/drivers/spi/spi-axiado.c
+++ b/drivers/spi/spi-axiado.c
@@ -751,9 +751,9 @@ static const struct spi_controller_mem_ops ax_spi_mem_ops = {
*/
static int ax_spi_probe(struct platform_device *pdev)
{
- int ret = 0, irq;
struct spi_controller *ctlr;
struct ax_spi *xspi;
+ int ret, irq;
u32 num_cs;
ctlr = devm_spi_alloc_host(&pdev->dev, sizeof(*xspi));
@@ -852,7 +852,7 @@ static int ax_spi_probe(struct platform_device *pdev)
pm_runtime_put_autosuspend(&pdev->dev);
- return ret;
+ return 0;
err_disable_rpm:
pm_runtime_disable(&pdev->dev);
--
2.52.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 0/3] spi: axiado: spi: axiado: fix runtime pm imbalance on probe failure
2026-04-21 14:39 [PATCH 0/3] spi: axiado: spi: axiado: fix runtime pm imbalance on probe failure Johan Hovold
` (2 preceding siblings ...)
2026-04-21 14:39 ` [PATCH 3/3] spi: axiado: clean up probe return value Johan Hovold
@ 2026-04-22 14:06 ` Mark Brown
3 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2026-04-22 14:06 UTC (permalink / raw)
To: Johan Hovold
Cc: Vladimir Moravcevic, Tzu-Hao Wei, Swark Yang, Prasad Bolisetty,
Harshit Shah, linux-spi, linux-kernel
On Tue, 21 Apr 2026 16:39:22 +0200, Johan Hovold wrote:
> spi: axiado: spi: axiado: fix runtime pm imbalance on probe failure
>
> The series fixes some runtime PM related issues in the axiado driver.
>
> Included is also a couple of related cleanups.
>
> Johan
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-7.1
Thanks!
[1/3] spi: axiado: fix runtime pm imbalance on probe failure
https://git.kernel.org/broonie/spi/c/cde1a784e4d5
[2/3] spi: axiado: rename probe error labels
https://git.kernel.org/broonie/spi/c/821f0951b208
[3/3] spi: axiado: clean up probe return value
https://git.kernel.org/broonie/spi/c/2b20e6742442
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-04-22 19:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-21 14:39 [PATCH 0/3] spi: axiado: spi: axiado: fix runtime pm imbalance on probe failure Johan Hovold
2026-04-21 14:39 ` [PATCH 1/3] " Johan Hovold
2026-04-21 14:39 ` [PATCH 2/3] spi: axiado: rename probe error labels Johan Hovold
2026-04-21 14:39 ` [PATCH 3/3] spi: axiado: clean up probe return value Johan Hovold
2026-04-22 14:06 ` [PATCH 0/3] spi: axiado: spi: axiado: fix runtime pm imbalance on probe failure Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox