Commit 833fd34d authored by Ben Greear's avatar Ben Greear Committed by Kalle Valo

ath10k: fix vdev-start timeout on error

The vdev-start-response message should cause the
completion to fire, even in the error case.  Otherwise,
the user still gets no useful information and everything
is blocked until the timeout period.

Add some warning text to print out the invalid status
code to aid debugging, and propagate failure code.
Signed-off-by: default avatarBen Greear <greearb@candelatech.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 37f62c0d
...@@ -1043,6 +1043,7 @@ struct ath10k { ...@@ -1043,6 +1043,7 @@ struct ath10k {
struct completion install_key_done; struct completion install_key_done;
int last_wmi_vdev_start_status;
struct completion vdev_setup_done; struct completion vdev_setup_done;
struct workqueue_struct *workqueue; struct workqueue_struct *workqueue;
......
...@@ -968,7 +968,7 @@ static inline int ath10k_vdev_setup_sync(struct ath10k *ar) ...@@ -968,7 +968,7 @@ static inline int ath10k_vdev_setup_sync(struct ath10k *ar)
if (time_left == 0) if (time_left == 0)
return -ETIMEDOUT; return -ETIMEDOUT;
return 0; return ar->last_wmi_vdev_start_status;
} }
static int ath10k_monitor_vdev_start(struct ath10k *ar, int vdev_id) static int ath10k_monitor_vdev_start(struct ath10k *ar, int vdev_id)
......
...@@ -3243,18 +3243,31 @@ void ath10k_wmi_event_vdev_start_resp(struct ath10k *ar, struct sk_buff *skb) ...@@ -3243,18 +3243,31 @@ void ath10k_wmi_event_vdev_start_resp(struct ath10k *ar, struct sk_buff *skb)
{ {
struct wmi_vdev_start_ev_arg arg = {}; struct wmi_vdev_start_ev_arg arg = {};
int ret; int ret;
u32 status;
ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_VDEV_START_RESP_EVENTID\n"); ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_VDEV_START_RESP_EVENTID\n");
ar->last_wmi_vdev_start_status = 0;
ret = ath10k_wmi_pull_vdev_start(ar, skb, &arg); ret = ath10k_wmi_pull_vdev_start(ar, skb, &arg);
if (ret) { if (ret) {
ath10k_warn(ar, "failed to parse vdev start event: %d\n", ret); ath10k_warn(ar, "failed to parse vdev start event: %d\n", ret);
return; ar->last_wmi_vdev_start_status = ret;
goto out;
} }
if (WARN_ON(__le32_to_cpu(arg.status))) status = __le32_to_cpu(arg.status);
return; if (WARN_ON_ONCE(status)) {
ath10k_warn(ar, "vdev-start-response reports status error: %d (%s)\n",
status, (status == WMI_VDEV_START_CHAN_INVALID) ?
"chan-invalid" : "unknown");
/* Setup is done one way or another though, so we should still
* do the completion, so don't return here.
*/
ar->last_wmi_vdev_start_status = -EINVAL;
}
out:
complete(&ar->vdev_setup_done); complete(&ar->vdev_setup_done);
} }
......
...@@ -6655,11 +6655,17 @@ struct wmi_ch_info_ev_arg { ...@@ -6655,11 +6655,17 @@ struct wmi_ch_info_ev_arg {
__le32 rx_frame_count; __le32 rx_frame_count;
}; };
/* From 10.4 firmware, not sure all have the same values. */
enum wmi_vdev_start_status {
WMI_VDEV_START_OK = 0,
WMI_VDEV_START_CHAN_INVALID,
};
struct wmi_vdev_start_ev_arg { struct wmi_vdev_start_ev_arg {
__le32 vdev_id; __le32 vdev_id;
__le32 req_id; __le32 req_id;
__le32 resp_type; /* %WMI_VDEV_RESP_ */ __le32 resp_type; /* %WMI_VDEV_RESP_ */
__le32 status; __le32 status; /* See wmi_vdev_start_status enum above */
}; };
struct wmi_peer_kick_ev_arg { struct wmi_peer_kick_ev_arg {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment