From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Kazior Date: Tue, 11 Jun 2013 07:43:20 +0200 Subject: [ath9k-devel] [PATCH 09/10] ath10k: handle hw reconfiguration properly In-Reply-To: <874nd5uc4s.fsf@kamboji.qca.qualcomm.com> References: <1370514361-15858-1-git-send-email-michal.kazior@tieto.com> <1370514361-15858-10-git-send-email-michal.kazior@tieto.com> <874nd5uc4s.fsf@kamboji.qca.qualcomm.com> Message-ID: <51B6B8F8.90106@tieto.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ath9k-devel@lists.ath9k.org On 10/06/13 19:08, Kalle Valo wrote: > 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 resume fails mac80211 behaves as if ieee80211_restart_hw() is called, i.e. it calls start() hook and proceeds with ressurecting STAs, interfaces, keys. > 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. This is more or less what I've done but haven't uploaded yet (since I'm still doing some tweaks/fixes). Thanks for the review! -- Pozdrawiam / Best regards, Michal Kazior.