diff mbox

ath10k: protect driver from unsolicited htc ep0 events

Message ID 1426081031-15296-1-git-send-email-michal.kazior@tieto.com (mailing list archive)
State Not Applicable
Delegated to: Kalle Valo
Headers show

Commit Message

Michal Kazior March 11, 2015, 1:37 p.m. UTC
Some firmware revisions (tested with qca6174
rm2.0-00088) deliver unsolicited unknown (kind of
garbled) HTC ep0 event to host in some cases.

This issue was mainly observed with both qca988x
and qca6174 being installed on a single host
system. During driver probing if qca6174 booting
sequences were somehow deferred (e.g. by qca988x
implicitly making some resources busy presumably)
the unsolicited event would came around 1s after
ATH10K_HTC_MSG_READY_ID was delivered to host for
qca6174.

The unsolicited event would confuse driver and
cause HTT initialization (and subsequently
driver probing) to fail.

Make the ep0 event processing more robust. The
event will still be caught but instead will
only generate a warning now.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
 drivers/net/wireless/ath/ath10k/htc.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Kalle Valo March 19, 2015, 1:53 p.m. UTC | #1
Michal Kazior <michal.kazior@tieto.com> writes:

> Some firmware revisions (tested with qca6174
> rm2.0-00088) deliver unsolicited unknown (kind of
> garbled) HTC ep0 event to host in some cases.
>
> This issue was mainly observed with both qca988x
> and qca6174 being installed on a single host
> system. During driver probing if qca6174 booting
> sequences were somehow deferred (e.g. by qca988x
> implicitly making some resources busy presumably)
> the unsolicited event would came around 1s after
> ATH10K_HTC_MSG_READY_ID was delivered to host for
> qca6174.
>
> The unsolicited event would confuse driver and
> cause HTT initialization (and subsequently
> driver probing) to fail.
>
> Make the ep0 event processing more robust. The
> event will still be caught but instead will
> only generate a warning now.
>
> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>

Thanks, applied.
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath10k/htc.c b/drivers/net/wireless/ath/ath10k/htc.c
index 2fd9e18..d33d5c4 100644
--- a/drivers/net/wireless/ath/ath10k/htc.c
+++ b/drivers/net/wireless/ath/ath10k/htc.c
@@ -414,7 +414,8 @@  static int ath10k_htc_rx_completion_handler(struct ath10k *ar,
 		struct ath10k_htc_msg *msg = (struct ath10k_htc_msg *)skb->data;
 
 		switch (__le16_to_cpu(msg->hdr.message_id)) {
-		default:
+		case ATH10K_HTC_MSG_READY_ID:
+		case ATH10K_HTC_MSG_CONNECT_SERVICE_RESP_ID:
 			/* handle HTC control message */
 			if (completion_done(&htc->ctl_resp)) {
 				/*
@@ -438,6 +439,10 @@  static int ath10k_htc_rx_completion_handler(struct ath10k *ar,
 			break;
 		case ATH10K_HTC_MSG_SEND_SUSPEND_COMPLETE:
 			htc->htc_ops.target_send_suspend_complete(ar);
+			break;
+		default:
+			ath10k_warn(ar, "ignoring unsolicited htc ep0 event\n");
+			break;
 		}
 		goto out;
 	}