diff options
author | Ni Wade <wni@nvidia.com> | 2012-08-27 10:25:10 +0000 |
---|---|---|
committer | John Weber <rjohnweber@gmail.com> | 2013-07-28 23:45:11 -0500 |
commit | c01ebb6ca08326a7d2309efc68329f4147c6d5e5 (patch) | |
tree | 3ecbc7237a027cfbee23902dd390a362c2cf2ea8 | |
parent | 29c8561c8d6d248f2b6726384815a136c2fbd859 (diff) | |
download | linux-c01ebb6ca08326a7d2309efc68329f4147c6d5e5.tar.gz |
brcmfmac: Handling the interrupt in ISR directly for non-OOB
In case of inband interrupts, if we handle the interrupt in dpc thread,
two level of thread switching takes place to process wifi interrupts.
One in SDHCI driver and the other in Wifi driver. This may cause the system
instability.
Because the SDHCI calls sdio_irq_thread() to handle the irq, this thread locks
mmc host and calls wifi handler. It expects WiFi handler to be quick and
enables sdio interrupt from card at end. If wifi handler defers this work for
a different thread, sdio_irq_thread() will be stuck on next wifi interrupt
since mmc lock is not freed.
Handling the interrupt in ISR directly will prevent thread context switching in
wifi driver. It can fix the instability problems.
Signed-off-by: Wei Ni <wni@nvidia.com>
(cherry picked from commit c782ec69711573ee082fa78b80dae3897269266e)
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c index e754960a0c72..a87f14184853 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c @@ -123,7 +123,9 @@ static void brcmf_sdio_irqhandler(struct sdio_func *func) brcmf_dbg(INTR, "ib intr triggered\n"); + sdio_release_host(sdiodev->func[1]); brcmf_sdbrcm_isr(sdiodev->bus); + sdio_claim_host(sdiodev->func[1]); } /* dummy handler for SDIO function 2 interrupt */ diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c index 36abea21976e..0d23b8d4abe8 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c @@ -2349,7 +2349,7 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_sdio *bus) uint framecnt = 0; /* Temporary counter of tx/rx frames */ bool rxdone = true; /* Flag for no more read data */ bool resched = false; /* Flag indicating resched wanted */ - int err; + int err = 0; brcmf_dbg(TRACE, "Enter\n"); @@ -3526,11 +3526,16 @@ void brcmf_sdbrcm_isr(void *arg) if (!bus->intr) brcmf_dbg(ERROR, "isr w/o interrupt configured!\n"); +#ifndef CONFIG_BRCMFMAC_SDIO_OOB + while (brcmf_sdbrcm_dpc(bus)) + ; +#else bus->dpc_sched = true; if (bus->dpc_tsk) { brcmf_sdbrcm_adddpctsk(bus); complete(&bus->dpc_wait); } +#endif } static bool brcmf_sdbrcm_bus_watchdog(struct brcmf_sdio *bus) |