From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kalle Valo Date: Mon, 10 Jun 2013 20:08:35 +0300 Subject: [ath9k-devel] [PATCH 09/10] ath10k: handle hw reconfiguration properly In-Reply-To: <1370514361-15858-10-git-send-email-michal.kazior@tieto.com> (Michal Kazior's message of "Thu, 6 Jun 2013 12:26:00 +0200") References: <1370514361-15858-1-git-send-email-michal.kazior@tieto.com> <1370514361-15858-10-git-send-email-michal.kazior@tieto.com> Message-ID: <874nd5uc4s.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: > If resume fails mac80211 calls start() hook > without any other notification to the driver. > > If that happens we must make sure we free up and > clean up our stuff. > > Signed-off-by: Michal Kazior > --- > drivers/net/wireless/ath/ath10k/mac.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c > index 06601f5..fee4082 100644 > --- a/drivers/net/wireless/ath/ath10k/mac.c > +++ b/drivers/net/wireless/ath/ath10k/mac.c > @@ -1694,11 +1694,20 @@ static void ath10k_tx(struct ieee80211_hw *hw, > /* > * Initialize various parameters with default vaules. > */ > +static void ath10k_stop(struct ieee80211_hw *hw); > + > static int ath10k_start(struct ieee80211_hw *hw) > { > struct ath10k *ar = hw->priv; > int ret; > > + if (ar->started) { > + /* This can be called in case if resume fails or > + * ieee80211_hw_restart() was issued */ > + ath10k_info("hw reconfiguration started\n"); > + ath10k_stop(hw); > + } This look suspicious to me. Can you describe in detail the failing resume case, please? If the idea is to initialise the hardware to a pristine state that we can boot the firmware, please refactor the code into it's own function. This just looks wrong. -- Kalle Valo