Skip to contentSkip to conversation

Clean up scan when start fails?

PATCH Ben Greear 2 participants 3 messages Jan 5, 2015 – Jan 7, 2015 Qualcomm Atheros ATH10K wireless driver

lore
Share & tools
lore

Ben Greear

author
#0 lore raw

Should we have something like this to clean up the scan state machine when firmware fails to start the scan?

[greearb@ben-dt2 linux-3.19.dev.y]$ git diff

drivers/net/wireless/ath/ath10k/wmi.c +1 -0
index 6e4ece0..9020204 100644
@@ -1057,6 +1057,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_completed(ar);
                break;
        case WMI_SCAN_EVENT_DEQUEUED:
        case WMI_SCAN_EVENT_PREEMPTED:

[greearb@ben-dt2 linux-3.19.dev.y]$

Thanks,
Ben

Signature · 8 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com


_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
#1 lore raw
Quoted 9 lines · Ben Greear

Should we have something like this to clean up the scan state machine when firmware fails to start the scan?

[greearb@ben-dt2 linux-3.19.dev.y]$ git diff

drivers/net/wireless/ath/ath10k/wmi.c +0 -0
index 6e4ece0..9020204 100644

drivers/net/wireless/ath/ath10k/wmi.c static int ath10k_wmi_event_scan(struct ath10k *ar, struct sk_buff *skb) · line 1063

Quoted 7 lines
drivers/net/wireless/ath/ath10k/wmi.c +1 -0
@@ -1057,6 +1057,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_completed(ar);
                break;
        case WMI_SCAN_EVENT_DEQUEUED:
        case WMI_SCAN_EVENT_PREEMPTED:

Hmm.. I assume you still get the _START_FAILED sometimes?

In what state do you get it?

If you get it before _STARTED you'll hit a warning in scan_completed(). It doesn't make sense to call it since all scan users will fail to wait for ar->scan.started completion and clean up anyway.

If you get it after _STARTED then I guess it does sense to clean up.

Michał

_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k

author
#2 lore raw
Quoted 20 lines · Michal Kazior
Quoted 9 lines · Ben Greear

Should we have something like this to clean up the scan state machine when firmware fails to start the scan?

[greearb@ben-dt2 linux-3.19.dev.y]$ git diff

drivers/net/wireless/ath/ath10k/wmi.c +0 -0
index 6e4ece0..9020204 100644

drivers/net/wireless/ath/ath10k/wmi.c static int ath10k_wmi_event_scan(struct ath10k *ar, struct sk_buff *skb) · line 1063

Quoted 7 lines
drivers/net/wireless/ath/ath10k/wmi.c +1 -0
@@ -1057,6 +1057,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_completed(ar);
                 break;
         case WMI_SCAN_EVENT_DEQUEUED:
         case WMI_SCAN_EVENT_PREEMPTED:

Hmm.. I assume you still get the _START_FAILED sometimes?

Quoted 8 lines

In what state do you get it?

If you get it before _STARTED you'll hit a warning in scan_completed(). It doesn't make sense to call it since all scan users will fail to wait for ar->scan.started completion and clean up anyway.

If you get it after _STARTED then I guess it does sense to clean up.

I have a better version of this patch that I am testing.

I can get the scan-start-failed even in CT firmware when a vdev fails to properly start due to firmware resource exhaustion, and then the driver asks it to scan.

At least in 10.1.467 firmware, the upstream firmware will just panic when the vdev cannot start in this case, so I am not sure how to reproduce the event in upstream firmware. Since the event exists, I do think it should be properly handled in the driver, however.

Thanks,
Ben

Quoted 4 lines

Michał

Signature · 7 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com

_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k