Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp5383000rdb; Sat, 30 Dec 2023 21:04:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IGtbv3RjgdbgIKZPCv9wqWtEl6mvoGU/qYNiG0CzDFb7wLpo3u9EJGgybTwjucGccbPbBc5 X-Received: by 2002:ad4:50ce:0:b0:67f:e014:278d with SMTP id e14-20020ad450ce000000b0067fe014278dmr10532358qvq.81.1703999090883; Sat, 30 Dec 2023 21:04:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703999090; cv=none; d=google.com; s=arc-20160816; b=0DAnnmPnrfcUHTWofiUKiOIY3qXAaCgAUpQXg+q1ByHw/M5TKy++2SBMQzeaWOEDhi Uc5OtDkS9GnOZmm2mBi/c/p5DAuXi2uaQFXw6d57zkyu+vgq+ZJqUUoyziborA7KW4b8 gyetLuy9MN+M9/aLpNQVl3L9YAqRjcJz6CoIPPPjnEaZUYTmxtJtJMgNwR9Iy1//TaUR q5gPHVX6NVTG1rbFWhrqlaAGzU25vf2d5GFdFp5wkeUlNlGMLTnWd6eqYhhJ3rfYNuou N4XHs8bCb7WzUZ+mGxHyDLQViEFeZjCTq2Lzn56/EUkrqDs5vaoiOBpfj9PGReJiR4Bu kIHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:feedback-id:references :in-reply-to:message-id:subject:cc:from:to:date:dkim-signature; bh=NmMPrf58wJ+F6E+Z9exyRV+1aoIrZhkWoXl0KSFnTL8=; fh=PsnbK8gZ4eZSiF/O9d5dpgr6CuL/1pz8cu0fjhqYkzQ=; b=LKbJhsqASUgSlmg5t9dQcjZyz3wock+d7SrBseKLTSUxFBCMTnDC+vmNPAdbAZR8Xd RJD7mhmUkxFmGmX4s/txmpfCVuK08vz4sWu8gGvL2/1xbC6D+r0yFN4neZcf/51l+T/2 0soOgDTRWgu1GipD9elGPXR5wNG9juWmhmaZM6dCdDesGtQLMe5ekVAHRMfYdhyo+xO+ w+ntU8GkRi9hL0MUq+IQzebkMjxNRLFeIRelkNi3usl+QKmoEkAdBLPtVCw4tGun3WmG lqXJytw/0FIKEvZFw9E6SjyOnoGvoNHcAMkOk0oStvgGWf8zAqvNdx8ctJVGJ/dLwY3n rVhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=d53RqzNm; spf=pass (google.com: domain of linux-wireless+bounces-1362-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1362-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id h20-20020a0cf454000000b0067f85fcf856si20810120qvm.563.2023.12.30.21.04.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Dec 2023 21:04:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-1362-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=d53RqzNm; spf=pass (google.com: domain of linux-wireless+bounces-1362-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1362-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 03D5B1C2029A for ; Sun, 31 Dec 2023 05:04:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B4A258F60; Sun, 31 Dec 2023 05:04:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b="d53RqzNm" X-Original-To: linux-wireless@vger.kernel.org Received: from mail-4316.protonmail.ch (mail-4316.protonmail.ch [185.70.43.16]) (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 3B2DE8F40 for ; Sun, 31 Dec 2023 05:04: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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1703999044; x=1704258244; bh=NmMPrf58wJ+F6E+Z9exyRV+1aoIrZhkWoXl0KSFnTL8=; 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=d53RqzNmwVXdT0sdMUyczQg3vCLBYpudkcdSeDv2z9O8kr5RRNoxoeSN0wIM4Wu55 s0Mjy/VXwTgV9ZdLes4EFNC5/6uoqz4A3RX20LoSHmj7TkfWfJa1WJPjA1guCSQQzR Tr+4bt6qNyftRGhw+9+ZKoi9/N2UilHADgG+vRVTovZpIe8PvQYTlTWK+atiMf8LFb 5NIJbjbGjhJ0J4D1uDbMFw2Vuov+d081qOkg8FaZIj4lUpQY604ePhQqG6em1T1+yz 26U/ebp18KHovz6W0yN8gSiq3t6P2ZfabKCChawC5WOC3qmhaofHeQG6X2tUEZpJfS R4LwqPKYCoi/w== Date: Sun, 31 Dec 2023 05:03:51 +0000 To: Kalle Valo , Larry Finger , =?utf-8?Q?Michael_B=C3=BCsch?= , Julian Calaby From: Rahul Rameshbabu Cc: linux-wireless@vger.kernel.org, b43-dev@lists.infradead.org, linux-kernel@vger.kernel.org, Rahul Rameshbabu Subject: [PATCH wireless v2 3/4] wifi: b43: Stop correct queue in DMA worker when QoS is disabled Message-ID: <20231231050300.122806-4-sergeantsagara@protonmail.com> In-Reply-To: <20231231050300.122806-1-sergeantsagara@protonmail.com> References: <20231231050300.122806-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 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 --- Notes: Changes: =20 v1->v2: - Refactored logic with helpers (suggested by Larry Finger ) =20 Issue Details: =20 When QoS was first introduced to the b43 driver in commit e6f5b934fba8 ("b43: Add QOS support"), four rings were allocated fo= r different QoS priorities for video, voice, best effort, and backgro= und. The core networking stack maps these priorities in the skb, and the= se mappings are noted in the ring's queue_prio member. When disabling = QoS in the driver, the skb will still contain the mapping for the core stack while only one queue is actually considered active (the best effort queue). In the situation that QoS is disabled, b43 needs to = pass 0 to ieee80211 queue functions since the number of queues is set to= 1 in the struct ieee80211_hw queues member. This issue was then exten= ded to the changes in commit bad691946966 ("b43: avoid packet losses in= the dma worker code."). drivers/net/wireless/broadcom/b43/main.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/broadcom/b43/main.c b/drivers/net/wireles= s/broadcom/b43/main.c index 92ca0b2ca286..97d8bdeaa06c 100644 --- a/drivers/net/wireless/broadcom/b43/main.c +++ b/drivers/net/wireless/broadcom/b43/main.c @@ -3603,7 +3603,7 @@ static void b43_tx_work(struct work_struct *work) =09=09=09=09err =3D b43_dma_tx(dev, skb); =09=09=09if (err =3D=3D -ENOSPC) { =09=09=09=09wl->tx_queue_stopped[queue_num] =3D true; -=09=09=09=09ieee80211_stop_queue(wl->hw, queue_num); +=09=09=09=09b43_stop_queue(dev, queue_num); =09=09=09=09skb_queue_head(&wl->tx_queue[queue_num], skb); =09=09=09=09break; =09=09=09} @@ -3627,6 +3627,7 @@ static void b43_op_tx(struct ieee80211_hw *hw, =09=09 struct sk_buff *skb) { =09struct b43_wl *wl =3D hw_to_b43_wl(hw); +=09u16 skb_queue_mapping; =20 =09if (unlikely(skb->len < 2 + 2 + 6)) { =09=09/* Too short, this can't be a valid frame. */ @@ -3635,12 +3636,12 @@ static void b43_op_tx(struct ieee80211_hw *hw, =09} =09B43_WARN_ON(skb_shinfo(skb)->nr_frags); =20 -=09skb_queue_tail(&wl->tx_queue[skb->queue_mapping], skb); -=09if (!wl->tx_queue_stopped[skb->queue_mapping]) { +=09skb_queue_mapping =3D skb_get_queue_mapping(skb); +=09skb_queue_tail(&wl->tx_queue[skb_queue_mapping], skb); +=09if (!wl->tx_queue_stopped[skb_queue_mapping]) =09=09ieee80211_queue_work(wl->hw, &wl->tx_work); -=09} else { -=09=09ieee80211_stop_queue(wl->hw, skb->queue_mapping); -=09} +=09else +=09=09b43_stop_queue(wl->current_dev, skb_queue_mapping); } =20 static void b43_qos_params_upload(struct b43_wldev *dev, --=20 2.42.0