Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Guangshuo Li <lgs201920130244@gmail.com>
To: broonie@kernel.org, heiko@sntech.de, william.zhang@broadcom.com,
	kursad.oney@broadcom.com, jonas.gorski@gmail.com
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
	linusw@kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, jon.lin@rock-chips.com,
	bcm-kernel-feedback-list@broadcom.com, noltari@gmail.com,
	lgs201920130244@gmail.com
Subject: [PATCH 2/3] spi: rockchip-sfc: Clean up runtime PM on remove
Date: Thu, 24 Sep 2026 19:23:28 +0800	[thread overview]
Message-ID: <20260924112329.1566051-3-lgs201920130244@gmail.com> (raw)
In-Reply-To: <20260924112329.1566051-1-lgs201920130244@gmail.com>

rockchip_sfc_probe() enables runtime PM and autosuspend before registering
the controller. After a successful probe, rockchip_sfc_remove() tears down
the controller and clocks without undoing that runtime PM setup.

The probe error path resumes the device, drops the temporary usage count,
disables runtime PM, marks the device suspended, and stops using
autosuspend before disabling the clocks. The remove path lacks this
matching cleanup.

Mirror the existing error-path sequence in rockchip_sfc_remove() before
disabling the clocks.

Fixes: 8011709906d0 ("spi: rockchip-sfc: Support pm ops")
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
---
 drivers/spi/spi-rockchip-sfc.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/spi/spi-rockchip-sfc.c b/drivers/spi/spi-rockchip-sfc.c
index 662a994da60b..6e1c7d6318bb 100644
--- a/drivers/spi/spi-rockchip-sfc.c
+++ b/drivers/spi/spi-rockchip-sfc.c
@@ -747,6 +747,12 @@ static void rockchip_sfc_remove(struct platform_device *pdev)
 			 DMA_BIDIRECTIONAL);
 	free_pages((unsigned long)sfc->buffer, get_order(sfc->max_iosize));
 
+	pm_runtime_get_sync(&pdev->dev);
+	pm_runtime_put_noidle(&pdev->dev);
+	pm_runtime_disable(&pdev->dev);
+	pm_runtime_set_suspended(&pdev->dev);
+	pm_runtime_dont_use_autosuspend(&pdev->dev);
+
 	clk_disable_unprepare(sfc->clk);
 	clk_disable_unprepare(sfc->hclk);
 }
-- 
2.43.0



  parent reply	other threads:[~2026-09-24 11:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24 11:23 [PATCH 0/3] spi: balance remove-path teardown in three drivers Guangshuo Li
2026-09-24 11:23 ` [PATCH 1/3] spi: fsl: unmap immr_spi_cs on remove Guangshuo Li
2026-09-24 11:23 ` Guangshuo Li [this message]
2026-09-29  2:21   ` [PATCH 2/3] spi: rockchip-sfc: Clean up runtime PM " Shawn Lin
2026-09-24 11:23 ` [PATCH 3/3] spi: bcm63xx-hsspi: Disable " Guangshuo Li
2026-10-04 19:46 ` (subset) [PATCH 0/3] spi: balance remove-path teardown in three drivers Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260924112329.1566051-3-lgs201920130244@gmail.com \
    --to=lgs201920130244@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=broonie@kernel.org \
    --cc=heiko@sntech.de \
    --cc=jon.lin@rock-chips.com \
    --cc=jonas.gorski@gmail.com \
    --cc=kursad.oney@broadcom.com \
    --cc=linusw@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=noltari@gmail.com \
    --cc=william.zhang@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox