Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp173250imd; Wed, 31 Oct 2018 16:47:46 -0700 (PDT) X-Google-Smtp-Source: AJdET5cx0HKWYPuo/bRgA78UXR9jSfa9f8txeBa23wGoSRuwYf7YyUbnkSEYA+Ivf5UnWOYYCApA X-Received: by 2002:a17:902:228:: with SMTP id 37-v6mr2741940plc.287.1541029666234; Wed, 31 Oct 2018 16:47:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541029666; cv=none; d=google.com; s=arc-20160816; b=AjtDMNOstjsNJhXg8WSc42HVdNrvTL26O3zJY3PI/l+w00LWDytrdvcEe3o2kxLyxq iD4wSDUcA1chEGX/0X2gE5hcocABr30E6eSxVWwbwH6yf4EmuUADoqfID6lX7RnMZzQt OhSxP2gauB+01S47m7QZy9VTGyC3oN32HwSMNwFgK2PZTV0fElJ4Cw+1Nbwbdhi9CtWg ovTXiCpMcvD4pd6884v7hW5Ez5mF3/EAIlMdA4gwlJ/SrpyrHyWYsO49OyuP0Lhpf1u7 fWQ430LmLtI+LWRgrgJeWJm6hEnaWzW7I5oMLRMn65lgJewJkNAmGy8oiOMkkEeeHS3P 1oEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=yvOCmu6us2TIS3gIulpM+BJKosUsh7hZW3X/7AJZHwE=; b=E0XAfDCtAEcD43Ue0bmyhmZoB8GDNRwiBwFknqnyLfwFaZkh8RAAHLMcpKmEJeN0WJ OewcQmULguRg2E+6wH6ADRE/vDKyk1RYTMWyjA9ChKDkX8rTj1O8ZTG/CXYgFgTUEQNA Rjdg0qUUMH9Bdl6OAIEFZw/pG6ByefBVaW1MMJhevIau+I2+v5qd5oHGikIPt4Je+f8i IWgS27jw6ByXWfWv7Ujo4/De6fZE0opnCSVxDkKhZ8S/0X9QLUh8tWmuAxkbSOZ5Pp3C Eodg0O0CiQ25SJpmZHkErYf9kgGmA2d+WtG7nluPBUxE2Mww0p0uIB+MAeJVSiV6r4eT bMqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pZMT9iXP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j3-v6si29903569pfc.57.2018.10.31.16.47.31; Wed, 31 Oct 2018 16:47:46 -0700 (PDT) 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=pZMT9iXP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728625AbeKAIHI (ORCPT + 99 others); Thu, 1 Nov 2018 04:07:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:54604 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728581AbeKAIHH (ORCPT ); Thu, 1 Nov 2018 04:07:07 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E5FE02081B; Wed, 31 Oct 2018 23:06:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027216; bh=dHa8dKHtFKD4XKyCrU57+s+F/IVP4Rs0gC/qpgUY+ao=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pZMT9iXPt1hXPeWMLy4Pgcm6g98/IjRsg9eldfwjUaJ/VSCVi+ZQhdNjrgs/v1gvN zwKicHSYqv4zU3OQgv3Lu1TvoFSlspe/4SiZtaeQ+2QXSbiPyDNLAgQiY0EXAJXuMH Utctq2DnzDwPckpMUKqxu5l/6pztPVCHevmM2WRI= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Martin Willi , Kalle Valo , Sasha Levin Subject: [PATCH AUTOSEL 4.19 081/146] ath10k: schedule hardware restart if WMI command times out Date: Wed, 31 Oct 2018 19:04:36 -0400 Message-Id: <20181031230541.28822-81-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031230541.28822-1-sashal@kernel.org> References: <20181031230541.28822-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/net/wireless/ath/ath10k/wmi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 1dced0dae9cd..9f31b9a10850 100644 --- 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 *ar, struct sk_buff *skb, u32 cmd_id) 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; } -- 2.17.1