public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Romain Naour <romain.naour@smile.fr>
Cc: Linux-OMAP <linux-omap@vger.kernel.org>,
	Nishanth Menon <nm@ti.com>,
	linux-mmc@vger.kernel.org, Ulf Hansson <ulf.hansson@linaro.org>,
	Adrian Hunter <adrian.hunter@intel.com>
Subject: Re: sdhci-omap: issues with PM features since 5.16
Date: Wed, 31 Jan 2024 12:30:50 +0200	[thread overview]
Message-ID: <20240131103050.GZ5185@atomide.com> (raw)
In-Reply-To: <7d72f3ee-bcfe-4197-b492-857dc49b2788@smile.fr>

Hi,

Adding the linux-mmc folks to Cc too.

* Romain Naour <romain.naour@smile.fr> [240130 11:20]:
> Le 29/01/2024 à 18:42, Romain Naour a écrit :
> > Le 29/01/2024 à 12:17, Tony Lindgren a écrit :
> >> So I'm still guessing your issue is with emmc not getting reinitialized
> >> properly as there's no mmc-pwrseq-emmc configured. Can you give it a
> >> try? See am5729-beagleboneai.dts for an example.
> 
> I can't add such mmc-pwrseq-emmc on the custom board, there is no gpio available
> to reset the emmc device.
> 
> To resume:
> - the emmc doesn't work with mmc-hs200-1_8v mode with PM runtime enabled
> - the emmc works with mmc-hs200-1_8v mode without PM runtime (patch series reverted)
> - the emmc works with mmc-ddr-1_8v mode with PM runtime enabled
> 
> AFAIU the hs200 mode requires some pin iodelay tuning (SDHCI_OMAP_REQUIRE_IODELAY)
> is sdhci_omap_runtime_{suspend,resume} needs to take care of that?
> 
> The mmc2 clock seems idle when mmc-hs200-1_8v and PM runtime are used.
> 
> omapconf dump prcm l3init
> 
> (mmc2 clock idle)
> | CM_L3INIT_MMC2_CLKCTRL           | 0x4A009330   | 0x01070000 |
> 
> (mmc2 clock running)
> | CM_L3INIT_MMC2_CLKCTRL           | 0x4A009330   | 0x01040002 |
> 
> Thoughts?

OK so if the emmc reset gpio is not available, seems we should do something
like the following patch to not set MMC_CAP_POWER_OFF_CARD unless the
cap-power-off-card devicetree property is set.

Care to give it a try and see if it helps?

Regards,

Tony

8< ----------------
diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c
--- a/drivers/mmc/host/sdhci-omap.c
+++ b/drivers/mmc/host/sdhci-omap.c
@@ -1339,8 +1339,11 @@ static int sdhci_omap_probe(struct platform_device *pdev)
 	/* R1B responses is required to properly manage HW busy detection. */
 	mmc->caps |= MMC_CAP_NEED_RSP_BUSY;
 
-	/* Allow card power off and runtime PM for eMMC/SD card devices */
-	mmc->caps |= MMC_CAP_POWER_OFF_CARD | MMC_CAP_AGGRESSIVE_PM;
+	/*
+	 * Allow runtime PM for eMMC/SD card devices. Note that to power off
+	 * the card, the devicetree property cap-power-off-card must be set.
+	 */
+	mmc->caps |= MMC_CAP_AGGRESSIVE_PM;
 
 	ret = sdhci_setup_host(host);
 	if (ret)
-- 
2.43.0

  reply	other threads:[~2024-01-31 10:31 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-26 20:53 sdhci-omap: issues with PM features since 5.16 Romain Naour
2024-01-27  4:48 ` Tony Lindgren
2024-01-29 10:11   ` Romain Naour
2024-01-29 11:17     ` Tony Lindgren
2024-01-29 17:42       ` Romain Naour
2024-01-30 11:14         ` Romain Naour
2024-01-31 10:30           ` Tony Lindgren [this message]
2024-02-01  9:04             ` Romain Naour
2024-02-02  4:36               ` Tony Lindgren
2024-02-08 11:29                 ` Romain Naour
2024-02-08 12:57                   ` Adam Ford
2024-02-12  7:27                     ` Tony Lindgren
2024-02-12 13:24                       ` Adam Ford
2024-02-13  6:03                         ` Tony Lindgren
2024-02-13 12:43                           ` Adam Ford
2024-02-13 12:58                             ` Tony Lindgren
2024-03-15 23:49                   ` Romain Naour
2024-03-21  9:48                     ` Tony Lindgren
2024-01-30 11:15         ` Tony Lindgren
2024-01-30 11:22           ` Romain Naour

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=20240131103050.GZ5185@atomide.com \
    --to=tony@atomide.com \
    --cc=adrian.hunter@intel.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=romain.naour@smile.fr \
    --cc=ulf.hansson@linaro.org \
    /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