staging: brcm80211: remove fullmac module_param for watchdog
Use constant to replace global variable used for watchdog polling Reviewed-by: Roland Vossen <rvossen@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
ab8c7bf545
commit
823a937e36
@@ -375,7 +375,7 @@ void brcmf_sdio_unregister(void)
|
|||||||
void brcmf_sdio_wdtmr_enable(struct brcmf_sdio_dev *sdiodev, bool enable)
|
void brcmf_sdio_wdtmr_enable(struct brcmf_sdio_dev *sdiodev, bool enable)
|
||||||
{
|
{
|
||||||
if (enable)
|
if (enable)
|
||||||
brcmf_sdbrcm_wd_timer(sdiodev->bus, brcmf_watchdog_ms);
|
brcmf_sdbrcm_wd_timer(sdiodev->bus, BRCMF_WD_POLL_MS);
|
||||||
else
|
else
|
||||||
brcmf_sdbrcm_wd_timer(sdiodev->bus, 0);
|
brcmf_sdbrcm_wd_timer(sdiodev->bus, 0);
|
||||||
}
|
}
|
||||||
|
@@ -20,6 +20,9 @@
|
|||||||
/* Packet alignment for most efficient SDIO (can change based on platform) */
|
/* Packet alignment for most efficient SDIO (can change based on platform) */
|
||||||
#define BRCMF_SDALIGN (1 << 6)
|
#define BRCMF_SDALIGN (1 << 6)
|
||||||
|
|
||||||
|
/* watchdog polling interval in ms */
|
||||||
|
#define BRCMF_WD_POLL_MS 10
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Exported from brcmf bus module (brcmf_usb, brcmf_sdio)
|
* Exported from brcmf bus module (brcmf_usb, brcmf_sdio)
|
||||||
*/
|
*/
|
||||||
@@ -28,9 +31,6 @@
|
|||||||
extern uint brcmf_txbound;
|
extern uint brcmf_txbound;
|
||||||
extern uint brcmf_rxbound;
|
extern uint brcmf_rxbound;
|
||||||
|
|
||||||
/* Watchdog timer interval */
|
|
||||||
extern uint brcmf_watchdog_ms;
|
|
||||||
|
|
||||||
/* Indicate (dis)interest in finding dongles. */
|
/* Indicate (dis)interest in finding dongles. */
|
||||||
extern int brcmf_bus_register(void);
|
extern int brcmf_bus_register(void);
|
||||||
extern void brcmf_bus_unregister(void);
|
extern void brcmf_bus_unregister(void);
|
||||||
|
@@ -612,6 +612,7 @@ struct brcmf_bus {
|
|||||||
uint pollcnt; /* Count of active polls */
|
uint pollcnt; /* Count of active polls */
|
||||||
|
|
||||||
#ifdef BCMDBG
|
#ifdef BCMDBG
|
||||||
|
uint console_interval;
|
||||||
struct brcmf_console console; /* Console output polling support */
|
struct brcmf_console console; /* Console output polling support */
|
||||||
uint console_addr; /* Console address from shared struct */
|
uint console_addr; /* Console address from shared struct */
|
||||||
#endif /* BCMDBG */
|
#endif /* BCMDBG */
|
||||||
@@ -735,20 +736,10 @@ static int tx_packets[NUMPRIO];
|
|||||||
int brcmf_watchdog_prio = 97;
|
int brcmf_watchdog_prio = 97;
|
||||||
module_param(brcmf_watchdog_prio, int, 0);
|
module_param(brcmf_watchdog_prio, int, 0);
|
||||||
|
|
||||||
/* Watchdog interval */
|
|
||||||
uint brcmf_watchdog_ms = 10;
|
|
||||||
module_param(brcmf_watchdog_ms, uint, 0);
|
|
||||||
|
|
||||||
/* DPC thread priority, -1 to use tasklet */
|
/* DPC thread priority, -1 to use tasklet */
|
||||||
int brcmf_dpc_prio = 98;
|
int brcmf_dpc_prio = 98;
|
||||||
module_param(brcmf_dpc_prio, int, 0);
|
module_param(brcmf_dpc_prio, int, 0);
|
||||||
|
|
||||||
#ifdef BCMDBG
|
|
||||||
/* Console poll interval */
|
|
||||||
uint brcmf_console_ms;
|
|
||||||
module_param(brcmf_console_ms, uint, 0);
|
|
||||||
#endif /* BCMDBG */
|
|
||||||
|
|
||||||
/* Tx/Rx bounds */
|
/* Tx/Rx bounds */
|
||||||
uint brcmf_txbound;
|
uint brcmf_txbound;
|
||||||
uint brcmf_rxbound;
|
uint brcmf_rxbound;
|
||||||
@@ -1023,7 +1014,7 @@ static int brcmf_sdbrcm_clkctl(struct brcmf_bus *bus, uint target, bool pendok)
|
|||||||
/* Early exit if we're already there */
|
/* Early exit if we're already there */
|
||||||
if (bus->clkstate == target) {
|
if (bus->clkstate == target) {
|
||||||
if (target == CLK_AVAIL) {
|
if (target == CLK_AVAIL) {
|
||||||
brcmf_sdbrcm_wd_timer(bus, brcmf_watchdog_ms);
|
brcmf_sdbrcm_wd_timer(bus, BRCMF_WD_POLL_MS);
|
||||||
bus->activity = true;
|
bus->activity = true;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@@ -1036,7 +1027,7 @@ static int brcmf_sdbrcm_clkctl(struct brcmf_bus *bus, uint target, bool pendok)
|
|||||||
brcmf_sdbrcm_sdclk(bus, true);
|
brcmf_sdbrcm_sdclk(bus, true);
|
||||||
/* Now request HT Avail on the backplane */
|
/* Now request HT Avail on the backplane */
|
||||||
brcmf_sdbrcm_htclk(bus, true, pendok);
|
brcmf_sdbrcm_htclk(bus, true, pendok);
|
||||||
brcmf_sdbrcm_wd_timer(bus, brcmf_watchdog_ms);
|
brcmf_sdbrcm_wd_timer(bus, BRCMF_WD_POLL_MS);
|
||||||
bus->activity = true;
|
bus->activity = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -1049,7 +1040,7 @@ static int brcmf_sdbrcm_clkctl(struct brcmf_bus *bus, uint target, bool pendok)
|
|||||||
else
|
else
|
||||||
brcmf_dbg(ERROR, "request for %d -> %d\n",
|
brcmf_dbg(ERROR, "request for %d -> %d\n",
|
||||||
bus->clkstate, target);
|
bus->clkstate, target);
|
||||||
brcmf_sdbrcm_wd_timer(bus, brcmf_watchdog_ms);
|
brcmf_sdbrcm_wd_timer(bus, BRCMF_WD_POLL_MS);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CLK_NONE:
|
case CLK_NONE:
|
||||||
@@ -4038,7 +4029,7 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *drvr, bool enforce_mutex)
|
|||||||
|
|
||||||
/* Start the watchdog timer */
|
/* Start the watchdog timer */
|
||||||
bus->drvr->tickcnt = 0;
|
bus->drvr->tickcnt = 0;
|
||||||
brcmf_sdbrcm_wd_timer(bus, brcmf_watchdog_ms);
|
brcmf_sdbrcm_wd_timer(bus, BRCMF_WD_POLL_MS);
|
||||||
|
|
||||||
if (enforce_mutex)
|
if (enforce_mutex)
|
||||||
brcmf_sdbrcm_sdlock(bus);
|
brcmf_sdbrcm_sdlock(bus);
|
||||||
@@ -4207,15 +4198,15 @@ static bool brcmf_sdbrcm_bus_watchdog(struct brcmf_pub *drvr)
|
|||||||
}
|
}
|
||||||
#ifdef BCMDBG
|
#ifdef BCMDBG
|
||||||
/* Poll for console output periodically */
|
/* Poll for console output periodically */
|
||||||
if (drvr->busstate == BRCMF_BUS_DATA && brcmf_console_ms != 0) {
|
if (drvr->busstate == BRCMF_BUS_DATA && bus->console_interval != 0) {
|
||||||
bus->console.count += brcmf_watchdog_ms;
|
bus->console.count += BRCMF_WD_POLL_MS;
|
||||||
if (bus->console.count >= brcmf_console_ms) {
|
if (bus->console.count >= bus->console_interval) {
|
||||||
bus->console.count -= brcmf_console_ms;
|
bus->console.count -= bus->console_interval;
|
||||||
/* Make sure backplane clock is on */
|
/* Make sure backplane clock is on */
|
||||||
brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
|
brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
|
||||||
if (brcmf_sdbrcm_readconsole(bus) < 0)
|
if (brcmf_sdbrcm_readconsole(bus) < 0)
|
||||||
brcmf_console_ms = 0; /* On error,
|
/* stop on error */
|
||||||
stop trying */
|
bus->console_interval = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* BCMDBG */
|
#endif /* BCMDBG */
|
||||||
@@ -4226,7 +4217,7 @@ static bool brcmf_sdbrcm_bus_watchdog(struct brcmf_pub *drvr)
|
|||||||
bus->idlecount = 0;
|
bus->idlecount = 0;
|
||||||
if (bus->activity) {
|
if (bus->activity) {
|
||||||
bus->activity = false;
|
bus->activity = false;
|
||||||
brcmf_sdbrcm_wd_timer(bus, brcmf_watchdog_ms);
|
brcmf_sdbrcm_wd_timer(bus, BRCMF_WD_POLL_MS);
|
||||||
} else {
|
} else {
|
||||||
brcmf_sdbrcm_clkctl(bus, CLK_NONE, false);
|
brcmf_sdbrcm_clkctl(bus, CLK_NONE, false);
|
||||||
}
|
}
|
||||||
@@ -4723,7 +4714,7 @@ brcmf_sdbrcm_watchdog(unsigned long data)
|
|||||||
|
|
||||||
/* Reschedule the watchdog */
|
/* Reschedule the watchdog */
|
||||||
if (bus->wd_timer_valid)
|
if (bus->wd_timer_valid)
|
||||||
mod_timer(&bus->timer, jiffies + brcmf_watchdog_ms * HZ / 1000);
|
mod_timer(&bus->timer, jiffies + BRCMF_WD_POLL_MS * HZ / 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -5017,7 +5008,7 @@ int brcmf_bus_devreset(struct brcmf_pub *drvr, u8 flag)
|
|||||||
brcmf_dbg(ERROR, "Set DEVRESET=false invoked when device is on\n");
|
brcmf_dbg(ERROR, "Set DEVRESET=false invoked when device is on\n");
|
||||||
bcmerror = -EIO;
|
bcmerror = -EIO;
|
||||||
}
|
}
|
||||||
brcmf_sdbrcm_wd_timer(bus, brcmf_watchdog_ms);
|
brcmf_sdbrcm_wd_timer(bus, BRCMF_WD_POLL_MS);
|
||||||
}
|
}
|
||||||
return bcmerror;
|
return bcmerror;
|
||||||
}
|
}
|
||||||
@@ -5038,9 +5029,7 @@ brcmf_sdbrcm_wd_timer(struct brcmf_bus *bus, uint wdtick)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (wdtick) {
|
if (wdtick) {
|
||||||
brcmf_watchdog_ms = (uint) wdtick;
|
if (bus->save_ms != BRCMF_WD_POLL_MS) {
|
||||||
|
|
||||||
if (bus->save_ms != brcmf_watchdog_ms) {
|
|
||||||
if (bus->wd_timer_valid == true)
|
if (bus->wd_timer_valid == true)
|
||||||
/* Stop timer and restart at new value */
|
/* Stop timer and restart at new value */
|
||||||
del_timer_sync(&bus->timer);
|
del_timer_sync(&bus->timer);
|
||||||
@@ -5049,13 +5038,13 @@ brcmf_sdbrcm_wd_timer(struct brcmf_bus *bus, uint wdtick)
|
|||||||
dynamically changed or in the first instance
|
dynamically changed or in the first instance
|
||||||
*/
|
*/
|
||||||
bus->timer.expires =
|
bus->timer.expires =
|
||||||
jiffies + brcmf_watchdog_ms * HZ / 1000;
|
jiffies + BRCMF_WD_POLL_MS * HZ / 1000;
|
||||||
add_timer(&bus->timer);
|
add_timer(&bus->timer);
|
||||||
|
|
||||||
} 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 + brcmf_watchdog_ms * HZ / 1000);
|
jiffies + BRCMF_WD_POLL_MS * HZ / 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
bus->wd_timer_valid = true;
|
bus->wd_timer_valid = true;
|
||||||
|
Reference in New Issue
Block a user