From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 269594F5DEF; Tue, 13 Oct 2026 12:03:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791892989; cv=none; b=XDVF3m3hAyi6Y5BQJlbwojWc0Bl0EPNmhe8RtIRTbDJAXJz8WC2iG9+25QGnrIq2DcINVAzcdnFEuKXPVdoLJLQ0yQkxZ6Fi3heA672BLJIgpnQy7TXBr1yoJutUUJIRsFBxy7gsohT2Eo/jujYQCYeHujEUKqhl2mSK5442wOk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791892989; c=relaxed/simple; bh=iI73TLHfBjtatT2ArPsXw8pkszQD4Jc7NA4gQzvz07A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UHDotWe78GlEZlVudWvrDx+K2x7i5ONHV5JGbOMrrLShwQvLoNPoW5hqMxjSF9MPX+CWKpRvhTF+mfMMCXc56neI5qe+sKnXyueDjJ4+rwpn/eya4HvAzggdEiFKtUH686B76xLuUQBENFn0ng9BKie7x+wjeC1WufYJcyOMpYQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=A/zpSUqj; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="A/zpSUqj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2A22F1F000FF; Tue, 13 Oct 2026 12:03:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1791892987; bh=tPd0BgoCfzkoBNjeuunTil+b+M72OOFBU8oaerL+Jcc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=A/zpSUqjJvCRLTz/Wfk2mNraT95vdrNCtjtM+vDSSO1c54ZurOd7GlA6G2Lk9Ndod gMWyDMKgduDxDETYGSQvxTYzyN6+PT2EPOv6r8UATzUnWmL61RBF5TzjjZzK7PafYd LS0XmZkwc4h3UHiDuxP7e7QQsHK8LrnvDGXgd3Po= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Guangshuo Li , Baolin Wang , Adrian Hunter , Ulf Hansson Subject: [PATCH 6.18 076/621] mmc: sdhci-sprd: disable runtime PM on remove Date: Tue, 13 Oct 2026 13:31:11 +0200 Message-ID: <20261013112922.660125100@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261013112920.855194808@linuxfoundation.org> References: <20261013112920.855194808@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Guangshuo Li commit e1c6c10a6a70a69e29b04fcc1ebe4b9bcbc7a49a upstream. sdhci_sprd_probe() enables runtime PM, while sdhci_sprd_remove() does not perform the corresponding runtime PM cleanup. The probe failure path disables runtime PM before disabling the clocks, but the normal remove path directly disables clocks that are also managed by the runtime PM callbacks. If the device is runtime suspended, those clocks may already be disabled. Resume the device before removal, disable runtime PM and drop the temporary runtime PM reference before disabling the clocks. This issue was found by manual code inspection. Fixes: fb8bd90f83c4 ("mmc: sdhci-sprd: Add Spreadtrum's initial host controller") Cc: stable@vger.kernel.org Signed-off-by: Guangshuo Li Reviewed-by: Baolin Wang Acked-by: Adrian Hunter Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/host/sdhci-sprd.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/mmc/host/sdhci-sprd.c +++ b/drivers/mmc/host/sdhci-sprd.c @@ -890,6 +890,10 @@ static void sdhci_sprd_remove(struct pla struct sdhci_host *host = platform_get_drvdata(pdev); struct sdhci_sprd_host *sprd_host = TO_SPRD_HOST(host); + pm_runtime_get_sync(&pdev->dev); + pm_runtime_disable(&pdev->dev); + pm_runtime_put_noidle(&pdev->dev); + sdhci_remove_host(host, 0); clk_disable_unprepare(sprd_host->clk_sdio);