From patchwork Sat Dec 30 04:51:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Rameshbabu X-Patchwork-Id: 759207 Received: from mail-40131.protonmail.ch (mail-40131.protonmail.ch [185.70.40.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B3D0C258B; Sat, 30 Dec 2023 04:52:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=protonmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=protonmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b="BMA6j+KP" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1703911924; x=1704171124; bh=rgfZsgOJu+BPxq6BKookU94qgH8Sx+gD893GO289ygE=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=BMA6j+KPHs0BKzmnYdHabhNlX82XaPT4Vs19q/lBXsgjVM5tM/MqSixLrmxuXd/QX MmfJ18Ces8sM86qOBw+PaZdvO4Hdh/48gGhzydD/7XQ3NPwsApCx7JuhWJyLrdvp3t EtX4C1LCu3qb/S0lxxS5hZIy8HMmZPxwpK5FDeLzBRBl8SpJOyarHn4dqy1upWEcAe 2+U32hBm/eofBgVW/6gXQw9ev2QTGv+SmA4m+mVglTTbOunDEZ9nD4gBarsMavVf4y PSXFpQNOP8Tv1Pmuaj6z46XZabqljZJEz7px+Xo9Y1EZWZ/SLOn3TGLhIGcfc5jgOu Y/HslpOMx/o1g== Date: Sat, 30 Dec 2023 04:51:45 +0000 To: Kalle Valo From: Rahul Rameshbabu Cc: linux-wireless@vger.kernel.org, b43-dev@lists.infradead.org, linux-kernel@vger.kernel.org, Rahul Rameshbabu Subject: [PATCH wireless 4/5] wifi: b43: Stop correct queue in DMA worker when QoS is disabled Message-ID: <20231230045105.91351-5-sergeantsagara@protonmail.com> In-Reply-To: <20231230045105.91351-1-sergeantsagara@protonmail.com> References: <20231230045105.91351-1-sergeantsagara@protonmail.com> Feedback-ID: 26003777:user:proton Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 When QoS is disabled, the queue priority value will not map to the correct ieee80211 queue since there is only one queue. Stop queue 0 when QoS is disabled to prevent trying to stop a non-existent queue and failing to stop the actual queue instantiated. Fixes: bad691946966 ("b43: avoid packet losses in the dma worker code.") Signed-off-by: Rahul Rameshbabu --- drivers/net/wireless/broadcom/b43/main.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/broadcom/b43/main.c b/drivers/net/wireless/broadcom/b43/main.c index c81117a22ebf..b6ac1526c0e8 100644 --- a/drivers/net/wireless/broadcom/b43/main.c +++ b/drivers/net/wireless/broadcom/b43/main.c @@ -3603,7 +3603,10 @@ static void b43_tx_work(struct work_struct *work) err = b43_dma_tx(dev, skb); if (err == -ENOSPC) { wl->tx_queue_stopped[queue_num] = true; - ieee80211_stop_queue(wl->hw, queue_num); + if (dev->qos_enabled) + ieee80211_stop_queue(wl->hw, queue_num); + else + ieee80211_stop_queue(wl->hw, 0); skb_queue_head(&wl->tx_queue[queue_num], skb); break; } @@ -3636,11 +3639,12 @@ static void b43_op_tx(struct ieee80211_hw *hw, B43_WARN_ON(skb_shinfo(skb)->nr_frags); skb_queue_tail(&wl->tx_queue[skb->queue_mapping], skb); - if (!wl->tx_queue_stopped[skb->queue_mapping]) { + if (!wl->tx_queue_stopped[skb->queue_mapping]) ieee80211_queue_work(wl->hw, &wl->tx_work); - } else { + else if (wl->current_dev->qos_enabled) ieee80211_stop_queue(wl->hw, skb->queue_mapping); - } + else + ieee80211_stop_queue(wl->hw, 0); } static void b43_qos_params_upload(struct b43_wldev *dev,