From 1a85c9af9e6b65e8595c342331d6e5c01c16890c Mon Sep 17 00:00:00 2001 From: Paul Stewart Date: Fri, 27 Jul 2012 16:14:46 -0700 Subject: [PATCH] CHROMIUM: ath9k: Do not divide by zero cycle counter cc_rxpoll.cycles can be zero under certain circumstances. Skip this round of rx hang detection when this happens. Signed-off-by: Paul Stewart BUG=chromium-os:32956 TEST=Reboot system. Still waiting to see this message. Change-Id: Id0a6d4b01137af4c36a27424615c30c52ed05fd8 Reviewed-on: https://gerrit.chromium.org/gerrit/28642 Reviewed-by: Simon Que Reviewed-by: Rajkumar Manoharan Reviewed-by: Darin Petkov Commit-Ready: Paul Stewart Tested-by: Paul Stewart --- drivers/net/wireless/ath/ath9k/main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 80662648f269..a48b25badb5e 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c @@ -728,6 +728,14 @@ void ath_rx_poll_work(unsigned long data) spin_lock_irqsave(&common->cc_lock, flags); ath_hw_cycle_counters_update(common); + if (common->cc_rxpoll.cycles == 0) { + spin_unlock_irqrestore(&common->cc_lock, flags); + ath_info(common, "rxpoll cycles is zero. Skipping."); + ath9k_ps_restore(sc); + ath_start_rx_poll(sc, nmsec); + return; + } + rx_clear = common->cc_rxpoll.rx_busy * 100 / common->cc_rxpoll.cycles; rx = common->cc_rxpoll.rx_frame * 100 / common->cc_rxpoll.cycles; tx = common->cc_rxpoll.tx_frame * 100 / common->cc_rxpoll.cycles; -- 2.20.1