All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Fuzzey <mfuzzey@parkeon.com>
To: Dong Aisheng <dongas86@gmail.com>
Cc: Dong Aisheng <b29396@freescale.com>, Chris Ball <cjb@laptop.org>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>
Subject: Re: [Regression: mmc: sdhci-esdhc-imx: add runtime pm support]
Date: Fri, 07 Feb 2014 10:25:19 +0100	[thread overview]
Message-ID: <52F4A67F.1090702@parkeon.com> (raw)
In-Reply-To: <CAA+hA=Rk3bk3yE73+_8Hp5DEedspMPYmG3LVCDEt_wgMmqXKLQ@mail.gmail.com>

Hi Dong,

thank you for your rapid response.

On 07/02/14 09:03, Dong Aisheng wrote:
> Some SDIO cards may not be able to work well without clock.
>
> Originally it is handled by the mmc clock gate framework.
> See:
> static bool mmc_host_may_gate_card(struct mmc_card *card)
> {
>          /* If there is no card we may gate it */
>          if (!card)
>                  return true;
>          /*
>           * Don't gate SDIO cards! These need to be clocked at all times
>           * since they may be independent systems generating interrupts
>           * and other events. The clock requests counter from the core will
>           * go down to zero since the core does not need it, but we will not
>           * gate the clock, because there is somebody out there that may still
>           * be using it.
>           */
>          return !(card->quirks & MMC_QUIRK_BROKEN_CLK_GATING);
> }
> But Ulf proposed to remove clock gate framework since no one used it anymore
> and the patch was already sent in the mail list a few weeks ago.
> Then this may need to be handled by the host driver after adding rpm.
Yes indeed the above code does nothing for the rpm case and it looks 
like it's on the way out anyway.
>> Can you try the following patch to see if it works?
>>
>> commit d9d062627407f714ba326fa8dd6e8aa20199fdbe
>> Author: Dong Aisheng <b29396@freescale.com>
>> Date:   Fri Nov 15 17:54:36 2013 +0800
>>
>>      mmc: sdhci: get runtime pm when sdio irq is enabled
>>
>>      SDIO cards may need clock to send the card interrupt to host.
>>      Thus, we get runtime pm when sdio irq is enabled to prevent the clock
>>      resource is released and put it when sdio irq is disabled.
>>
>>      Signed-off-by: Dong Aisheng <b29396@freescale.com>
>>
>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
>> index 9ddef47..f892757 100644
>> --- a/drivers/mmc/host/sdhci.c
>> +++ b/drivers/mmc/host/sdhci.c
>> @@ -1734,9 +1734,15 @@ static void sdhci_enable_sdio_irq(struct
>> mmc_host *mmc, int enable)
>>          struct sdhci_host *host = mmc_priv(mmc);
>>          unsigned long flags;
>>
>> +       if (enable)
>> +               sdhci_runtime_pm_get(host);
>> +
>>          spin_lock_irqsave(&host->lock, flags);
>>          sdhci_enable_sdio_irq_nolock(host, enable);
>>          spin_unlock_irqrestore(&host->lock, flags);
>> +
>> +       if (!enable)
>> +               sdhci_runtime_pm_put(host);
>>   }
>>
>>   static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host,
>>

Yes that works fine for me thank you.

What is the status of this patch?

I see you wrote it in November but I can't find it in git or on the 
mailing list anywhere

Regards,

Martin


  reply	other threads:[~2014-02-07  9:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-06 14:55 [Regression: mmc: sdhci-esdhc-imx: add runtime pm support] Martin Fuzzey
2014-02-07  7:56 ` Dong Aisheng
2014-02-07  8:03   ` Dong Aisheng
2014-02-07  9:25     ` Martin Fuzzey [this message]
2014-02-08 12:42       ` Dong Aisheng
2015-07-01 13:13   ` Bastien Nocera
2015-07-01 20:19     ` Paul Mansfield
2015-07-01 20:20     ` Paul Mansfield

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=52F4A67F.1090702@parkeon.com \
    --to=mfuzzey@parkeon.com \
    --cc=b29396@freescale.com \
    --cc=cjb@laptop.org \
    --cc=dongas86@gmail.com \
    --cc=linux-mmc@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.