Skip to content

Commit

Permalink
net: wireless: bcm4329: Disable wake irq at driver stop
Browse files Browse the repository at this point in the history
Previously at driver stop interrupts were not disabled and
might cause never-ending waking up

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
  • Loading branch information
Dmitry Shmidt committed Mar 10, 2011
1 parent b7c5917 commit 6ce9cbe
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
14 changes: 14 additions & 0 deletions drivers/net/wireless/bcm4329/bcmsdh_linux.c
Expand Up @@ -643,6 +643,20 @@ int bcmsdh_register_oob_intr(void * dhdp)
return 0; return 0;
} }


void bcmsdh_set_irq(int flag)
{
if (sdhcinfo->oob_irq_registered) {
SDLX_MSG(("%s Flag = %d", __FUNCTION__, flag));
if (flag) {
enable_irq(sdhcinfo->oob_irq);
enable_irq_wake(sdhcinfo->oob_irq);
} else {
disable_irq_wake(sdhcinfo->oob_irq);
disable_irq(sdhcinfo->oob_irq);
}
}
}

void bcmsdh_unregister_oob_intr(void) void bcmsdh_unregister_oob_intr(void)
{ {
SDLX_MSG(("%s: Enter\n", __FUNCTION__)); SDLX_MSG(("%s: Enter\n", __FUNCTION__));
Expand Down
7 changes: 6 additions & 1 deletion drivers/net/wireless/bcm4329/dhd_sdio.c
Expand Up @@ -146,6 +146,8 @@
DHD_SPINWAIT_SLEEP_INIT(sdioh_spinwait_sleep); DHD_SPINWAIT_SLEEP_INIT(sdioh_spinwait_sleep);
extern int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len); extern int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len);


extern void bcmsdh_set_irq(int flag);

#ifdef DHD_DEBUG #ifdef DHD_DEBUG
/* Device console log buffer state */ /* Device console log buffer state */
typedef struct dhd_console { typedef struct dhd_console {
Expand Down Expand Up @@ -5809,7 +5811,9 @@ dhd_bus_devreset(dhd_pub_t *dhdp, uint8 flag)
/* Expect app to have torn down any connection before calling */ /* Expect app to have torn down any connection before calling */
/* Stop the bus, disable F2 */ /* Stop the bus, disable F2 */
dhd_bus_stop(bus, FALSE); dhd_bus_stop(bus, FALSE);

#if defined(OOB_INTR_ONLY)
bcmsdh_set_irq(FALSE);
#endif /* defined(OOB_INTR_ONLY) */
/* Clean tx/rx buffer pointers, detach from the dongle */ /* Clean tx/rx buffer pointers, detach from the dongle */
dhdsdio_release_dongle(bus, bus->dhd->osh, TRUE); dhdsdio_release_dongle(bus, bus->dhd->osh, TRUE);


Expand Down Expand Up @@ -5845,6 +5849,7 @@ dhd_bus_devreset(dhd_pub_t *dhdp, uint8 flag)
bcmerror = dhd_bus_init((dhd_pub_t *) bus->dhd, FALSE); bcmerror = dhd_bus_init((dhd_pub_t *) bus->dhd, FALSE);
if (bcmerror == BCME_OK) { if (bcmerror == BCME_OK) {
#if defined(OOB_INTR_ONLY) #if defined(OOB_INTR_ONLY)
bcmsdh_set_irq(TRUE);
dhd_enable_oob_intr(bus, TRUE); dhd_enable_oob_intr(bus, TRUE);
#endif /* defined(OOB_INTR_ONLY) */ #endif /* defined(OOB_INTR_ONLY) */
bus->dhd->dongle_reset = FALSE; bus->dhd->dongle_reset = FALSE;
Expand Down

0 comments on commit 6ce9cbe

Please sign in to comment.