Commit cf45932a authored by Arend van Spriel's avatar Arend van Spriel Committed by Kalle Valo

brcmfmac: fix watchdog timer regression

The watchdog timer is used to put the device in a low-power mode when
it is idle for some time. This timer is stopped during that mode and
should be restarted upon activity. This has been broken by commit
d4150fced0365 ("brcmfmac: Simplify watchdog sleep."). This patch
restores the behaviour as it was before that commit.
Reported-by: default avatarPontus Fuchs <pontusf@broadcom.com>
Reviewed-by: default avatarHante Meuleman <meuleman@broadcom.com>
Reviewed-by: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 9819a902
...@@ -972,7 +972,6 @@ static int brcmf_sdio_clkctl(struct brcmf_sdio *bus, uint target, bool pendok) ...@@ -972,7 +972,6 @@ static int brcmf_sdio_clkctl(struct brcmf_sdio *bus, uint target, bool pendok)
brcmf_sdio_sdclk(bus, true); brcmf_sdio_sdclk(bus, true);
/* Now request HT Avail on the backplane */ /* Now request HT Avail on the backplane */
brcmf_sdio_htclk(bus, true, pendok); brcmf_sdio_htclk(bus, true, pendok);
brcmf_sdio_wd_timer(bus, BRCMF_WD_POLL_MS);
break; break;
case CLK_SDONLY: case CLK_SDONLY:
...@@ -984,7 +983,6 @@ static int brcmf_sdio_clkctl(struct brcmf_sdio *bus, uint target, bool pendok) ...@@ -984,7 +983,6 @@ static int brcmf_sdio_clkctl(struct brcmf_sdio *bus, uint target, bool pendok)
else else
brcmf_err("request for %d -> %d\n", brcmf_err("request for %d -> %d\n",
bus->clkstate, target); bus->clkstate, target);
brcmf_sdio_wd_timer(bus, BRCMF_WD_POLL_MS);
break; break;
case CLK_NONE: case CLK_NONE:
...@@ -993,7 +991,6 @@ static int brcmf_sdio_clkctl(struct brcmf_sdio *bus, uint target, bool pendok) ...@@ -993,7 +991,6 @@ static int brcmf_sdio_clkctl(struct brcmf_sdio *bus, uint target, bool pendok)
brcmf_sdio_htclk(bus, false, false); brcmf_sdio_htclk(bus, false, false);
/* Now remove the SD clock */ /* Now remove the SD clock */
brcmf_sdio_sdclk(bus, false); brcmf_sdio_sdclk(bus, false);
brcmf_sdio_wd_timer(bus, 0);
break; break;
} }
#ifdef DEBUG #ifdef DEBUG
...@@ -1048,6 +1045,7 @@ brcmf_sdio_bus_sleep(struct brcmf_sdio *bus, bool sleep, bool pendok) ...@@ -1048,6 +1045,7 @@ brcmf_sdio_bus_sleep(struct brcmf_sdio *bus, bool sleep, bool pendok)
brcmf_sdio_clkctl(bus, CLK_NONE, pendok); brcmf_sdio_clkctl(bus, CLK_NONE, pendok);
} else { } else {
brcmf_sdio_clkctl(bus, CLK_AVAIL, pendok); brcmf_sdio_clkctl(bus, CLK_AVAIL, pendok);
brcmf_sdio_wd_timer(bus, BRCMF_WD_POLL_MS);
} }
bus->sleeping = sleep; bus->sleeping = sleep;
brcmf_dbg(SDIO, "new state %s\n", brcmf_dbg(SDIO, "new state %s\n",
...@@ -4242,6 +4240,7 @@ void brcmf_sdio_remove(struct brcmf_sdio *bus) ...@@ -4242,6 +4240,7 @@ void brcmf_sdio_remove(struct brcmf_sdio *bus)
if (bus->ci) { if (bus->ci) {
if (bus->sdiodev->state != BRCMF_SDIOD_NOMEDIUM) { if (bus->sdiodev->state != BRCMF_SDIOD_NOMEDIUM) {
sdio_claim_host(bus->sdiodev->func[1]); sdio_claim_host(bus->sdiodev->func[1]);
brcmf_sdio_wd_timer(bus, 0);
brcmf_sdio_clkctl(bus, CLK_AVAIL, false); brcmf_sdio_clkctl(bus, CLK_AVAIL, false);
/* Leave the device in state where it is /* Leave the device in state where it is
* 'passive'. This is done by resetting all * 'passive'. This is done by resetting all
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment