* [PATCH] mmc: sdhci-omap: re-tuning is needed after a pm transition to support emmc HS200 mode
@ 2024-03-15 23:44 Romain Naour
2024-03-21 9:47 ` Tony Lindgren
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Romain Naour @ 2024-03-15 23:44 UTC (permalink / raw)
To: linux-omap
Cc: vigneshr, adrian.hunter, ulf.hansson, linux-mmc, tony,
Romain Naour
From: Romain Naour <romain.naour@skf.com>
"PM runtime functions" has been added in sdhci-omap driver in 5.16
f433e8aac6b9 ("mmc: sdhci-omap: Implement PM runtime functions") along
with "card power off and enable aggressive PM" 3edf588e7fe0
("mmc: sdhci-omap: Allow SDIO card power off and enable aggressive PM").
Since then, the sdhci-omap driver doesn't work using mmc-hs200 mode
due to the tuning values being lost during a pm transition.
See the report on the linux-omap mailing list [1].
As for the sdhci_am654 driver, request a new tuning sequence before
suspend (sdhci_omap_runtime_suspend()), othwerwise the device will
thigger cache flush errors:
mmc1: cache flush error -110 (ETIMEDOUT)
mmc1: error -110 doing aggressive suspend
followed by I/O errors produced by fdisk -l /dev/mmcblk1boot1:
I/O error, dev mmcblk1boot0, sector 64384 op 0x0:(READ) flags 0x80700 phys_seg 1
prio class 2
I/O error, dev mmcblk1boot1, sector 64384 op 0x0:(READ) flags 0x80700 phys_seg 1
prio class 2
I/O error, dev mmcblk1boot1, sector 64384 op 0x0:(READ) flags 0x0 phys_seg 1
prio class 2
Buffer I/O error on dev mmcblk1boot1, logical block 8048, async page read
I/O error, dev mmcblk1boot0, sector 64384 op 0x0:(READ) flags 0x0 phys_seg 1
prio class 2
Buffer I/O error on dev mmcblk1boot0, logical block 8048, async page read
Don't re-tune if auto retuning is supported in HW (when SDHCI_TUNING_MODE_3
is available).
[1] https://lore.kernel.org/all/2e5f1997-564c-44e4-b357-6343e0dae7ab@smile.fr
Fixes: f433e8aac6b9 ("mmc: sdhci-omap: Implement PM runtime functions")
Signed-off-by: Romain Naour <romain.naour@skf.com>
---
drivers/mmc/host/sdhci-omap.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c
index e78faef67d7a..94076b095571 100644
--- a/drivers/mmc/host/sdhci-omap.c
+++ b/drivers/mmc/host/sdhci-omap.c
@@ -1439,6 +1439,9 @@ static int __maybe_unused sdhci_omap_runtime_suspend(struct device *dev)
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
struct sdhci_omap_host *omap_host = sdhci_pltfm_priv(pltfm_host);
+ if (host->tuning_mode != SDHCI_TUNING_MODE_3)
+ mmc_retune_needed(host->mmc);
+
if (omap_host->con != -EINVAL)
sdhci_runtime_suspend_host(host);
--
2.43.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] mmc: sdhci-omap: re-tuning is needed after a pm transition to support emmc HS200 mode
2024-03-15 23:44 [PATCH] mmc: sdhci-omap: re-tuning is needed after a pm transition to support emmc HS200 mode Romain Naour
@ 2024-03-21 9:47 ` Tony Lindgren
2024-03-21 11:08 ` Adrian Hunter
2024-03-25 13:18 ` Ulf Hansson
2 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2024-03-21 9:47 UTC (permalink / raw)
To: Romain Naour
Cc: linux-omap, vigneshr, adrian.hunter, ulf.hansson, linux-mmc,
Romain Naour
* Romain Naour <romain.naour@smile.fr> [240316 01:44]:
> From: Romain Naour <romain.naour@skf.com>
>
> "PM runtime functions" has been added in sdhci-omap driver in 5.16
> f433e8aac6b9 ("mmc: sdhci-omap: Implement PM runtime functions") along
> with "card power off and enable aggressive PM" 3edf588e7fe0
> ("mmc: sdhci-omap: Allow SDIO card power off and enable aggressive PM").
>
> Since then, the sdhci-omap driver doesn't work using mmc-hs200 mode
> due to the tuning values being lost during a pm transition.
> See the report on the linux-omap mailing list [1].
Looks good to me, sorry for the delay in replying. I though I already
replied but had some issues with a bad sata ssd for a few days.
Anyways:
Reviewed-by: Tony Lindgren <tony@atomide.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mmc: sdhci-omap: re-tuning is needed after a pm transition to support emmc HS200 mode
2024-03-15 23:44 [PATCH] mmc: sdhci-omap: re-tuning is needed after a pm transition to support emmc HS200 mode Romain Naour
2024-03-21 9:47 ` Tony Lindgren
@ 2024-03-21 11:08 ` Adrian Hunter
2024-03-25 13:18 ` Ulf Hansson
2 siblings, 0 replies; 4+ messages in thread
From: Adrian Hunter @ 2024-03-21 11:08 UTC (permalink / raw)
To: Romain Naour, linux-omap
Cc: vigneshr, ulf.hansson, linux-mmc, tony, Romain Naour
On 16/03/24 01:44, Romain Naour wrote:
> From: Romain Naour <romain.naour@skf.com>
>
> "PM runtime functions" has been added in sdhci-omap driver in 5.16
> f433e8aac6b9 ("mmc: sdhci-omap: Implement PM runtime functions") along
> with "card power off and enable aggressive PM" 3edf588e7fe0
checkpatch expects "commit" before commit numbers i.e.
ERROR: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit f433e8aac6b9 ("mmc: sdhci-omap: Implement PM runtime functions")'
#9:
f433e8aac6b9 ("mmc: sdhci-omap: Implement PM runtime functions") along
ERROR: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit 3edf588e7fe0 ("mmc: sdhci-omap: Allow SDIO card power off and enable aggressive PM")'
#10:
with "card power off and enable aggressive PM" 3edf588e7fe0
> ("mmc: sdhci-omap: Allow SDIO card power off and enable aggressive PM").
>
> Since then, the sdhci-omap driver doesn't work using mmc-hs200 mode
> due to the tuning values being lost during a pm transition.
> See the report on the linux-omap mailing list [1].
>
> As for the sdhci_am654 driver, request a new tuning sequence before
> suspend (sdhci_omap_runtime_suspend()), othwerwise the device will
othwerwise -> otherwise
> thigger cache flush errors:
thigger -> trigger
>
> mmc1: cache flush error -110 (ETIMEDOUT)
> mmc1: error -110 doing aggressive suspend
>
> followed by I/O errors produced by fdisk -l /dev/mmcblk1boot1:
>
> I/O error, dev mmcblk1boot0, sector 64384 op 0x0:(READ) flags 0x80700 phys_seg 1
> prio class 2
> I/O error, dev mmcblk1boot1, sector 64384 op 0x0:(READ) flags 0x80700 phys_seg 1
> prio class 2
> I/O error, dev mmcblk1boot1, sector 64384 op 0x0:(READ) flags 0x0 phys_seg 1
> prio class 2
> Buffer I/O error on dev mmcblk1boot1, logical block 8048, async page read
> I/O error, dev mmcblk1boot0, sector 64384 op 0x0:(READ) flags 0x0 phys_seg 1
> prio class 2
> Buffer I/O error on dev mmcblk1boot0, logical block 8048, async page read
>
> Don't re-tune if auto retuning is supported in HW (when SDHCI_TUNING_MODE_3
> is available).
>
> [1] https://lore.kernel.org/all/2e5f1997-564c-44e4-b357-6343e0dae7ab@smile.fr
>
> Fixes: f433e8aac6b9 ("mmc: sdhci-omap: Implement PM runtime functions")
Cc stable?
> Signed-off-by: Romain Naour <romain.naour@skf.com>
Minor cosmetics, otherwise:
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
> ---
> drivers/mmc/host/sdhci-omap.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c
> index e78faef67d7a..94076b095571 100644
> --- a/drivers/mmc/host/sdhci-omap.c
> +++ b/drivers/mmc/host/sdhci-omap.c
> @@ -1439,6 +1439,9 @@ static int __maybe_unused sdhci_omap_runtime_suspend(struct device *dev)
> struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
> struct sdhci_omap_host *omap_host = sdhci_pltfm_priv(pltfm_host);
>
> + if (host->tuning_mode != SDHCI_TUNING_MODE_3)
> + mmc_retune_needed(host->mmc);
> +
> if (omap_host->con != -EINVAL)
> sdhci_runtime_suspend_host(host);
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mmc: sdhci-omap: re-tuning is needed after a pm transition to support emmc HS200 mode
2024-03-15 23:44 [PATCH] mmc: sdhci-omap: re-tuning is needed after a pm transition to support emmc HS200 mode Romain Naour
2024-03-21 9:47 ` Tony Lindgren
2024-03-21 11:08 ` Adrian Hunter
@ 2024-03-25 13:18 ` Ulf Hansson
2 siblings, 0 replies; 4+ messages in thread
From: Ulf Hansson @ 2024-03-25 13:18 UTC (permalink / raw)
To: Romain Naour
Cc: linux-omap, vigneshr, adrian.hunter, linux-mmc, tony,
Romain Naour
On Sat, 16 Mar 2024 at 00:44, Romain Naour <romain.naour@smile.fr> wrote:
>
> From: Romain Naour <romain.naour@skf.com>
>
> "PM runtime functions" has been added in sdhci-omap driver in 5.16
> f433e8aac6b9 ("mmc: sdhci-omap: Implement PM runtime functions") along
> with "card power off and enable aggressive PM" 3edf588e7fe0
> ("mmc: sdhci-omap: Allow SDIO card power off and enable aggressive PM").
>
> Since then, the sdhci-omap driver doesn't work using mmc-hs200 mode
> due to the tuning values being lost during a pm transition.
> See the report on the linux-omap mailing list [1].
>
> As for the sdhci_am654 driver, request a new tuning sequence before
> suspend (sdhci_omap_runtime_suspend()), othwerwise the device will
> thigger cache flush errors:
>
> mmc1: cache flush error -110 (ETIMEDOUT)
> mmc1: error -110 doing aggressive suspend
>
> followed by I/O errors produced by fdisk -l /dev/mmcblk1boot1:
>
> I/O error, dev mmcblk1boot0, sector 64384 op 0x0:(READ) flags 0x80700 phys_seg 1
> prio class 2
> I/O error, dev mmcblk1boot1, sector 64384 op 0x0:(READ) flags 0x80700 phys_seg 1
> prio class 2
> I/O error, dev mmcblk1boot1, sector 64384 op 0x0:(READ) flags 0x0 phys_seg 1
> prio class 2
> Buffer I/O error on dev mmcblk1boot1, logical block 8048, async page read
> I/O error, dev mmcblk1boot0, sector 64384 op 0x0:(READ) flags 0x0 phys_seg 1
> prio class 2
> Buffer I/O error on dev mmcblk1boot0, logical block 8048, async page read
>
> Don't re-tune if auto retuning is supported in HW (when SDHCI_TUNING_MODE_3
> is available).
>
> [1] https://lore.kernel.org/all/2e5f1997-564c-44e4-b357-6343e0dae7ab@smile.fr
>
> Fixes: f433e8aac6b9 ("mmc: sdhci-omap: Implement PM runtime functions")
> Signed-off-by: Romain Naour <romain.naour@skf.com>
Applied for fixes and by fixing the comments Adrian pointed out in his
reply, thanks!
Note that, I have also tagged this for stable kernels.
Kind regards
Uffe
> ---
> drivers/mmc/host/sdhci-omap.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c
> index e78faef67d7a..94076b095571 100644
> --- a/drivers/mmc/host/sdhci-omap.c
> +++ b/drivers/mmc/host/sdhci-omap.c
> @@ -1439,6 +1439,9 @@ static int __maybe_unused sdhci_omap_runtime_suspend(struct device *dev)
> struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
> struct sdhci_omap_host *omap_host = sdhci_pltfm_priv(pltfm_host);
>
> + if (host->tuning_mode != SDHCI_TUNING_MODE_3)
> + mmc_retune_needed(host->mmc);
> +
> if (omap_host->con != -EINVAL)
> sdhci_runtime_suspend_host(host);
>
> --
> 2.43.2
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-03-25 13:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-15 23:44 [PATCH] mmc: sdhci-omap: re-tuning is needed after a pm transition to support emmc HS200 mode Romain Naour
2024-03-21 9:47 ` Tony Lindgren
2024-03-21 11:08 ` Adrian Hunter
2024-03-25 13:18 ` Ulf Hansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox