* [PATCH 1/8] ath10k: scan should handle scan-start-failed event properly.
@ 2015-01-12 19:29 greearb
2015-01-12 19:53 ` Ben Greear
0 siblings, 1 reply; 9+ messages in thread
From: greearb @ 2015-01-12 19:29 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Ben Greear
From: Ben Greear <greearb@candelatech.com>
In case firmware fails to start the scan, then complete
the start condition and clean up so that driver does not
block on timeout.
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
drivers/net/wireless/ath/ath10k/mac.c | 11 +++++++++++
drivers/net/wireless/ath/ath10k/wmi.c | 20 ++++++++++++++++++++
2 files changed, 31 insertions(+)
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 249107d..924879f 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -2375,6 +2375,17 @@ static int ath10k_start_scan(struct ath10k *ar,
return -ETIMEDOUT;
}
+ /* If we failed to start the scan, return error code at
+ * this point. This is probably due to some issue in the
+ * firmware, but no need to wedge the driver due to that...
+ */
+ spin_lock_bh(&ar->data_lock);
+ if (ar->scan.state == ATH10K_SCAN_IDLE) {
+ spin_unlock_bh(&ar->data_lock);
+ return -EINVAL;
+ }
+ spin_unlock_bh(&ar->data_lock);
+
/* Add a 200ms margin to account for event/command processing */
ieee80211_queue_delayed_work(ar->hw, &ar->scan.timeout,
msecs_to_jiffies(arg->max_scan_time+200));
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 6e4ece0..203bcb9 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -916,6 +916,25 @@ static void ath10k_wmi_event_scan_started(struct ath10k *ar)
}
}
+static void ath10k_wmi_event_scan_start_failed(struct ath10k *ar)
+{
+ lockdep_assert_held(&ar->data_lock);
+
+ switch (ar->scan.state) {
+ case ATH10K_SCAN_IDLE:
+ case ATH10K_SCAN_RUNNING:
+ case ATH10K_SCAN_ABORTING:
+ ath10k_warn(ar, "received scan start failed event in an invalid scan state: %s (%d)\n",
+ ath10k_scan_state_str(ar->scan.state),
+ ar->scan.state);
+ break;
+ case ATH10K_SCAN_STARTING:
+ complete(&ar->scan.started);
+ __ath10k_scan_finish(ar);
+ break;
+ }
+}
+
static void ath10k_wmi_event_scan_completed(struct ath10k *ar)
{
lockdep_assert_held(&ar->data_lock);
@@ -1057,6 +1076,7 @@ static int ath10k_wmi_event_scan(struct ath10k *ar, struct sk_buff *skb)
break;
case WMI_SCAN_EVENT_START_FAILED:
ath10k_warn(ar, "received scan start failure event\n");
+ ath10k_wmi_event_scan_start_failed(ar);
break;
case WMI_SCAN_EVENT_DEQUEUED:
case WMI_SCAN_EVENT_PREEMPTED:
--
1.7.11.7
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 1/8] ath10k: scan should handle scan-start-failed event properly.
@ 2015-01-12 19:41 greearb
0 siblings, 0 replies; 9+ messages in thread
From: greearb @ 2015-01-12 19:41 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Ben Greear
From: Ben Greear <greearb@candelatech.com>
In case firmware fails to start the scan, then complete
the start condition and clean up so that driver does not
block on timeout.
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
drivers/net/wireless/ath/ath10k/mac.c | 11 +++++++++++
drivers/net/wireless/ath/ath10k/wmi.c | 20 ++++++++++++++++++++
2 files changed, 31 insertions(+)
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 249107d..924879f 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -2375,6 +2375,17 @@ static int ath10k_start_scan(struct ath10k *ar,
return -ETIMEDOUT;
}
+ /* If we failed to start the scan, return error code at
+ * this point. This is probably due to some issue in the
+ * firmware, but no need to wedge the driver due to that...
+ */
+ spin_lock_bh(&ar->data_lock);
+ if (ar->scan.state == ATH10K_SCAN_IDLE) {
+ spin_unlock_bh(&ar->data_lock);
+ return -EINVAL;
+ }
+ spin_unlock_bh(&ar->data_lock);
+
/* Add a 200ms margin to account for event/command processing */
ieee80211_queue_delayed_work(ar->hw, &ar->scan.timeout,
msecs_to_jiffies(arg->max_scan_time+200));
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 6e4ece0..203bcb9 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -916,6 +916,25 @@ static void ath10k_wmi_event_scan_started(struct ath10k *ar)
}
}
+static void ath10k_wmi_event_scan_start_failed(struct ath10k *ar)
+{
+ lockdep_assert_held(&ar->data_lock);
+
+ switch (ar->scan.state) {
+ case ATH10K_SCAN_IDLE:
+ case ATH10K_SCAN_RUNNING:
+ case ATH10K_SCAN_ABORTING:
+ ath10k_warn(ar, "received scan start failed event in an invalid scan state: %s (%d)\n",
+ ath10k_scan_state_str(ar->scan.state),
+ ar->scan.state);
+ break;
+ case ATH10K_SCAN_STARTING:
+ complete(&ar->scan.started);
+ __ath10k_scan_finish(ar);
+ break;
+ }
+}
+
static void ath10k_wmi_event_scan_completed(struct ath10k *ar)
{
lockdep_assert_held(&ar->data_lock);
@@ -1057,6 +1076,7 @@ static int ath10k_wmi_event_scan(struct ath10k *ar, struct sk_buff *skb)
break;
case WMI_SCAN_EVENT_START_FAILED:
ath10k_warn(ar, "received scan start failure event\n");
+ ath10k_wmi_event_scan_start_failed(ar);
break;
case WMI_SCAN_EVENT_DEQUEUED:
case WMI_SCAN_EVENT_PREEMPTED:
--
1.7.11.7
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 1/8] ath10k: scan should handle scan-start-failed event properly.
@ 2015-01-12 18:32 greearb
2015-02-04 8:37 ` Kalle Valo
0 siblings, 1 reply; 9+ messages in thread
From: greearb @ 2015-01-12 18:32 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Ben Greear
From: Ben Greear <greearb@candelatech.com>
In case firmware fails to start the scan, then complete
the start condition and clean up so that driver does not
block on timeout.
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
drivers/net/wireless/ath/ath10k/mac.c | 11 +++++++++++
drivers/net/wireless/ath/ath10k/wmi.c | 20 ++++++++++++++++++++
2 files changed, 31 insertions(+)
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 249107d..924879f 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -2375,6 +2375,17 @@ static int ath10k_start_scan(struct ath10k *ar,
return -ETIMEDOUT;
}
+ /* If we failed to start the scan, return error code at
+ * this point. This is probably due to some issue in the
+ * firmware, but no need to wedge the driver due to that...
+ */
+ spin_lock_bh(&ar->data_lock);
+ if (ar->scan.state == ATH10K_SCAN_IDLE) {
+ spin_unlock_bh(&ar->data_lock);
+ return -EINVAL;
+ }
+ spin_unlock_bh(&ar->data_lock);
+
/* Add a 200ms margin to account for event/command processing */
ieee80211_queue_delayed_work(ar->hw, &ar->scan.timeout,
msecs_to_jiffies(arg->max_scan_time+200));
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 6e4ece0..203bcb9 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -916,6 +916,25 @@ static void ath10k_wmi_event_scan_started(struct ath10k *ar)
}
}
+static void ath10k_wmi_event_scan_start_failed(struct ath10k *ar)
+{
+ lockdep_assert_held(&ar->data_lock);
+
+ switch (ar->scan.state) {
+ case ATH10K_SCAN_IDLE:
+ case ATH10K_SCAN_RUNNING:
+ case ATH10K_SCAN_ABORTING:
+ ath10k_warn(ar, "received scan start failed event in an invalid scan state: %s (%d)\n",
+ ath10k_scan_state_str(ar->scan.state),
+ ar->scan.state);
+ break;
+ case ATH10K_SCAN_STARTING:
+ complete(&ar->scan.started);
+ __ath10k_scan_finish(ar);
+ break;
+ }
+}
+
static void ath10k_wmi_event_scan_completed(struct ath10k *ar)
{
lockdep_assert_held(&ar->data_lock);
@@ -1057,6 +1076,7 @@ static int ath10k_wmi_event_scan(struct ath10k *ar, struct sk_buff *skb)
break;
case WMI_SCAN_EVENT_START_FAILED:
ath10k_warn(ar, "received scan start failure event\n");
+ ath10k_wmi_event_scan_start_failed(ar);
break;
case WMI_SCAN_EVENT_DEQUEUED:
case WMI_SCAN_EVENT_PREEMPTED:
--
1.7.11.7
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH 1/8] ath10k: scan should handle scan-start-failed event properly.
2015-01-12 18:32 greearb
@ 2015-02-04 8:37 ` Kalle Valo
2015-02-04 15:31 ` Ben Greear
2015-02-15 15:03 ` Kalle Valo
0 siblings, 2 replies; 9+ messages in thread
From: Kalle Valo @ 2015-02-04 8:37 UTC (permalink / raw)
To: greearb; +Cc: ath10k, linux-wireless
greearb@candelatech.com writes:
> From: Ben Greear <greearb@candelatech.com>
>
> In case firmware fails to start the scan, then complete
> the start condition and clean up so that driver does not
> block on timeout.
>
> Signed-off-by: Ben Greear <greearb@candelatech.com>
These patches are now in the pending branch.
86f50c71b224 ath10k: scan should handle scan-start-failed event properly
c6dde373a4bb ath10k: fix spelling mistakes and add details to mac logging
198c0184d94c ath10k: fix spelling in htt code comment
227822d52d26 ath10k: fix CE_DESC_FLAGS_META_DATA_LSB definition
I dropped the rest as I really would like to avoid maintaining yet
another firmware branch.
--
Kalle Valo
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/8] ath10k: scan should handle scan-start-failed event properly.
2015-02-04 8:37 ` Kalle Valo
@ 2015-02-04 15:31 ` Ben Greear
2015-02-15 15:03 ` Kalle Valo
1 sibling, 0 replies; 9+ messages in thread
From: Ben Greear @ 2015-02-04 15:31 UTC (permalink / raw)
To: Kalle Valo; +Cc: ath10k, linux-wireless
On 02/04/2015 12:37 AM, Kalle Valo wrote:
> greearb@candelatech.com writes:
>
>> From: Ben Greear <greearb@candelatech.com>
>>
>> In case firmware fails to start the scan, then complete
>> the start condition and clean up so that driver does not
>> block on timeout.
>>
>> Signed-off-by: Ben Greear <greearb@candelatech.com>
>
> These patches are now in the pending branch.
>
> 86f50c71b224 ath10k: scan should handle scan-start-failed event properly
> c6dde373a4bb ath10k: fix spelling mistakes and add details to mac logging
> 198c0184d94c ath10k: fix spelling in htt code comment
> 227822d52d26 ath10k: fix CE_DESC_FLAGS_META_DATA_LSB definition
>
> I dropped the rest as I really would like to avoid maintaining yet
> another firmware branch.
Thanks for applying those.
I'll stop sending patches related to my firmware.
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/8] ath10k: scan should handle scan-start-failed event properly.
2015-02-04 8:37 ` Kalle Valo
2015-02-04 15:31 ` Ben Greear
@ 2015-02-15 15:03 ` Kalle Valo
1 sibling, 0 replies; 9+ messages in thread
From: Kalle Valo @ 2015-02-15 15:03 UTC (permalink / raw)
To: greearb; +Cc: linux-wireless, ath10k
Kalle Valo <kvalo@qca.qualcomm.com> writes:
> These patches are now in the pending branch.
>
> 86f50c71b224 ath10k: scan should handle scan-start-failed event properly
> c6dde373a4bb ath10k: fix spelling mistakes and add details to mac logging
> 198c0184d94c ath10k: fix spelling in htt code comment
> 227822d52d26 ath10k: fix CE_DESC_FLAGS_META_DATA_LSB definition
Thanks, applied to ath.git.
--
Kalle Valo
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2015-02-15 15:03 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-12 19:29 [PATCH 1/8] ath10k: scan should handle scan-start-failed event properly greearb
2015-01-12 19:53 ` Ben Greear
2015-01-13 13:42 ` Kalle Valo
2015-01-13 16:15 ` Ben Greear
-- strict thread matches above, loose matches on Subject: below --
2015-01-12 19:41 greearb
2015-01-12 18:32 greearb
2015-02-04 8:37 ` Kalle Valo
2015-02-04 15:31 ` Ben Greear
2015-02-15 15:03 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).