From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Kazior Date: Fri, 14 Jun 2013 14:43:43 +0200 Subject: [ath9k-devel] [PATCH v2 08/10] ath10k: defer hw setup to start/stop mac80211 hooks In-Reply-To: <87bo78naod.fsf@kamboji.qca.qualcomm.com> References: <1371041642-20273-1-git-send-email-michal.kazior@tieto.com> <1371041642-20273-9-git-send-email-michal.kazior@tieto.com> <87bo78naod.fsf@kamboji.qca.qualcomm.com> Message-ID: <51BB0FFF.6090608@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 14/06/13 14:23, Kalle Valo wrote: > Michal Kazior writes: > [...] > >> 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. Hmm, you're right. I'll move ath10k_halt() call to ath10k_core_restart() and ath10k_resume() separately. > Also I didn't fully get when state changes from RESTARTING to ON. Can > you describe that, please? When mac80211 calls restat_complete() we switch it to ON if it isn't WEDGED. WEDGED can be set in ath10k_core_restart() if ar->state is already RESTARTING to avoid recursive recovery. -- Pozdrawiam / Best regards, Michal Kazior.