Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp53248pja; Fri, 22 Nov 2019 03:21:13 -0800 (PST) X-Google-Smtp-Source: APXvYqwy7uWlYQVDa4RiMbNbwyx4Zv5IfSoAoxEay9yASDMqd2IQkOAqtHe9fgxj7BqsXsZTqdAn X-Received: by 2002:a17:906:2615:: with SMTP id h21mr21788616ejc.212.1574421673286; Fri, 22 Nov 2019 03:21:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574421673; cv=none; d=google.com; s=arc-20160816; b=JB2C3sko34dlwzjPkEhWaSxqupFfDcIv+TgM71DfGx+OcZl2fytt3UZ8eD+3lHqZSs NXA304BMY1oCifoo0R5cqw0iRQcaOr0HbCxMxajp9Z14FgLWOpSgalWu7ByAljet3PYy q8RVg7/kNQ/SSuuOPSlvMLGZkZVHlsay4VW5io8iybyGt0cMnqDtXgmQonV8HJVkbaZ1 Ts3sW2o9PtMhjHjdVc+cA1bFSvkQpttD5LT9xx8OVEMNzBd36C8Cj2HAT4DqDamEDe3W 82B7tLCIqm4y4RreYom9NtZoh3I/jzaqrUUscDkjCbEIWr/LQbgtSOgS/7+TxNjM08Fc yF6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=11KP3fRdQ39QJCNgAckb2+QMkuEpzLF1bbLZcozWyfo=; b=dRwhJXOJd1sNY3HNjK+RSThHQ7/2MPeEGeHFvKGlXqjir3YmAERCHmNdDspaMZIUYb qryosSJwx3BOOnd1QpuAwHps2eAc4Mx+bxUFnFC0ulFqpb81QvsnZyX+NL4YruUgB7j0 0BXCcq4ssySDMOAEyQOxjb56HN++HvDH6UyrxgeA5HTTzPaNuP1Zw0E2qt7d8TIgYP4j KCkDGqEO9MPww9lb9DoOMx3jYMoB7BqSe8AJnPoANSW1hB6EQjN5ATFMxoj6N8MSAv3B xrBRfOrPbAp5tN7257nwpPrGM/su4p+GOGPSCsj04GPwcSy78U3Pru0iOM6i5kSzIZc8 FG3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hEzNn0tv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ca10si4347307edb.67.2019.11.22.03.20.50; Fri, 22 Nov 2019 03:21:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hEzNn0tv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730070AbfKVKuc (ORCPT + 99 others); Fri, 22 Nov 2019 05:50:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:60482 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729435AbfKVKu1 (ORCPT ); Fri, 22 Nov 2019 05:50:27 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 64211205C9; Fri, 22 Nov 2019 10:50:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574419826; bh=UVB7o8iqmR7C3+y6VH/vIkN3iHFqvvoejmzhLhkv7hY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hEzNn0tvRu3nSb1AjXRu0016R2qKt/kQ1uZneDOtZ4CLhpvgOTRVHdTiSirdSEDiY r4Lkpg5aZNjCSaxOSBZwIWbalnTGO7+xX5O+ufjQAzdmNCRLoI1S+7Rwp0g+0Z8Fvn fgotXUwB/yOYE+pDsID9dh2h4ZXKmA84olBAs08E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ben Greear , Kalle Valo , Sasha Levin Subject: [PATCH 4.14 022/122] ath10k: fix vdev-start timeout on error Date: Fri, 22 Nov 2019 11:27:55 +0100 Message-Id: <20191122100738.028989086@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191122100722.177052205@linuxfoundation.org> References: <20191122100722.177052205@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ben Greear [ Upstream commit 833fd34d743c728afe6d127ef7bee67e7d9199a8 ] 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: Ben Greear Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath10k/core.h | 1 + drivers/net/wireless/ath/ath10k/mac.c | 2 +- drivers/net/wireless/ath/ath10k/wmi.c | 19 ++++++++++++++++--- drivers/net/wireless/ath/ath10k/wmi.h | 8 +++++++- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index 949ebb3e967bb..be9ec265dfe55 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -881,6 +881,7 @@ struct ath10k { struct completion install_key_done; + int last_wmi_vdev_start_status; struct completion vdev_setup_done; struct workqueue_struct *workqueue; diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 8c4bb56c262f6..dff34448588f0 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -955,7 +955,7 @@ static inline int ath10k_vdev_setup_sync(struct ath10k *ar) if (time_left == 0) return -ETIMEDOUT; - return 0; + return ar->last_wmi_vdev_start_status; } static int ath10k_monitor_vdev_start(struct ath10k *ar, int vdev_id) diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 4d6c2986c40dd..25f51ca060934 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -3133,18 +3133,31 @@ void ath10k_wmi_event_vdev_start_resp(struct ath10k *ar, struct sk_buff *skb) { struct wmi_vdev_start_ev_arg arg = {}; int ret; + u32 status; 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); if (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))) - return; + status = __le32_to_cpu(arg.status); + 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); } diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h index d0e05aa437e36..947b74c64fec0 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h @@ -6480,11 +6480,17 @@ struct wmi_ch_info_ev_arg { __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 { __le32 vdev_id; __le32 req_id; __le32 resp_type; /* %WMI_VDEV_RESP_ */ - __le32 status; + __le32 status; /* See wmi_vdev_start_status enum above */ }; struct wmi_peer_kick_ev_arg { -- 2.20.1