Skip to contentSkip to conversation

ath10k: scan fixes

PATCH New Michal Kazior 2 participants 4 messages Apr 22, 2013 – Apr 23, 2013 Qualcomm Atheros ATH10K wireless driver

lore
Share & tools
lore
#0 lore raw

cover ath10k: scan fixes

This is a result of a patch split.

Michal Kazior (2):
ath10k: sync wmi before starting scan timeout
ath10k: refactor scan locking

 drivers/net/wireless/ath/ath10k/core.c |    1 -
 drivers/net/wireless/ath/ath10k/core.h |    1 -
 drivers/net/wireless/ath/ath10k/mac.c  |   56 +++++++++++++++-----------------
 drivers/net/wireless/ath/ath10k/wmi.c  |   10 +++---
 4 files changed, 33 insertions(+), 35 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/2 ath10k: sync wmi before starting scan timeout

We may have some WMI commands pending. We
shouldn't start the timeout before we're sure we
have submitted the scan stop command.

---
 drivers/net/wireless/ath/ath10k/mac.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/net/wireless/ath/ath10k/mac.c +2 -0
index 0f8869d..4589f6f 100644
@@ -1418,6 +1418,8 @@ static void ath10k_abort_scan(struct ath10k *ar)
 	if (ret)
 		ath10k_warn("%s: ath10k_wmi_stop_scan failed (%d)\n", __func__, ret);
 
+	ath10k_wmi_flush_tx(ar);
+
 	ret = wait_for_completion_timeout(&ar->scan.completed, 3*HZ);
 	if (ret == 0)
 		ret = -ETIMEDOUT;
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 2/2 ath10k: refactor scan locking

In reply to Michal Kazior

Since we have data_lock it is no longer necessary
to have scan.lock.

---
 drivers/net/wireless/ath/ath10k/core.c |    1 -
 drivers/net/wireless/ath/ath10k/core.h |    1 -
 drivers/net/wireless/ath/ath10k/mac.c  |   54 +++++++++++++++-----------------
 drivers/net/wireless/ath/ath10k/wmi.c  |   10 +++---
 4 files changed, 31 insertions(+), 35 deletions(-)
drivers/net/wireless/ath/ath10k/core.c +0 -1
index 7036695..c9068b0 100644
@@ -482,7 +482,6 @@ struct ath10k *ath10k_core_create(void *hif_priv, struct device *dev,
 
 	init_completion(&ar->scan.started);
 	init_completion(&ar->scan.completed);
-	spin_lock_init(&ar->scan.lock);
 
 	init_completion(&ar->install_key_done);
 	init_completion(&ar->vdev_setup_done);
drivers/net/wireless/ath/ath10k/core.h +0 -1
index 4e19264..65b1d58 100644
@@ -309,7 +309,6 @@ struct ath10k {
 	} hw_params;
 
 	struct {
-		spinlock_t lock;
 		struct completion started;
 		struct completion completed;
 		struct timer_list timeout;
drivers/net/wireless/ath/ath10k/mac.c +25 -29

157 lines not on this page · raw message

drivers/net/wireless/ath/ath10k/wmi.c +6 -4
index fa521b0..ebb212e 100644
@@ -149,10 +149,12 @@ static int ath10k_wmi_event_scan(struct ath10k *ar, struct sk_buff *skb)
 	case WMI_SCAN_EVENT_STARTED:
 		ath10k_dbg(ATH10K_DBG_WMI, "SCAN_EVENT_STARTED\n");
 
-		if (ar->scan.is_roc)
+		spin_lock_bh(&ar->data_lock);
+		if (ar->scan.in_progress && ar->scan.is_roc)
 			ieee80211_ready_on_channel(ar->hw);
 
 		complete(&ar->scan.started);
+		spin_unlock_bh(&ar->data_lock);
 		break;
 	case WMI_SCAN_EVENT_COMPLETED:
 		ath10k_dbg(ATH10K_DBG_WMI, "SCAN_EVENT_COMPLETED\n");
@@ -175,10 +177,10 @@ static int ath10k_wmi_event_scan(struct ath10k *ar, struct sk_buff *skb)
 
 		rcu_assign_pointer(ar->scan_channel, NULL);
 
-		spin_lock_bh(&ar->scan.lock);
+		spin_lock_bh(&ar->data_lock);
 		if (!ar->scan.in_progress) {
+			spin_unlock_bh(&ar->data_lock);
 			ath10k_warn("no scan requested, ignoring\n");
-			spin_unlock_bh(&ar->scan.lock);
 			break;
 		}
 
@@ -194,7 +196,7 @@ static int ath10k_wmi_event_scan(struct ath10k *ar, struct sk_buff *skb)
 		del_timer(&ar->scan.timeout);
 		complete_all(&ar->scan.completed);
 		ar->scan.in_progress = false;
-		spin_unlock_bh(&ar->scan.lock);
+		spin_unlock_bh(&ar->data_lock);
 		break;
 	case WMI_SCAN_EVENT_BSS_CHANNEL:
 		ath10k_dbg(ATH10K_DBG_WMI, "SCAN_EVENT_BSS_CHANNEL\n");
Signature · 1 line
1.7.9.5
#3 lore raw

cover ath10k: scan fixes

In reply to Michal Kazior
Quoted 5 lines · Michal Kazior

This is a result of a patch split.

Michal Kazior (2):
ath10k: sync wmi before starting scan timeout
ath10k: refactor scan locking

Thanks, both patches applied.

Signature · 1 line
Kalle Valo