Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5106238ybe; Tue, 17 Sep 2019 02:43:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqzXA2SbAnFkGOFdyHvgh66Q5dnelNeOYXSpXXz57DZwPgDaEw/yryRn06jxspf54i0C38HF X-Received: by 2002:a50:9e26:: with SMTP id z35mr3538725ede.265.1568713396366; Tue, 17 Sep 2019 02:43:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568713396; cv=none; d=google.com; s=arc-20160816; b=boZyGrho/dvWzMRwVwofKchD7WAJKilp1fSanHoKUe0Zc/D/XM2k/7HOEiCuwPTr55 GHzacb5FnBHI9CiwVzUayC1Fyn8F0Hm5fsbNxhm92OkO1CRu6njY/5BFdK4mqAo9MOZD SNFu4ic+kRBLwTBYme9xZcjNXw9H+UTLhu9xOJMgxiwQUYGh4TwQn63l2RXT5cT3Jabh CPfInJ/b8S7QzxI9dpu+QRsMVqBCew0QEqu2TxGzcoep7U4qkymk3zJIuUNSRRG6YEm0 T7Y+q2haScyhDXgVHxuElkMOD4ARoq8s+SLTaVYyjfR+1Vbof7v3zphIhcl9Kw6VgOLt a5gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:user-agent:cc:to :references:in-reply-to:from:subject:content-transfer-encoding :mime-version:dmarc-filter:dkim-signature:dkim-signature; bh=SFmHw/RZma7dxThBaJE+K2B7CJ9F6vXqjQhU+k6G0eg=; b=O43d5aXDTQT9ymuS4vxhPs7nb3PHWqs0f8G6b/OHQ/R7nWcIpjEoWtGg3zmha6MNR+ 0ifokjTkIe5aeRHAquYOAJFqSeWmrx17lElLojiT531TaphbHWRc/ehJ+0ybg3BRay7S M2xivkmOVL1elBMggnddV2duJ0RzpHbjgvVDhK/ZnZCwZu3qcOQwKi1WZHfaQptaOjSo IbeEWknoRmyMwQhDNgQIm/9HA2/WUr3lKaQKNqUwZXZTMDIah/R4jSPrcIBVPMMZB07g iVNjo1w446ZIz0AMlaDs5FauMnQ2MPyQJF4961swXxk8ycHhjrhKIHv7icNzTO3GUOFU w6QA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=VkuWRh6C; dkim=pass header.i=@codeaurora.org header.s=default header.b=SWK1VxLZ; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-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 n6si817073eju.100.2019.09.17.02.42.51; Tue, 17 Sep 2019 02:43:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-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=@codeaurora.org header.s=default header.b=VkuWRh6C; dkim=pass header.i=@codeaurora.org header.s=default header.b=SWK1VxLZ; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388306AbfIQHMD (ORCPT + 99 others); Tue, 17 Sep 2019 03:12:03 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:55246 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387879AbfIQHMD (ORCPT ); Tue, 17 Sep 2019 03:12:03 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 775DA611CE; Tue, 17 Sep 2019 07:12:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1568704322; bh=ShYD8stI/e8wrCbX70U2IAUnW5cvRGQsjsgDE8dYptk=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=VkuWRh6CkllcitfG5x+g/8IEkkrYfxtT6gy5NqVT2BD6/kZ8NfNsZlBx7FQBHBios bhcjv5w4wEYddPTLmsEh6QFiwg7BJRuP8nl1WT3ZCR7zvu9QJMa2k1TNMKKnkxJDOF HCCGGApZLZ6MtXKQpdPI91ETaGvLbTYbVlchIQsY= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MISSING_DATE,MISSING_MID,SPF_NONE autolearn=no autolearn_force=no version=3.4.0 Received: from potku.adurom.net (88-114-240-156.elisa-laajakaista.fi [88.114.240.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: kvalo@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 8BCBC611CE; Tue, 17 Sep 2019 07:12:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1568704321; bh=ShYD8stI/e8wrCbX70U2IAUnW5cvRGQsjsgDE8dYptk=; h=Subject:From:In-Reply-To:References:To:Cc:From; b=SWK1VxLZ7RFsxFxyRTdENGm5DvKk4eB7wmyABSlgtsdEc51N8bDojtNcrzindMdh1 qDOtDA35QkuC3mc1qSvCqqWTww9L6PiS13Od01aWpPkVovILnP0h0kiW5mKYtidG+I zXF3H9eFbGdJQVTBrsDs5e6HbQFb4vAUfXSuazOA= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 8BCBC611CE Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=kvalo@codeaurora.org Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PATCH] ath10k: remove TX lock from ath10k_htt_tx_inc_pending From: Kalle Valo In-Reply-To: <20190824134857.4094-1-erik.stromdahl@gmail.com> References: <20190824134857.4094-1-erik.stromdahl@gmail.com> To: Erik Stromdahl Cc: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org, Erik Stromdahl User-Agent: pwcli/0.0.0-git (https://github.com/kvalo/pwcli/) Python/2.7.12 Message-Id: <20190917071202.775DA611CE@smtp.codeaurora.org> Date: Tue, 17 Sep 2019 07:12:02 +0000 (UTC) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Erik Stromdahl wrote: > This commit removes the call to ath10k_mac_tx_lock() from > ath10k_htt_tx_inc_pending() in case the high water mark is reached. > > ath10k_mac_tx_lock() calls ieee80211_stop_queues() in order to stop > mac80211 from pushing more TX data to the driver (this is the TX lock). > > If a driver is trying to fetch an skb from a queue while the queue is > stopped, ieee80211_tx_dequeue() will return NULL. > > So, in ath10k_mac_tx_push_txq(), there is a risk that the call to > ath10k_htt_tx_inc_pending() results in a stop of the mac80211 TX queues > just before the skb is fetched. > > This will cause ieee80211_tx_dequeue() to return NULL and > ath10k_mac_tx_push_txq() to exit prematurely and return -ENOENT. > Before the function returns ath10k_htt_tx_dec_pending() will be called. > This call will re-enable the TX queues through ath10k_mac_tx_unlock(). > When ath10k_mac_tx_push_txq() has returned, the TX queue will be > returned back to mac80211 with ieee80211_return_txq() without the skb > being properly consumed. > > Since the TX queues were re-enabled in the error exit path of > ath10k_mac_tx_push_txq(), mac80211 can continue pushing data to the > driver. If the hardware does not consume the data, the above mentioned > case will be repeated over and over. > > A case when the hardware is not able to transmit the data from the host > is when a STA has been dis-associated from an AP and has not yet been > able to re-associate. In this case there will be no TX_COMPL_INDs from > the hardware, resulting in the TX counter not be decremented. > > This phenomenon has been observed in both a real and a test setup. > > In order to fix this, the actual TX locking (the call to > ath10k_mac_tx_lock()) was removed from ath10k_htt_tx_inc_pending(). > Instead, ath10k_mac_tx_lock() is called separately after the skb has > been fetched (after the call to ieee80211_tx_dequeue()). At this point > it is OK to stop the queues. > > Signed-off-by: Erik Stromdahl What hardware and firmware versions did you test this? Please always add that to the commit log. As Erik mostly works on SDIO I assume PCI is not that well tested. Has anyone else tried this? -- https://patchwork.kernel.org/patch/11112997/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches