From patchwork Fri Feb 6 12:05:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 5790241 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4800B9F2ED for ; Fri, 6 Feb 2015 12:07:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6D516200E6 for ; Fri, 6 Feb 2015 12:07:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A4095200DB for ; Fri, 6 Feb 2015 12:07:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756132AbbBFMGz (ORCPT ); Fri, 6 Feb 2015 07:06:55 -0500 Received: from mail-wg0-f52.google.com ([74.125.82.52]:40933 "EHLO mail-wg0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756233AbbBFMGv (ORCPT ); Fri, 6 Feb 2015 07:06:51 -0500 Received: by mail-wg0-f52.google.com with SMTP id y19so13083277wgg.11 for ; Fri, 06 Feb 2015 04:06:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id; bh=ADmEYQOM3Np8UnpWja8DO0CeafHH0azGb+IHgm1pXHI=; b=E/VqOUuzY298sixNUhR4ZkqF4EkSaGzO4FDlZo80T2jKV3HPB8967FWWc1dxRx2WFt ViSjtx4cIo4l/tuse61EzqPN7MYLZjnC2nRw4AilrOH4xDVNll1AEwEt/DdzpBQO1R0G wU4tndO6lZ1+m+Bp6EUjADCUFw0jbYIRThQ6Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ADmEYQOM3Np8UnpWja8DO0CeafHH0azGb+IHgm1pXHI=; b=hgtOlealF7U0Ybep4++1+64Xjc+U0TRYZJCbKN4teE92hg9ilc7JEpWBQCrdE4IXWe AOP2I4V1bYuW301zOb9/tt3jXfrU191A7j5euyGzYzFw8mUjCjxSNlbZba/+m8v4u0fl n2fJ5YkCSc0V1vlsn2JjY9oVgSLvLb/gQg2E+PI67DHubuXw/J/RdF6UHF/xBRZKOD+o sRFna+l8fkgxwoWsfhGPZEjhcjIfBimujGBETXXAAOXdz2rW8ZVvZ/p4CQlF12kX8+12 snoKsoGUfHeFhVhMYutgKAZbBYa+LOD+0jRy+xuZZWy65ahruydGX5JdNsKtOmXNzBUO oScQ== X-Gm-Message-State: ALoCoQmDiT8PyZ7fmsuC8ho6HAQoclWYbQb0w2gAgQEI4f1b5d71aD+lRBdKFWKoc0vmPKsyr7AkSSt05wLErB5xwc+LgYJK40FY9W0epQSeTOHp9PDZR7qsEl95G7TT/S7qOUHBJf4d X-Received: by 10.194.78.72 with SMTP id z8mr7071914wjw.0.1423224410054; Fri, 06 Feb 2015 04:06:50 -0800 (PST) Received: from bob.homerouter.cpe (apn-31-1-134-151.dynamic.gprs.plus.pl. [31.1.134.151]) by mx.google.com with ESMTPSA id d6sm1242533wic.1.2015.02.06.04.06.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Feb 2015 04:06:49 -0800 (PST) From: Michal Kazior To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, malaakso@elisanet.fi, greearb@candelatech.com, Michal Kazior Subject: [RFT] ath10k: restart fw on tx-credit timeout Date: Fri, 6 Feb 2015 13:05:54 +0100 Message-Id: <1423224354-24955-1-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 1.8.5.3 X-DomainID: tieto.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It makes little sense to continue and let firmware-host state become inconsistent if a WMI command can't be submitted to firmware. This effectively prevents after-affects of tx-credit starvation bug which include spurious sta kickout events and inability to associate new stations after some time when acting as AP. This should also speed up recovery/teardown in some cases when firmware stops responding for some reason. Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/wmi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index aeea1c7..776b257 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -1045,9 +1045,15 @@ int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id) (ret != -EAGAIN); }), 3*HZ); - if (ret) + if (ret) { dev_kfree_skb_any(skb); + if (ret == -EAGAIN) { + ath10k_warn(ar, "firmware unresponsive, restarting..\n"); + queue_work(ar->workqueue, &ar->restart_work); + } + } + return ret; }