From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kalle Valo Date: Fri, 14 Jun 2013 15:32:05 +0300 Subject: [ath9k-devel] [PATCH 1/3] ath10k: implement device recovery In-Reply-To: <1371042604-1822-2-git-send-email-michal.kazior@tieto.com> (Michal Kazior's message of "Wed, 12 Jun 2013 15:10:02 +0200") References: <1371042604-1822-1-git-send-email-michal.kazior@tieto.com> <1371042604-1822-2-git-send-email-michal.kazior@tieto.com> Message-ID: <877ghwna9m.fsf@kamboji.qca.qualcomm.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ath9k-devel@lists.ath9k.org Michal Kazior writes: > Restart the hardware if FW crashes. > > If FW crashes during recovery we leave the > hardware in a "wedged" state to avoid recursive > recoveries. > > When in "wedged" state userspace may bring > interfaces down (to issue stop()) and then bring > one interface (to issue start()) to reload > hardware manually. > > Signed-off-by: Michal Kazior [...] > --- a/drivers/net/wireless/ath/ath10k/core.h > +++ b/drivers/net/wireless/ath/ath10k/core.h > @@ -250,6 +250,7 @@ struct ath10k_debug { > enum ath10k_state { > ATH10K_STATE_OFF = 0, > ATH10K_STATE_RESTARTING, > + ATH10K_STATE_WEDGED, > ATH10K_STATE_ON > }; It would be good to add small comment describing the new state, it might not be obvious from the name. [...] > --- a/drivers/net/wireless/ath/ath10k/mac.c > +++ b/drivers/net/wireless/ath/ath10k/mac.c > @@ -1806,6 +1806,7 @@ static void ath10k_stop(struct ieee80211_hw *hw) > mutex_unlock(&ar->conf_mutex); > > cancel_work_sync(&ar->offchan_tx_work); > + cancel_work_sync(&ar->restart_work); The logic for this struct work is a bit scattered. It's initialised in core.c, stopped in mac.c and pushed to queue from pci.c. To keep things simple it would be best if we can have all that code in core.c. Here's one idea: * rename current function to ath10k_core_restart_work() * create ath10k_core_restart() which just queues the work struct. * call cancel_work_sync() from a suitable function in core, do we have such a function? -- Kalle Valo