FAILED: patch "[PATCH] mmc: dw_mmc-rockchip: Fix runtime PM support for internal" failed to apply to 6.18-stable tree
[email protected]
maintainerThe patch below does not apply to the 6.18-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.18.y
git checkout FETCH_HEAD
git cherry-pick -x 6465a8bbb0f6ad98aeb66dc9ea19c32c193a610b
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026031723-prologue-devotee-9062@gregkh' --subject-prefix 'PATCH 6.18.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 6465a8bbb0f6ad98aeb66dc9ea19c32c193a610b Mon Sep 17 00:00:00 2001
From: Shawn Lin <[email protected]>
Date: Fri, 16 Jan 2026 08:55:30 +0800
Subject: [PATCH] mmc: dw_mmc-rockchip: Fix runtime PM support for internal
phase support
RK3576 is the first platform to introduce internal phase support, and subsequent platforms are expected to adopt a similar design. In this architecture, runtime suspend powers off the attached power domain, which resets registers, including vendor-specific ones such as SDMMC_TIMING_CON0, SDMMC_TIMING_CON1, and SDMMC_MISC_CON. These registers must be saved and restored, a requirement that falls outside the scope of the dw_mmc core.
drivers/mmc/host/dw_mmc-rockchip.c +37 -1
@@ -36,6 +36,8 @@ struct dw_mci_rockchip_priv_data {int default_sample_phase;int num_phases;bool internal_phase; +int sample_phase; +int drv_phase; };/*
@@ -573,9 +575,43 @@ static void dw_mci_rockchip_remove(struct platform_device *pdev)dw_mci_pltfm_remove (pdev); } +static int dw_mci_rockchip_runtime_suspend (struct device *dev) +{ +struct platform_device *pdev =to_platform_device (dev); +struct dw_mci *host =platform_get_drvdata (pdev); +struct dw_mci_rockchip_priv_data *priv = host->priv; + +if (priv->internal_phase) { + priv->sample_phase =rockchip_mmc_get_phase (host, true); + priv->drv_phase =rockchip_mmc_get_phase (host, false); + } + +return dw_mci_runtime_suspend (dev); +} + +static int dw_mci_rockchip_runtime_resume (struct device *dev) +{ +struct platform_device *pdev =to_platform_device (dev); +struct dw_mci *host =platform_get_drvdata (pdev); +struct dw_mci_rockchip_priv_data *priv = host->priv; +int ret; + + ret =dw_mci_runtime_resume (dev); +if (ret) +return ret; + +if (priv->internal_phase) { +rockchip_mmc_set_phase (host, true, priv->sample_phase); +rockchip_mmc_set_phase (host, false, priv->drv_phase); +mci_writel (host,MISC_CON ,MEM_CLK_AUTOGATE_ENABLE ); + } + +return ret; +} +static const struct dev_pm_ops dw_mci_rockchip_dev_pm_ops = { SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) -RUNTIME_PM_OPS (dw_mci_runtime_suspend, dw_mci_runtime_resume,NULL ) +RUNTIME_PM_OPS (dw_mci_rockchip_runtime_suspend, dw_mci_rockchip_runtime_resume,NULL ) };static struct platform_driver dw_mci_rockchip_pltfm_driver = {
Sasha Levin
maintainerPATCH 1/2 mmc: dw_mmc-rockchip: Add memory clock auto-gating support
From: Shawn Lin <[email protected]>
[ Upstream commit ff6f0286c896f062853552097220dd93961be9c4 ]
Per design recommendations, the memory clock can be gated when there is no in-flight transfer, which helps save power. This feature is introduced alongside internal phase support, and this patch enables it.
Stable-dep-of: 6465a8bbb0f6 ("mmc: dw_mmc-rockchip: Fix runtime PM support for internal phase support")
--- drivers/mmc/host/dw_mmc-rockchip.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/mmc/host/dw_mmc-rockchip.c +6 -0
@@ -19,6 +19,8 @@#define RK3288_CLKGEN_DIV 2#define SDMMC_TIMING_CON0 0x130#define SDMMC_TIMING_CON1 0x134 +#define SDMMC_MISC_CON 0x138 +#define MEM_CLK_AUTOGATE_ENABLE BIT(5)#define ROCKCHIP_MMC_DELAY_SEL BIT(10)#define ROCKCHIP_MMC_DEGREE_MASK 0x3#define ROCKCHIP_MMC_DEGREE_OFFSET 1
@@ -470,6 +472,7 @@ static int dw_mci_rk3576_parse_dt(struct dw_mci *host)static int dw_mci_rockchip_init (struct dw_mci *host) { +struct dw_mci_rockchip_priv_data *priv = host->priv;int ret, i;/* It is slot 8 on Rockchip SoCs */
@@ -494,6 +497,9 @@ static int dw_mci_rockchip_init(struct dw_mci *host)dev_warn (host->dev,"no valid minimum freq: %d\n" , ret); } +if (priv->internal_phase) +mci_writel (host,MISC_CON ,MEM_CLK_AUTOGATE_ENABLE ); +return 0 ; }
Signature · 1 line
2.51.0
Sasha Levin
maintainerPATCH 2/2 mmc: dw_mmc-rockchip: Fix runtime PM support for internal phase support
From: Shawn Lin <[email protected]>
[ Upstream commit 6465a8bbb0f6ad98aeb66dc9ea19c32c193a610b ]
RK3576 is the first platform to introduce internal phase support, and subsequent platforms are expected to adopt a similar design. In this architecture, runtime suspend powers off the attached power domain, which resets registers, including vendor-specific ones such as SDMMC_TIMING_CON0, SDMMC_TIMING_CON1, and SDMMC_MISC_CON. These registers must be saved and restored, a requirement that falls outside the scope of the dw_mmc core.
--- drivers/mmc/host/dw_mmc-rockchip.c | 38 +++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-)
drivers/mmc/host/dw_mmc-rockchip.c +37 -1
@@ -36,6 +36,8 @@ struct dw_mci_rockchip_priv_data {int default_sample_phase;int num_phases;bool internal_phase; +int sample_phase; +int drv_phase; };/*
@@ -574,9 +576,43 @@ static void dw_mci_rockchip_remove(struct platform_device *pdev)dw_mci_pltfm_remove (pdev); } +static int dw_mci_rockchip_runtime_suspend (struct device *dev) +{ +struct platform_device *pdev =to_platform_device (dev); +struct dw_mci *host =platform_get_drvdata (pdev); +struct dw_mci_rockchip_priv_data *priv = host->priv; + +if (priv->internal_phase) { + priv->sample_phase =rockchip_mmc_get_phase (host, true); + priv->drv_phase =rockchip_mmc_get_phase (host, false); + } + +return dw_mci_runtime_suspend (dev); +} + +static int dw_mci_rockchip_runtime_resume (struct device *dev) +{ +struct platform_device *pdev =to_platform_device (dev); +struct dw_mci *host =platform_get_drvdata (pdev); +struct dw_mci_rockchip_priv_data *priv = host->priv; +int ret; + + ret =dw_mci_runtime_resume (dev); +if (ret) +return ret; + +if (priv->internal_phase) { +rockchip_mmc_set_phase (host, true, priv->sample_phase); +rockchip_mmc_set_phase (host, false, priv->drv_phase); +mci_writel (host,MISC_CON ,MEM_CLK_AUTOGATE_ENABLE ); + } + +return ret; +} +static const struct dev_pm_ops dw_mci_rockchip_dev_pm_ops = { SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) -RUNTIME_PM_OPS (dw_mci_runtime_suspend, dw_mci_runtime_resume,NULL ) +RUNTIME_PM_OPS (dw_mci_rockchip_runtime_suspend, dw_mci_rockchip_runtime_resume,NULL ) };static struct platform_driver dw_mci_rockchip_pltfm_driver = {
Signature · 1 line
2.51.0