Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13334326ybl; Sun, 29 Dec 2019 09:31:51 -0800 (PST) X-Google-Smtp-Source: APXvYqxhtvmSTv174YmBH9O8aAuGyOsVn8VvXw5IMWvvV5LR2IIcCKg0trl9k+DRYQC8EQCBZ9Kp X-Received: by 2002:a9d:6857:: with SMTP id c23mr54745664oto.351.1577640711716; Sun, 29 Dec 2019 09:31:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577640711; cv=none; d=google.com; s=arc-20160816; b=BiT/jhpnIrkQzpLcHUhWRfejEFuEG2P0Lgkpi4QHotq35y50n3+xR5ZqFgJqdCT7Yy qMJqVNldl6rYHCL6VmMnISGhiN2WXMYxeFoHvymHVcyjkjNAaabhvpMr8j1RBEuiCDDK I4jEDhWT0DyGYgreDXq5LNn+u08LwfI2UeqfURiRzbEB+zmSKK2y2UVwlY73AxVyc7HC P7Ce6zW72Xha8OH6arjxTgt4ZRYVJhPRYbGCHTqAlN+aF9VJE4nVRLLm6z6tjMqWo7W/ fW5wLPSlU6N0mpcqIODJAQz3s9BxRkG2wT3SNXeQiXsbxkwkKIh+vQSjxatzZ9lOSfkd vqAw== 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=U/26ovxyNJhrFCbHDGAMdSueRO1HhhOEQn+J2zAiFns=; b=ne8pjfOhfuAo+EqzS3oN8xiSuyor2HXEu0s/WiynP65ahDnSWWYQF1hABwN6coAYVi 99PxynH4ACtFKfIQjewzadH8L6fYA9GkM9eALX9JterRDtHPW2rF3qOTYCfi07YfVeYg 7Ls7jr0pE+MkMlL/JZPqrcVTYU11X3cu++exm3vIbU/6t69MGzWz2oCodcWL6W0DJdfa 4JNLUrHALVWc1LjtLp0IdlVjIGTCBKbLS5U+79Gi5QMoLQjhrh/iBKIcAnoGhxzu6WFS 7gztQnHxft+kP+DYcSMS7bzRpc4mBq49BOzEG+iCkTengqb5al3+fVJ4FbU+oBNL2rok Caxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wx4EfnaU; 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 y9si23398040otq.315.2019.12.29.09.31.39; Sun, 29 Dec 2019 09:31: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=wx4EfnaU; 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 S1729007AbfL2Rag (ORCPT + 99 others); Sun, 29 Dec 2019 12:30:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:56642 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728986AbfL2Rab (ORCPT ); Sun, 29 Dec 2019 12:30:31 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 EC5D2208E4; Sun, 29 Dec 2019 17:30:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577640630; bh=/rNfLlDFEPFbNB7FdvvEFbv5GRkGT8o2JvNT5raz0t8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wx4EfnaUxFN9gC8/gX2T5PI3wKG+6nHtO+i+9MAxaXFoInCakVRTjoYF/4iTRTKWJ N212/cUE47vPtEH6B11pA8nh0TXayzcP6YsRgF+/pO7sAvL7uC5QpoLytAqOhVIZmA XoZXv5gn3RVRKPt3c2z2c715B2Iy4evlyBrWNYnw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ben Greear , Antonio Quartulli , Kalle Valo , Sasha Levin Subject: [PATCH 4.19 047/219] ath10k: fix offchannel tx failure when no ath10k_mac_tx_frm_has_freq Date: Sun, 29 Dec 2019 18:17:29 +0100 Message-Id: <20191229162514.816153306@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229162508.458551679@linuxfoundation.org> References: <20191229162508.458551679@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Ben Greear [ Upstream commit cc6df017e55764ffef9819dd9554053182535ffd ] Offchannel management frames were failing: [18099.253732] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e3780 [18102.293686] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e3780 [18105.333653] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e3780 [18108.373712] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e3780 [18111.413687] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e36c0 [18114.453726] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e3f00 [18117.493773] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e36c0 [18120.533631] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e3f00 This bug appears to have been added between 4.0 (which works for us), and 4.4, which does not work. I think this is because the tx-offchannel logic gets in a loop when ath10k_mac_tx_frm_has_freq(ar) is false, so pkt is never actually sent to the firmware for transmit. This patch fixes the problem on 4.9 for me, and now HS20 clients can work again with my firmware. Antonio: tested with 10.4-3.5.3-00057 on QCA4019 and QCA9888 Signed-off-by: Ben Greear Tested-by: Antonio Quartulli [kvalo@codeaurora.org: improve commit log, remove unneeded parenthesis] Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath10k/mac.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 613ca74f1b28..174e0ce31c42 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -3651,7 +3651,7 @@ static int ath10k_mac_tx(struct ath10k *ar, struct ieee80211_vif *vif, enum ath10k_hw_txrx_mode txmode, enum ath10k_mac_tx_path txpath, - struct sk_buff *skb) + struct sk_buff *skb, bool noque_offchan) { struct ieee80211_hw *hw = ar->hw; struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); @@ -3679,10 +3679,10 @@ static int ath10k_mac_tx(struct ath10k *ar, } } - if (info->flags & IEEE80211_TX_CTL_TX_OFFCHAN) { + if (!noque_offchan && info->flags & IEEE80211_TX_CTL_TX_OFFCHAN) { if (!ath10k_mac_tx_frm_has_freq(ar)) { - ath10k_dbg(ar, ATH10K_DBG_MAC, "queued offchannel skb %pK\n", - skb); + ath10k_dbg(ar, ATH10K_DBG_MAC, "mac queued offchannel skb %pK len %d\n", + skb, skb->len); skb_queue_tail(&ar->offchan_tx_queue, skb); ieee80211_queue_work(hw, &ar->offchan_tx_work); @@ -3744,8 +3744,8 @@ void ath10k_offchan_tx_work(struct work_struct *work) mutex_lock(&ar->conf_mutex); - ath10k_dbg(ar, ATH10K_DBG_MAC, "mac offchannel skb %pK\n", - skb); + ath10k_dbg(ar, ATH10K_DBG_MAC, "mac offchannel skb %pK len %d\n", + skb, skb->len); hdr = (struct ieee80211_hdr *)skb->data; peer_addr = ieee80211_get_DA(hdr); @@ -3791,7 +3791,7 @@ void ath10k_offchan_tx_work(struct work_struct *work) txmode = ath10k_mac_tx_h_get_txmode(ar, vif, sta, skb); txpath = ath10k_mac_tx_h_get_txpath(ar, skb, txmode); - ret = ath10k_mac_tx(ar, vif, txmode, txpath, skb); + ret = ath10k_mac_tx(ar, vif, txmode, txpath, skb, true); if (ret) { ath10k_warn(ar, "failed to transmit offchannel frame: %d\n", ret); @@ -3801,8 +3801,8 @@ void ath10k_offchan_tx_work(struct work_struct *work) time_left = wait_for_completion_timeout(&ar->offchan_tx_completed, 3 * HZ); if (time_left == 0) - ath10k_warn(ar, "timed out waiting for offchannel skb %pK\n", - skb); + ath10k_warn(ar, "timed out waiting for offchannel skb %pK, len: %d\n", + skb, skb->len); if (!peer && tmp_peer_created) { ret = ath10k_peer_delete(ar, vdev_id, peer_addr); @@ -3998,7 +3998,7 @@ int ath10k_mac_tx_push_txq(struct ieee80211_hw *hw, spin_unlock_bh(&ar->htt.tx_lock); } - ret = ath10k_mac_tx(ar, vif, txmode, txpath, skb); + ret = ath10k_mac_tx(ar, vif, txmode, txpath, skb, false); if (unlikely(ret)) { ath10k_warn(ar, "failed to push frame: %d\n", ret); @@ -4280,7 +4280,7 @@ static void ath10k_mac_op_tx(struct ieee80211_hw *hw, spin_unlock_bh(&ar->htt.tx_lock); } - ret = ath10k_mac_tx(ar, vif, txmode, txpath, skb); + ret = ath10k_mac_tx(ar, vif, txmode, txpath, skb, false); if (ret) { ath10k_warn(ar, "failed to transmit frame: %d\n", ret); if (is_htt) { -- 2.20.1