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

brcmfmac: change brcmf_sdio_wd_timer() prototype

The function brcmf_sdio_wd_timer() has wdtick parameter. However, it
is only called with two values and as such the parameter is replaced
with boolean value indicating the timer should be active or not.
Reviewed-by: default avatarHante Meuleman <meuleman@broadcom.com>
Reviewed-by: default avatarFranky (Zhenhui) Lin <frankyl@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 5419f7f1
...@@ -503,8 +503,7 @@ struct brcmf_sdio { ...@@ -503,8 +503,7 @@ struct brcmf_sdio {
struct timer_list timer; struct timer_list timer;
struct completion watchdog_wait; struct completion watchdog_wait;
struct task_struct *watchdog_tsk; struct task_struct *watchdog_tsk;
bool wd_timer_valid; bool wd_active;
uint save_ms;
struct workqueue_struct *brcmf_wq; struct workqueue_struct *brcmf_wq;
struct work_struct datawork; struct work_struct datawork;
...@@ -961,7 +960,7 @@ brcmf_sdio_bus_sleep(struct brcmf_sdio *bus, bool sleep, bool pendok) ...@@ -961,7 +960,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); brcmf_sdio_wd_timer(bus, true);
} }
bus->sleeping = sleep; bus->sleeping = sleep;
brcmf_dbg(SDIO, "new state %s\n", brcmf_dbg(SDIO, "new state %s\n",
...@@ -3576,7 +3575,7 @@ static void brcmf_sdio_bus_watchdog(struct brcmf_sdio *bus) ...@@ -3576,7 +3575,7 @@ static void brcmf_sdio_bus_watchdog(struct brcmf_sdio *bus)
if (bus->idlecount > bus->idletime) { if (bus->idlecount > bus->idletime) {
brcmf_dbg(SDIO, "idle\n"); brcmf_dbg(SDIO, "idle\n");
sdio_claim_host(bus->sdiodev->func[1]); sdio_claim_host(bus->sdiodev->func[1]);
brcmf_sdio_wd_timer(bus, 0); brcmf_sdio_wd_timer(bus, false);
bus->idlecount = 0; bus->idlecount = 0;
brcmf_sdio_bus_sleep(bus, true, false); brcmf_sdio_bus_sleep(bus, true, false);
sdio_release_host(bus->sdiodev->func[1]); sdio_release_host(bus->sdiodev->func[1]);
...@@ -3908,7 +3907,7 @@ brcmf_sdio_watchdog(unsigned long data) ...@@ -3908,7 +3907,7 @@ brcmf_sdio_watchdog(unsigned long data)
if (bus->watchdog_tsk) { if (bus->watchdog_tsk) {
complete(&bus->watchdog_wait); complete(&bus->watchdog_wait);
/* Reschedule the watchdog */ /* Reschedule the watchdog */
if (bus->wd_timer_valid) if (bus->wd_active)
mod_timer(&bus->timer, mod_timer(&bus->timer,
jiffies + msecs_to_jiffies(BRCMF_WD_POLL_MS)); jiffies + msecs_to_jiffies(BRCMF_WD_POLL_MS));
} }
...@@ -3950,7 +3949,7 @@ static void brcmf_sdio_firmware_callback(struct device *dev, ...@@ -3950,7 +3949,7 @@ static void brcmf_sdio_firmware_callback(struct device *dev,
/* Start the watchdog timer */ /* Start the watchdog timer */
bus->sdcnt.tickcnt = 0; bus->sdcnt.tickcnt = 0;
brcmf_sdio_wd_timer(bus, BRCMF_WD_POLL_MS); brcmf_sdio_wd_timer(bus, true);
sdio_claim_host(sdiodev->func[1]); sdio_claim_host(sdiodev->func[1]);
...@@ -4195,7 +4194,7 @@ void brcmf_sdio_remove(struct brcmf_sdio *bus) ...@@ -4195,7 +4194,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_wd_timer(bus, false);
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
...@@ -4217,13 +4216,12 @@ void brcmf_sdio_remove(struct brcmf_sdio *bus) ...@@ -4217,13 +4216,12 @@ void brcmf_sdio_remove(struct brcmf_sdio *bus)
brcmf_dbg(TRACE, "Disconnected\n"); brcmf_dbg(TRACE, "Disconnected\n");
} }
void brcmf_sdio_wd_timer(struct brcmf_sdio *bus, uint wdtick) void brcmf_sdio_wd_timer(struct brcmf_sdio *bus, bool active)
{ {
/* Totally stop the timer */ /* Totally stop the timer */
if (!wdtick && bus->wd_timer_valid) { if (!active && bus->wd_active) {
del_timer_sync(&bus->timer); del_timer_sync(&bus->timer);
bus->wd_timer_valid = false; bus->wd_active = false;
bus->save_ms = wdtick;
return; return;
} }
...@@ -4231,27 +4229,20 @@ void brcmf_sdio_wd_timer(struct brcmf_sdio *bus, uint wdtick) ...@@ -4231,27 +4229,20 @@ void brcmf_sdio_wd_timer(struct brcmf_sdio *bus, uint wdtick)
if (bus->sdiodev->state != BRCMF_SDIOD_DATA) if (bus->sdiodev->state != BRCMF_SDIOD_DATA)
return; return;
if (wdtick) { if (active) {
if (bus->save_ms != BRCMF_WD_POLL_MS) { if (!bus->wd_active) {
if (bus->wd_timer_valid)
/* Stop timer and restart at new value */
del_timer_sync(&bus->timer);
/* Create timer again when watchdog period is /* Create timer again when watchdog period is
dynamically changed or in the first instance dynamically changed or in the first instance
*/ */
bus->timer.expires = bus->timer.expires =
jiffies + msecs_to_jiffies(BRCMF_WD_POLL_MS); jiffies + msecs_to_jiffies(BRCMF_WD_POLL_MS);
add_timer(&bus->timer); add_timer(&bus->timer);
bus->wd_active = true;
} else { } else {
/* Re arm the timer, at last watchdog period */ /* Re arm the timer, at last watchdog period */
mod_timer(&bus->timer, mod_timer(&bus->timer,
jiffies + msecs_to_jiffies(BRCMF_WD_POLL_MS)); jiffies + msecs_to_jiffies(BRCMF_WD_POLL_MS));
} }
bus->wd_timer_valid = true;
bus->save_ms = wdtick;
} }
} }
......
...@@ -369,7 +369,7 @@ struct brcmf_sdio *brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev); ...@@ -369,7 +369,7 @@ struct brcmf_sdio *brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev);
void brcmf_sdio_remove(struct brcmf_sdio *bus); void brcmf_sdio_remove(struct brcmf_sdio *bus);
void brcmf_sdio_isr(struct brcmf_sdio *bus); void brcmf_sdio_isr(struct brcmf_sdio *bus);
void brcmf_sdio_wd_timer(struct brcmf_sdio *bus, uint wdtick); void brcmf_sdio_wd_timer(struct brcmf_sdio *bus, bool active);
void brcmf_sdio_wowl_config(struct device *dev, bool enabled); void brcmf_sdio_wowl_config(struct device *dev, bool enabled);
int brcmf_sdio_sleep(struct brcmf_sdio *bus, bool sleep); int brcmf_sdio_sleep(struct brcmf_sdio *bus, bool sleep);
void brcmf_sdio_trigger_dpc(struct brcmf_sdio *bus); void brcmf_sdio_trigger_dpc(struct brcmf_sdio *bus);
......
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