From: Adrian Hunter <adrian.hunter@intel.com>
To: Chris Ball <cjb@laptop.org>
Cc: linux-mmc <linux-mmc@vger.kernel.org>, stable <stable@vger.kernel.org>
Subject: Re: [PATCH RESEND] mmc: sdhci-pci: Fix BYT sd card getting stuck in runtime suspend
Date: Wed, 11 Dec 2013 14:43:38 +0200 [thread overview]
Message-ID: <52A85DFA.4080505@intel.com> (raw)
In-Reply-To: <1386764492-26444-1-git-send-email-adrian.hunter@intel.com>
Hi
For some reason this email doesn't seem to get
onto the mailing lists. I am trying to figure out
why.
On 11/12/13 14:21, Adrian Hunter wrote:
> A host controller for a SD card may need a GPIO
> for card detect in order to wake up from runtime
> suspend when a card is inserted. If that GPIO is
> not configured, then the host controller will not
> wake up. Fix that for the affected devices by not
> enabling runtime PM unless the GPIO is successfully
> set up.
>
> This affects BYT sd card host controller which had
> runtime PM enabled from v3.11. For completeness,
> the MFD sd card host controller is flagged also.
>
> Tested on v3.11.10 and v3.12.4 although the patch
> applies with some offsets and fuzz.
>
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> Cc: stable <stable@vger.kernel.org> # 3.11+
> ---
> drivers/mmc/host/sdhci-pci.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c
> index 8f75381..7b930e6 100644
> --- a/drivers/mmc/host/sdhci-pci.c
> +++ b/drivers/mmc/host/sdhci-pci.c
> @@ -65,6 +65,7 @@ struct sdhci_pci_fixes {
> unsigned int quirks;
> unsigned int quirks2;
> bool allow_runtime_pm;
> + bool own_cd_for_runtime_pm;
>
> int (*probe) (struct sdhci_pci_chip *);
>
> @@ -296,6 +297,7 @@ static const struct sdhci_pci_fixes sdhci_intel_mrst_hc1_hc2 = {
> static const struct sdhci_pci_fixes sdhci_intel_mfd_sd = {
> .quirks = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
> .allow_runtime_pm = true,
> + .own_cd_for_runtime_pm = true,
> };
>
> static const struct sdhci_pci_fixes sdhci_intel_mfd_sdio = {
> @@ -360,6 +362,7 @@ static const struct sdhci_pci_fixes sdhci_intel_byt_sdio = {
> static const struct sdhci_pci_fixes sdhci_intel_byt_sd = {
> .quirks2 = SDHCI_QUIRK2_CARD_ON_NEEDS_BUS_ON,
> .allow_runtime_pm = true,
> + .own_cd_for_runtime_pm = true,
> };
>
> /* Define Host controllers for Intel Merrifield platform */
> @@ -1457,6 +1460,14 @@ static struct sdhci_pci_slot *sdhci_pci_probe_slot(
>
> sdhci_pci_add_own_cd(slot);
>
> + /*
> + * Check if the chip needs a separate GPIO for card detect to wake up
> + * from runtime suspend. If it is not there, don't allow runtime PM.
> + * Note sdhci_pci_add_own_cd() sets slot->cd_gpio to -EINVAL on failure.
> + */
> + if (chip->fixes->own_cd_for_runtime_pm && !gpio_is_valid(slot->cd_gpio))
> + chip->allow_runtime_pm = false;
> +
> return slot;
>
> remove:
>
next parent reply other threads:[~2013-12-11 12:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1386764492-26444-1-git-send-email-adrian.hunter@intel.com>
2013-12-11 12:43 ` Adrian Hunter [this message]
2014-01-13 7:32 ` [PATCH V2 mmc: sdhci-pci: Fix BYT sd card getting stuck in runtime suspend Adrian Hunter
2014-01-13 7:49 ` [PATCH V3] " Adrian Hunter
2014-01-20 6:15 ` Adrian Hunter
2014-01-20 6:18 ` Adrian Hunter
2014-01-20 15:38 ` Chris Ball
2013-12-11 13:03 [PATCH RESEND] " Adrian Hunter
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=52A85DFA.4080505@intel.com \
--to=adrian.hunter@intel.com \
--cc=cjb@laptop.org \
--cc=linux-mmc@vger.kernel.org \
--cc=stable@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).