From: Adrian Hunter <adrian.hunter@intel.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Hans de Goede <hdegoede@redhat.com>,
"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
Dong Aisheng <b29396@freescale.com>
Subject: Re: [PATCH v2 2/2] mmc: sdhci: intel: Disable runtime pm when the sdio_irq is enabled.
Date: Wed, 22 Mar 2017 14:06:43 +0200 [thread overview]
Message-ID: <2d388dd3-a024-0eea-dc07-c207be0a044c@intel.com> (raw)
In-Reply-To: <CAPDyKFp-w9jORUUC=eqwPnnZcxQKCu_d2y9pqvX3cq_rx67gYA@mail.gmail.com>
On 21/03/17 16:54, Ulf Hansson wrote:
> On 21 March 2017 at 13:34, Adrian Hunter <adrian.hunter@intel.com> wrote:
>> On 21/03/17 12:00, Ulf Hansson wrote:
>>> On 15 March 2017 at 17:31, Hans de Goede <hdegoede@redhat.com> wrote:
>>>> SDIO cards may need clock to send the card interrupt to the host.
>>>>
>>>> On a cherrytrail tablet with a RTL8723BS wifi chip, without this patch
>>>> pinging the tablet results in:
>>>>
>>>> PING 192.168.1.14 (192.168.1.14) 56(84) bytes of data.
>>>> 64 bytes from 192.168.1.14: icmp_seq=1 ttl=64 time=78.6 ms
>>>> 64 bytes from 192.168.1.14: icmp_seq=2 ttl=64 time=1760 ms
>>>> 64 bytes from 192.168.1.14: icmp_seq=3 ttl=64 time=753 ms
>>>> 64 bytes from 192.168.1.14: icmp_seq=4 ttl=64 time=3.88 ms
>>>> 64 bytes from 192.168.1.14: icmp_seq=5 ttl=64 time=795 ms
>>>> 64 bytes from 192.168.1.14: icmp_seq=6 ttl=64 time=1841 ms
>>>> 64 bytes from 192.168.1.14: icmp_seq=7 ttl=64 time=810 ms
>>>> 64 bytes from 192.168.1.14: icmp_seq=8 ttl=64 time=1860 ms
>>>> 64 bytes from 192.168.1.14: icmp_seq=9 ttl=64 time=812 ms
>>>> 64 bytes from 192.168.1.14: icmp_seq=10 ttl=64 time=48.6 ms
>>>>
>>>> Where as with this patch I get:
>>>>
>>>> PING 192.168.1.14 (192.168.1.14) 56(84) bytes of data.
>>>> 64 bytes from 192.168.1.14: icmp_seq=1 ttl=64 time=3.96 ms
>>>> 64 bytes from 192.168.1.14: icmp_seq=2 ttl=64 time=1.97 ms
>>>> 64 bytes from 192.168.1.14: icmp_seq=3 ttl=64 time=17.2 ms
>>>> 64 bytes from 192.168.1.14: icmp_seq=4 ttl=64 time=2.46 ms
>>>> 64 bytes from 192.168.1.14: icmp_seq=5 ttl=64 time=2.83 ms
>>>> 64 bytes from 192.168.1.14: icmp_seq=6 ttl=64 time=1.40 ms
>>>> 64 bytes from 192.168.1.14: icmp_seq=7 ttl=64 time=2.10 ms
>>>> 64 bytes from 192.168.1.14: icmp_seq=8 ttl=64 time=1.40 ms
>>>> 64 bytes from 192.168.1.14: icmp_seq=9 ttl=64 time=2.04 ms
>>>> 64 bytes from 192.168.1.14: icmp_seq=10 ttl=64 time=1.40 ms
>>>>
>>>> Cc: Dong Aisheng <b29396@freescale.com>
>>>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>>>> ---
>>>> Changes in v2:
>>>> -New patch replacing "mmc: sdhci: sdio-intel: Set
>>>> SDHCI_QUIRK2_CARD_ON_NEEDS_BUS_ON quirk"
>>>> ---
>>>> drivers/mmc/host/sdhci-acpi.c | 1 +
>>>> drivers/mmc/host/sdhci-pci-core.c | 1 +
>>>> drivers/mmc/host/sdhci.c | 6 ++++++
>>>> drivers/mmc/host/sdhci.h | 2 ++
>>>> 4 files changed, 10 insertions(+)
>>>>
>>>> diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
>>>> index 237f318..53b431a 100644
>>>> --- a/drivers/mmc/host/sdhci-acpi.c
>>>> +++ b/drivers/mmc/host/sdhci-acpi.c
>>>> @@ -288,6 +288,7 @@ static const struct sdhci_acpi_slot sdhci_acpi_slot_int_emmc = {
>>>> static const struct sdhci_acpi_slot sdhci_acpi_slot_int_sdio = {
>>>> .quirks = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
>>>> .quirks2 = SDHCI_QUIRK2_HOST_OFF_CARD_ON |
>>>> + SDHCI_QUIRK2_SDIO_IRQ_NO_RUNTIME_PM |
>>>> SDHCI_QUIRK2_PRESET_VALUE_BROKEN,
>>>> .caps = MMC_CAP_NONREMOVABLE | MMC_CAP_POWER_OFF_CARD |
>>>> MMC_CAP_WAIT_WHILE_BUSY,
>>>> diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c
>>>> index 982b3e3..a3b242e 100644
>>>> --- a/drivers/mmc/host/sdhci-pci-core.c
>>>> +++ b/drivers/mmc/host/sdhci-pci-core.c
>>>> @@ -498,6 +498,7 @@ static const struct sdhci_pci_fixes sdhci_ni_byt_sdio = {
>>>> static const struct sdhci_pci_fixes sdhci_intel_byt_sdio = {
>>>> .quirks = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
>>>> .quirks2 = SDHCI_QUIRK2_HOST_OFF_CARD_ON |
>>>> + SDHCI_QUIRK2_SDIO_IRQ_NO_RUNTIME_PM |
>>>> SDHCI_QUIRK2_PRESET_VALUE_BROKEN,
>>>> .allow_runtime_pm = true,
>>>> .probe_slot = byt_sdio_probe_slot,
>>>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
>>>> index 6fdd7a7..59c5cad 100644
>>>> --- a/drivers/mmc/host/sdhci.c
>>>> +++ b/drivers/mmc/host/sdhci.c
>>>> @@ -1828,6 +1828,9 @@ static void sdhci_enable_sdio_irq(struct mmc_host *mmc, int enable)
>>>> struct sdhci_host *host = mmc_priv(mmc);
>>>> unsigned long flags;
>>>>
>>>> + if ((host->quirks2 & SDHCI_QUIRK2_SDIO_IRQ_NO_RUNTIME_PM) && enable)
>>>> + pm_runtime_get(host->mmc->parent);
>>>
>>> There are currently no sdhci variant for any SoC that implements
>>> wakeup support in runtime suspend for SDIO irqs. In other words, it
>>> seems all sdhci hosts suffers from the same problem.
>>
>> There might still be drivers that expect SDIO interrupts during
>> runtime suspend, considering this patch:
>>
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=be138554a7923658ded799b0e8794d9c1d08a6e5
>
> Right. Thanks for pointing it out.
>
> However I don't think that is how runtime PM should be deployed when
> it is used for controlling devices like sdhci. Let's change that once
> we have the common issue for sdhci and SDIO irqs resolved.
Yes, then perhaps we could accept the inverted quirk on the basis that it
will be removed.
Hans, as I wrote somewhere else, we can use pm_runtime_get_noresume() and
pm_runtime_put_noidle() since sdhci_enable_sdio_irq() must be called with
the host claimed and therefore runtime resumed.
next prev parent reply other threads:[~2017-03-22 12:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-15 16:31 [PATCH v2 1/2] mmc: sdhci-acpi: Sync quirks with sdhci_intel_byt_* from sdhci-pci-core.c Hans de Goede
2017-03-15 16:31 ` [PATCH v2 2/2] mmc: sdhci: intel: Disable runtime pm when the sdio_irq is enabled Hans de Goede
2017-03-21 10:00 ` Ulf Hansson
2017-03-21 12:34 ` Adrian Hunter
2017-03-21 13:30 ` Hans de Goede
2017-03-21 14:54 ` Ulf Hansson
2017-03-22 12:06 ` Adrian Hunter [this message]
2017-03-22 14:00 ` Ulf Hansson
2017-03-22 14:29 ` Adrian Hunter
2017-03-30 6:13 ` Dong Aisheng
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=2d388dd3-a024-0eea-dc07-c207be0a044c@intel.com \
--to=adrian.hunter@intel.com \
--cc=b29396@freescale.com \
--cc=hdegoede@redhat.com \
--cc=linux-mmc@vger.kernel.org \
--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