From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kalle Valo Date: Fri, 14 Jun 2013 15:23:14 +0300 Subject: [ath9k-devel] [PATCH v2 08/10] ath10k: defer hw setup to start/stop mac80211 hooks In-Reply-To: <1371041642-20273-9-git-send-email-michal.kazior@tieto.com> (Michal Kazior's message of "Wed, 12 Jun 2013 14:54:00 +0200") References: <1371041642-20273-1-git-send-email-michal.kazior@tieto.com> <1371041642-20273-9-git-send-email-michal.kazior@tieto.com> Message-ID: <87bo78naod.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: > This fixes suspend-to-disk. The hardware is now > re-initialized upon freeze/thaw properly. > > This also makes suspend/resume re-initialize the > hardware as WoWLAN support is not done yet. > > With some little work it should be possible to > support hw reconfiguration for hw/fw recovery. > > HW must be initialized once before registering to > mac80211 because FW determinates what hw > capabilities can be advertised. > > Signed-off-by: Michal Kazior [...] > static int ath10k_start(struct ieee80211_hw *hw) > { > struct ath10k *ar = hw->priv; > - int ret; > + int ret = 0; > > mutex_lock(&ar->conf_mutex); > > + if (ar->state != ATH10K_STATE_OFF) { > + /* This can be called in case if resume fails or > + * ieee80211_hw_restart() was issued */ > + ath10k_info("hw reconfiguration started\n"); > + ath10k_halt(ar); > + ar->state = ATH10K_STATE_RESTARTING; > + } else { > + ar->state = ATH10K_STATE_ON; > + } This part still worries me, especially that mac80211 calls ath10k_start() when state != OFF. To me it looks like that ath10k is not cleaning up it's somewhere else (in resume path?), or mac80211 is buggy/strange. Also I didn't fully get when state changes from RESTARTING to ON. Can you describe that, please? -- Kalle Valo