Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3485916imu; Sun, 11 Nov 2018 16:10:51 -0800 (PST) X-Google-Smtp-Source: AJdET5fu04z8XcY7d1O3UKX9ErHhvYVDasgngK9dImcg86RhyQ92yitO3hY/D6PVjjX2Ku0ImMU8 X-Received: by 2002:a17:902:2cc3:: with SMTP id n61-v6mr17213597plb.76.1541981451246; Sun, 11 Nov 2018 16:10:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541981451; cv=none; d=google.com; s=arc-20160816; b=IuqEoujKL79zmkh8QECzFBwzt6zjg/9Yd1617yCv0CmKziw/Uld4ivZ2TxS9k2v0sg nJ8HTQ1cyepw529KEMXklr6uxyDuu2mmxNfzV3Wn/ayK6b0SaVZoZqwfnMlxVJWmurAJ FhX91hGJ16AU14xO/K1Req4oAdSZQcHCtJQj3cg0wLObTNNzDW05aChFunPuPhz/QJwj MemXRBiOcTVDsRgJjd/9fhtpma5AfIK9bXdCNYMim8xF7uQBXPW8NSJDqHRb9IIw6yY6 Zpi2d8LmV+jqi1PnUzywdJtkgi2e2SYhIy16M6xYZU4jp5boIa0dOl3jak0FDK9xasqS iPcg== 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=zgPvFrMrCc3b0Esl2lsS7CR63FfdaabGXAFgGhsuCiQ=; b=id0a8a027vSN//5Zp8CLUc1l/irXoeeLf4X9By0q13YuyO+3BIeRq+8qtxFfqVvXOO NIazkUM5BrU/JWqmh/dZnUxZbMgZjun5ujUqkvRbYQyIf0Vyz5wIg13jgahjGCJJPTMl u1J3O+xrpZ7P6eMkoGxzpwq5B2p6RnJZu1QwTHBAW8tnNj6rQ88ps/LtMp8Xxez5GmFk pK6V/tqLvJIDF0FYewo0m1v4DhjOyD8PQEhkuBVGmglp1K+UFaC/hB0WjmK+4D5XSXXa 4W2XU8odBARXLeKVMsk//ZODGbCALxR/OpnSHiHFss9awem/VogWgtLcbmsFsZ7NC0Tm 8wlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ijDaN1Ea; 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 d189si4575641pgc.393.2018.11.11.16.10.33; Sun, 11 Nov 2018 16:10:51 -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=ijDaN1Ea; 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 S1731191AbeKLIRa (ORCPT + 99 others); Mon, 12 Nov 2018 03:17:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:59904 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731157AbeKLIRa (ORCPT ); Mon, 12 Nov 2018 03:17:30 -0500 Received: from localhost (unknown [206.108.79.134]) (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 D486B208A3; Sun, 11 Nov 2018 22:27:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975254; bh=wOaiJHEvrUJwEzCUhE64Jed5shBzeU3/R6vGhBDm81E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ijDaN1EaM6x6OVOvcHc3+g3IJyI7zKeWmIR5JtBPSv3vA+Y12qX39Kq6eZUANX1gS 106sh53Md/ey5Vq54u9/PAk1uKT0UPACrUyrLZH0Bogd9fpn9818c4Kn/yafRTphYT FWkPbaIzzzFn9I6S/cSocvjUF6H6o5AC4911cmuY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Martin Willi , Kalle Valo , Sasha Levin Subject: [PATCH 4.19 126/361] ath10k: schedule hardware restart if WMI command times out Date: Sun, 11 Nov 2018 14:17:53 -0800 Message-Id: <20181111221637.861291747@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Martin Willi [ Upstream commit a9911937e7d332761e8c4fcbc7ba0426bdc3956f ] When running in AP mode, ath10k sometimes suffers from TX credit starvation. The issue is hard to reproduce and shows up once in a few days, but has been repeatedly seen with QCA9882 and a large range of firmwares, including 10.2.4.70.67. Once the module is in this state, TX credits are never replenished, which results in "SWBA overrun" errors, as no beacons can be sent. Even worse, WMI commands run in a timeout while holding the conf mutex for three seconds each, making any further operations slow and the whole system unresponsive. The firmware/driver never recovers from that state automatically, and triggering TX flush or warm restarts won't work over WMI. So issue a hardware restart if a WMI command times out due to missing TX credits. This implies a connectivity outage of about 1.4s in AP mode, but brings back the interface and the whole system to a usable state. WMI command timeouts have not been seen in absent of this specific issue, so taking such drastic actions seems legitimate. Signed-off-by: Martin Willi Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/ath/ath10k/wmi.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -1869,6 +1869,12 @@ int ath10k_wmi_cmd_send(struct ath10k *a if (ret) dev_kfree_skb_any(skb); + if (ret == -EAGAIN) { + ath10k_warn(ar, "wmi command %d timeout, restarting hardware\n", + cmd_id); + queue_work(ar->workqueue, &ar->restart_work); + } + return ret; }