1 From: Arend van Spriel <arend@broadcom.com>
2 Date: Wed, 11 Mar 2015 16:11:33 +0100
3 Subject: [PATCH] brcmfmac: fix watchdog timer regression
5 The watchdog timer is used to put the device in a low-power mode when
6 it is idle for some time. This timer is stopped during that mode and
7 should be restarted upon activity. This has been broken by commit
8 d4150fced0365 ("brcmfmac: Simplify watchdog sleep."). This patch
9 restores the behaviour as it was before that commit.
11 Reported-by: Pontus Fuchs <pontusf@broadcom.com>
12 Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
13 Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
14 Signed-off-by: Arend van Spriel <arend@broadcom.com>
15 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
18 --- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c
19 +++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c
20 @@ -972,7 +972,6 @@ static int brcmf_sdio_clkctl(struct brcm
21 brcmf_sdio_sdclk(bus, true);
22 /* Now request HT Avail on the backplane */
23 brcmf_sdio_htclk(bus, true, pendok);
24 - brcmf_sdio_wd_timer(bus, BRCMF_WD_POLL_MS);
28 @@ -984,7 +983,6 @@ static int brcmf_sdio_clkctl(struct brcm
30 brcmf_err("request for %d -> %d\n",
31 bus->clkstate, target);
32 - brcmf_sdio_wd_timer(bus, BRCMF_WD_POLL_MS);
36 @@ -993,7 +991,6 @@ static int brcmf_sdio_clkctl(struct brcm
37 brcmf_sdio_htclk(bus, false, false);
38 /* Now remove the SD clock */
39 brcmf_sdio_sdclk(bus, false);
40 - brcmf_sdio_wd_timer(bus, 0);
44 @@ -1048,6 +1045,7 @@ end:
45 brcmf_sdio_clkctl(bus, CLK_NONE, pendok);
47 brcmf_sdio_clkctl(bus, CLK_AVAIL, pendok);
48 + brcmf_sdio_wd_timer(bus, BRCMF_WD_POLL_MS);
50 bus->sleeping = sleep;
51 brcmf_dbg(SDIO, "new state %s\n",
52 @@ -4242,6 +4240,7 @@ void brcmf_sdio_remove(struct brcmf_sdio
54 if (bus->sdiodev->state != BRCMF_SDIOD_NOMEDIUM) {
55 sdio_claim_host(bus->sdiodev->func[1]);
56 + brcmf_sdio_wd_timer(bus, 0);
57 brcmf_sdio_clkctl(bus, CLK_AVAIL, false);
58 /* Leave the device in state where it is
59 * 'passive'. This is done by resetting all