summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDong Aisheng <aisheng.dong@nxp.com>2016-01-29 21:34:45 +0800
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:41:33 +0300
commit562ffa44977a0f64786f42855fa34df1ac11a523 (patch)
tree61673c1b2e0ca287f26a15ed40eafbf295d60e49
parent4f65e80a3fb22ba73152d350dcf573ea8ff1fe7c (diff)
MLK-12360-3 bcmdhd: fix bcmdhd blocks system suspend issue
When enable WIFi and connected with AP, the system is unable to suspend. root@imx6qdlsolo:~# echo standby > /sys/power/state PM: Syncing filesystems ... done. Freezing user space processes ... (elapsed 0.001 seconds) done. Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done. dhdsdio_isr: Enter dhdsdio_isr: Enter dhdsdio_isr: disable SDIO interrupts Calling dhdsdio_dpc() from dhdsdio_isr dhdsdio_dpc: Enter dhdsdio_bussleep: request WAKE (currently SLEEP) (Keypress still response here.... ) It's caused by Broadcom WiFi driver will keep handling SDIO irq even after the driver is already suspended. This weird behavior will block the MMC host suspend during its irq synchronize operation in free_irq(), then the system suspend is blocked too and hanged. Add SDHCI_QUIRK2_SDIO_IRQ_THREAD for BCM WiFi to use kernel thread to process sdio interrupts which won't block system suspend and process freeze operation. Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
-rw-r--r--Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt2
-rw-r--r--drivers/mmc/host/sdhci-esdhc-imx.c1
-rw-r--r--drivers/mmc/host/sdhci.c3
-rw-r--r--drivers/mmc/host/sdhci.h3
4 files changed, 7 insertions, 2 deletions
diff --git a/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt
index 04667b961c75..de3270b0aec0 100644
--- a/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt
+++ b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt
@@ -36,7 +36,7 @@ Optional properties:
cells which is useful for some special boards or cards when the default
tuning step can't find the proper delay window within limited tuning retries.
- wifi-host : assigned as a wifi host.
- This is required for some WiFi cards to do card detect
+ This is required for Broadcom BCM WiFi cards to do card detect
Examples:
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index c2e121c7a85f..8eb55e06b3a2 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -1129,6 +1129,7 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
if (of_get_property(np, "wifi-host", NULL)) {
wifi_mmc_host = host->mmc;
+ host->quirks2 |= SDHCI_QUIRK2_SDIO_IRQ_THREAD;
dev_info(mmc_dev(host->mmc), "assigned as wifi host\n");
}
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index f71406d7c934..2ddc2a47d852 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -3302,7 +3302,8 @@ int sdhci_setup_host(struct sdhci_host *host)
}
mmc->caps |= MMC_CAP_SDIO_IRQ | MMC_CAP_ERASE | MMC_CAP_CMD23;
- mmc->caps2 |= MMC_CAP2_SDIO_IRQ_NOTHREAD;
+ if (!(host->quirks2 & SDHCI_QUIRK2_SDIO_IRQ_THREAD))
+ mmc->caps2 |= MMC_CAP2_SDIO_IRQ_NOTHREAD;
if (host->quirks & SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12)
host->flags |= SDHCI_AUTO_CMD12;
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 2570455b219a..02e73394ca9e 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -425,6 +425,9 @@ struct sdhci_host {
#define SDHCI_QUIRK2_ACMD23_BROKEN (1<<14)
/* Broken Clock divider zero in controller */
#define SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN (1<<15)
+/* Host or Card can't support no thread sdio irq */
+#define SDHCI_QUIRK2_SDIO_IRQ_THREAD (1<<16)
+
int irq; /* Device IRQ */
void __iomem *ioaddr; /* Mapped address */