diff options
author | Hans de Goede <hdegoede@redhat.com> | 2017-03-26 07:14:45 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-04-08 03:30:33 -0400 |
commit | fa3b4f4f574a6fd948da9377d94c3166030ee7dc (patch) | |
tree | 6d073388c74bc5a4259d89e672aebc149330b215 | |
parent | 8d6c33224261e426641df743250e85b1c6a80674 (diff) |
mmc: sdhci: Disable runtime pm when the sdio_irq is enabled
commit 923713b357455cfb9aca2cd3429cb0806a724ed2 upstream.
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>
Cc: Ian W MORRISON <ianwmorrison@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/mmc/host/sdhci.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index a983ba0349fb..7d275e72903a 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c | |||
@@ -1823,6 +1823,9 @@ static void sdhci_enable_sdio_irq(struct mmc_host *mmc, int enable) | |||
1823 | struct sdhci_host *host = mmc_priv(mmc); | 1823 | struct sdhci_host *host = mmc_priv(mmc); |
1824 | unsigned long flags; | 1824 | unsigned long flags; |
1825 | 1825 | ||
1826 | if (enable) | ||
1827 | pm_runtime_get_noresume(host->mmc->parent); | ||
1828 | |||
1826 | spin_lock_irqsave(&host->lock, flags); | 1829 | spin_lock_irqsave(&host->lock, flags); |
1827 | if (enable) | 1830 | if (enable) |
1828 | host->flags |= SDHCI_SDIO_IRQ_ENABLED; | 1831 | host->flags |= SDHCI_SDIO_IRQ_ENABLED; |
@@ -1831,6 +1834,9 @@ static void sdhci_enable_sdio_irq(struct mmc_host *mmc, int enable) | |||
1831 | 1834 | ||
1832 | sdhci_enable_sdio_irq_nolock(host, enable); | 1835 | sdhci_enable_sdio_irq_nolock(host, enable); |
1833 | spin_unlock_irqrestore(&host->lock, flags); | 1836 | spin_unlock_irqrestore(&host->lock, flags); |
1837 | |||
1838 | if (!enable) | ||
1839 | pm_runtime_put_noidle(host->mmc->parent); | ||
1834 | } | 1840 | } |
1835 | 1841 | ||
1836 | static int sdhci_start_signal_voltage_switch(struct mmc_host *mmc, | 1842 | static int sdhci_start_signal_voltage_switch(struct mmc_host *mmc, |