Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3017596imu; Mon, 19 Nov 2018 09:24:51 -0800 (PST) X-Google-Smtp-Source: AJdET5exvd3Fjm+kh8AkRk9T14SBhm+fku6Dlh3DhaWzcgAUNy4qGBw5ZM7ttOqBhGhm0ZST4AJ6 X-Received: by 2002:a17:902:d01:: with SMTP id 1mr13926781plu.127.1542648291508; Mon, 19 Nov 2018 09:24:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542648291; cv=none; d=google.com; s=arc-20160816; b=dp1tKRgXxKz2PniH5+moB/5XNWozmJDvtemqNzQs7muwAi7EOWc2qyYzVLhsrsjAx4 r6tJZ9Noq1vTzxMQj4qb9odn0eU4cw/+a5tCldIN++81gfPlGMoQpJf/qhXIdeqUrCRO T/6/xyzKCl8P5D6jlRVYWyh83vndDDV+8Tf3TQ7aoxNyMAG5BLtNPyGiEhI+rndSH7cH 86eOSrLEw4d/RjTOVDGJu3d8OOR02njvOdHAJAUoNGNUg0B6m0k69AZThoy7v09NKQUB tatbc9bpMXupIYD6HK1Ue0DDSJzObcRJY9MmwLMGQQandmeNqjLFrDjb2fMBEEqn0/vo eqrg== 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=m15UJCQmdkaShKy459IciPGrVP24WP8bD273cmRI5n8=; b=HCb+uhi/1PvJUz6+X2EDFI/EUg0ylFrVyj17sAKRXKvZPXhDAetpLSDkMImiXucnOO QNcSY3N91sCqDsAlrwbvhWz2APIifbOB1LcM82fQgCfUdjcBpmiJAbmyjwjJTVjto9qZ mT/LFL1/I9k3ZbNBxbj/vN5PSMs1PiZO1laQpEFlhZ6Jv5Xm+2yUTKzWklYjNZQ2heMb jTzvcFdhlYQPuvgbOY0iXuqa0ZQvT4fozH8qSaWee+ZVCq5VxZGW/6RD+8YGOd8HnY4M TzoOzr5GeF95sSgvhrEV90eumxmBLO45kVpXaA6dGEzJEZ132rt0XArgTcR1fvfkL4Ak Vtag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Nqv7MjgE; 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 o6si2155740plh.23.2018.11.19.09.24.28; Mon, 19 Nov 2018 09:24: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=Nqv7MjgE; 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 S2404946AbeKTDXG (ORCPT + 99 others); Mon, 19 Nov 2018 22:23:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:34968 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403980AbeKTDXF (ORCPT ); Mon, 19 Nov 2018 22:23:05 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 5BFEB2148E; Mon, 19 Nov 2018 16:58:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542646729; bh=i3oc0HOA1RGCBv7i87ubPJtz79+LksxjEiYKyVltE3k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nqv7MjgEiUPiNSNFLhHuZBS9p6bEMAzyKJymYL4Msez9s+T5+A/AzdvhwcqybntgB NTdHzJ+qtTcUspWxhSaa7RzkvKGwK/fBMdhjsKJ8wYlHdcXlws0n2skg+j+PzjKtRh +4V6vzyqdj7T4Rp6AUEufDd5YOanzzwTvPm5g80A= 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.4 031/160] ath10k: schedule hardware restart if WMI command times out Date: Mon, 19 Nov 2018 17:27:50 +0100 Message-Id: <20181119162633.884969377@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181119162630.031306128@linuxfoundation.org> References: <20181119162630.031306128@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.4-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 @@ -1749,6 +1749,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; }