Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3436999imu; Sun, 11 Nov 2018 15:04:48 -0800 (PST) X-Google-Smtp-Source: AJdET5dxjQDkujvHBaY2QHdA10/Eyfo/TzkTCp+a8X6ToAaBKhQRMawvFeV7RMCfy5Px+NuRfnV8 X-Received: by 2002:aa7:87d0:: with SMTP id i16-v6mr17742306pfo.20.1541977488143; Sun, 11 Nov 2018 15:04:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541977488; cv=none; d=google.com; s=arc-20160816; b=JzOU1KQcpfp/8wzCEuF0eJPxGcGotWtfHWIj8hM2aKVXj1wFLuWEeRhQQu3ARsVoNK DX4RiQeuPixNuAjkptFya6PTf9+2Ws73arDJL7lUCa3NdCjSksEItN5p/5MnbVnkmU+L BCQ92HuhhZRVWvmki7IfoRNIdgfkAIzcHRlNd3Ad7LMz7JGTlkO75CxKWRtsaImRr/3W dLrnK97BVW1yEoH36kgZCPlb345GCzfUK8BxzuvYGnrek5PqfPIk7zhGekhMgKfjQGDH xTrrgZfywFet3f5jJvw1GikKzdrszVfnTPZK8C7WdQt1ov/RSg0X3WplfzEfPJGAGWyO gpQw== 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=Ycp1+0SfdWmoh+Xt2AvsYSrCcaDUPBViwt43lnoQZH4=; b=qG5dYxGPJHwNPQyDZ9/c7pIC8mIJIKwgdfn2harcwHkWcR4IOlXMGBOSm9T0nwuuOl 02EGnHh1J2CjnppRWFM7kDq2/LVqrBciKsw+5Z3TFkiq8XKxPF81O/Au7M87icMc8VG/ B3BxX2UbdzkffDMyjiZ+CW026e2fSqpPdKyXqKpHN3Gco4+IaLJB9Gfyj8NFY8vqNsXB EW4YfFUYPz2sTyBklj6H7ASbJSjO2bbFIsORNwnj4lpOJfX5pbePv1DdEjD+O/eRX5+L 3eQLYrGvna8wEkhytS7JTw4kKphzXQ5PNS5vzdUuMia1F3I4aw9pUvQ8m/5Dd97NQuQ7 bg7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qRpzy+kO; 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 h5-v6si17046895pfg.226.2018.11.11.15.04.33; Sun, 11 Nov 2018 15:04:48 -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=qRpzy+kO; 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 S2390673AbeKLIyS (ORCPT + 99 others); Mon, 12 Nov 2018 03:54:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:51248 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390517AbeKLIWV (ORCPT ); Mon, 12 Nov 2018 03:22:21 -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 71A1B224B3; Sun, 11 Nov 2018 22:32:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975544; bh=Pt/9MyPLgs8KjtZnuN8CdxJD4RMusvhOug90nUfkT2o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qRpzy+kOITx7VcXB0BpBVOdg1uLuKATMkSsqF4MG/WuYmmcrc+SQj5qgayOwJF1r1 WkxZRQL4/fyy8U76EfvmZfL6ixf1aKcvaGi3BlhRPCBXYk2bJRD5aUZAJfvTY8wIQF zomyKG0OEm63hQAkEdinXjyj7HunVmlHExmu957o= 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.14 074/222] ath10k: schedule hardware restart if WMI command times out Date: Sun, 11 Nov 2018 14:22:51 -0800 Message-Id: <20181111221654.732894668@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221647.665769131@linuxfoundation.org> References: <20181111221647.665769131@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.14-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 @@ -1852,6 +1852,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; }