Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp5237872rdb; Sat, 30 Dec 2023 11:38:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IHmCmjw8kZg0ueITvnWIQaXsHoaFVjfFGUlsKmOc8Z4sKaqFpwizTxLbA28oKhlqMwEBPZ7 X-Received: by 2002:a17:902:e881:b0:1d4:691e:816f with SMTP id w1-20020a170902e88100b001d4691e816fmr9782246plg.124.1703965101610; Sat, 30 Dec 2023 11:38:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703965101; cv=none; d=google.com; s=arc-20160816; b=DG7kTsuH7QKL49AjFPBVmY6nJidGRqkhuHRaqEf2jII/HG0Y4hKWA7ykOJsy5XIpWM RaMQrMX/cu1HPw3t021bO/QovOWxH9TR5P+3/5NtN+kOjtxDPaufKYm5YpWW9tmg3qzh TVkcsbgRJuaKx3/OO6LXmEQHoZWrAHVzXrlBzL6LTMDQyDbSrJPumTGTGH3LwpPJbkX/ b7Y//XRyN08pd5QUEEnup0+fgjkIAIX920lrWSnomf5Y+5Xmlc+8j8mV+lwpSR7tz5cG qSq5slj+aNzb3FzhJPs8DuqmavlzQNUF/5WBxUC/pAkvrUaJRYfhsDSO3rfWCuw7DClX fSIA== 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=hzDnlR2JtaWtfwJIyhGyRAK5TYxs41N11mbfkjjCeuA=; fh=uBOvP8C4oS9kW0PSjJsIsSwWzNMZ1KuVfJI8pIfgQWc=; b=h/0z9azgKd3b0wAs+lIJklQYWA+KtlFDUvhmIOjez+cwiHkDuuADFEeLWMUYY4ons2 LLHT+vNWqm2q6AYRPBO40t/qDSeBwxgTr+0DCiMfd9SNi3hZ6Gn1uVJ6CRoCnTWT6Yn9 ADN0ltB2jrQ/GTSftnEqdVrzIE0kCJJUM6r+3t7f+9G24J+z7Tpr8inlsFvBXiY1IX3a otRsksxMYbierW/AZrTS4aErz7KRPg6cPuhLPBrJ5CYJy3VOdKX7+xHvhMSyyzkUJCQL LKHB6/SehDmP4MXf73cYDq9jdL3Mu1NCH7j7HwshKbbx3Xi0zdd/Ag3LrOFuZ87QcO7x eO4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=Aahj92t5; spf=pass (google.com: domain of linux-wireless+bounces-1354-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1354-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id c93-20020a17090a496600b0028b6d3635a6si19224672pjh.57.2023.12.30.11.38.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Dec 2023 11:38:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-1354-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=Aahj92t5; spf=pass (google.com: domain of linux-wireless+bounces-1354-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1354-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id B557A28362C for ; Sat, 30 Dec 2023 19:38:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4E17FBE5D; Sat, 30 Dec 2023 19:38:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b="Aahj92t5" X-Original-To: linux-wireless@vger.kernel.org Received: from mail-40133.protonmail.ch (mail-40133.protonmail.ch [185.70.40.133]) (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 BC5FEC12B for ; Sat, 30 Dec 2023 19:38:16 +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=1703965094; x=1704224294; bh=hzDnlR2JtaWtfwJIyhGyRAK5TYxs41N11mbfkjjCeuA=; 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=Aahj92t5uGFWTqmOxjniE5OZ3TRJguziyPxCCgQ29EPrxtCqZ3kR9LtjXcV1/LdZq 9j8dwpnozl5p+zuocdqzsViooERopNkJy5IEHRpUXIvGkV2uQVFYVoULoJOGoGBpI2 BXLOQmcihq1llvS/oZJ07g9Qq5mE/P040mT9XhiI8iJbUc2iexcxjxzySToYm/rW3W fL6kBJIZQfAeTMxTNqYQZ9rXklN8a7aY0bWDyf5VeNpbDqr7VRo0BGRJpdbvKJ5ds5 Z+bSqsWNDnAaMOSv7vKYvXRbEPX5NW21pIht+Qe0yue4PeDz9t3NRaVhZwl/GroKXy WHdWzXYC5iuag== Date: Sat, 30 Dec 2023 19:37:56 +0000 To: =?utf-8?Q?Michael_B=C3=BCsch?= From: Rahul Rameshbabu Cc: Julian Calaby , Kalle Valo , linux-wireless@vger.kernel.org, b43-dev@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH wireless 2/5] wifi: b43: Stop/wake correct queue in DMA Tx path when QoS is disabled Message-ID: <87bka7wkfm.fsf@protonmail.com> In-Reply-To: <20231230184113.3ecfed4f@barney> References: <20231230045105.91351-1-sergeantsagara@protonmail.com> <20231230045105.91351-3-sergeantsagara@protonmail.com> <20231230144036.7f48b739@barney> <878r5bk3x9.fsf@protonmail.com> <20231230184113.3ecfed4f@barney> 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 On Sat, 30 Dec, 2023 18:41:13 +0100 Michael B=C3=BCsch wrote: > [[PGP Signed Part:Undecided]] > On Sat, 30 Dec 2023 17:15:18 +0000 > Rahul Rameshbabu wrote: > >> On Sat, 30 Dec, 2023 14:40:36 +0100 Michael B=C3=BCsch wrote= : >> > [[PGP Signed Part:Undecided]] >> > On Sat, 30 Dec 2023 18:48:45 +1100 >> > Julian Calaby wrote: =20 >> >> > --- a/drivers/net/wireless/broadcom/b43/dma.c >> >> > +++ b/drivers/net/wireless/broadcom/b43/dma.c >> >> > @@ -1399,7 +1399,10 @@ int b43_dma_tx(struct b43_wldev *dev, struct= sk_buff *skb) >> >> > should_inject_overflow(ring)) { >> >> > /* This TX ring is full. */ >> >> > unsigned int skb_mapping =3D skb_get_queue_mapping(= skb); >> >> > - ieee80211_stop_queue(dev->wl->hw, skb_mapping); >> >> > + if (dev->qos_enabled) >> >> > + ieee80211_stop_queue(dev->wl->hw, skb_mappi= ng); >> >> > + else >> >> > + ieee80211_stop_queue(dev->wl->hw, 0); =20 >> >>=20 >> >> Would this be a little cleaner if we only look up the queue mapping i= f >> >> QOS is enabled? I.e. =20 >> > >> > No. It would break the other uses of skb_mapping. >> > >> > But I am wondering why skb_mapping is non-zero in the first place. >> > I think the actual bug might be somewhere else. =20 >>=20 >> Right, skb_mapping is used to map to the correct software structures DMA >> mapped to the device. The reason the mapping for the best effort queue >> (the default/defacto when QoS is disabled) is not zero is due to the way >> initialization of the queues/rings occurs in the driver. The best effort >> queue is mapped as the third queue, which leads to this issue when QoS >> is disabled. Would it make more sense to change the mappings in >> initialization such that the best effort queue is by default mapped to >> zero, so we would not need such conditionals? > > Maybe it is a good idea to find the patch that broke non-QoS. > That possibly helps to understand the situation. > > Non-QoS used to work just fine. I did some git analysis, and I actually believe that this issue has been present since the commit e6f5b934fba8 ("b43: Add QOS support"). Before then, non-QOS would not trigger this issue. There is a cosmetic change after this commit, b27faf8ebf25 ("b43: Rename the DMA ring pointers"), but this change does not introduce the issue (but makes it more obvious). I think the reason nobody has ever reported this is that even when the warnings are triggered, everything appears to work fine. I think therefore the two options are the following. 1. Remap the BE queue to 0 instead of the BK queue. 2. Use this kind of conditional to handle the mapping when QoS is disabled. -- Thanks, Rahul Rameshbabu