From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 3285D27602F; Thu, 25 Sep 2025 08:49:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758790149; cv=none; b=cvNyKBddncg6EulcN5BLcukHKxBPZQGqlHSIovFYatZ6g4MUT+EReRnGqFY70zCTFnBre3NH46vo5U7qPC9A27FwVka8CK/sgs+lZ+BENc6aw3fIoVhSb94aRKGwIkcDpKsVRAa87NmtCReSw8vuiQjpDmPAnW3KO8EOtIyPHLQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758790149; c=relaxed/simple; bh=0XH/pbAoB1UZ8lXsLizsKNsDE/zUUc1t111qHGiFtEI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=c/Qxhhl4ui5LC6Y2D6vtbwXoiiiD2+IY38oKauWTCVxuZw27U13dX3BIGaxfpR67MUv37sLR2y1a0HFhi/QxR5HBOaaw2UOsHNSPF5i5Ozdxr3ln76h+8lmEN1draNaAN61+tGPqx962X3iRbvvH34s97pndbIIvqZnTepsVcjU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fGca+M+z; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fGca+M+z" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EAB52C4CEF7; Thu, 25 Sep 2025 08:49:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1758790148; bh=0XH/pbAoB1UZ8lXsLizsKNsDE/zUUc1t111qHGiFtEI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fGca+M+zLI3Rj1FCEQEf9+xig+b9wSiYTb9kblIFviEQsbu9PacUl/lRtI+BFugfx HRralzrel7s7hT0vUbGe+0+bjCi25oI3PPD5246xGevCG80urf74T093GP+FcZ4xTQ LwOmS7GqqTEYkL67hK+v6p3a0COt6GJU7IsKglZGCq+s4dF+wB9FpsWQ3wnmexjU7K Rlse/A/ZBkzJCxk/XWRhvKzQQ/Ot416iSir41NKR/e9M5AfU25JcSC9YgdmPAQrLGh fwpDUukHPDM3dxuHDn+q2Jr9dfZf1iL9vmihHvCYZ0tpGRifwQfU06ofnqx2yGeQUA j0DEPmTprmJmA== Date: Thu, 25 Sep 2025 09:49:02 +0100 From: Simon Horman To: =?utf-8?B?VGjDqW8=?= Lebrun Cc: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nicolas Ferre , Claudiu Beznea , Geert Uytterhoeven , Harini Katakam , Richard Cochran , Russell King , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Petazzoni , Tawfik Bayouk , Sean Anderson Subject: Re: [PATCH net v6 2/5] net: macb: remove illusion about TBQPH/RBQPH being per-queue Message-ID: <20250925084902.GU836419@horms.kernel.org> References: <20250923-macb-fixes-v6-0-772d655cdeb6@bootlin.com> <20250923-macb-fixes-v6-2-772d655cdeb6@bootlin.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20250923-macb-fixes-v6-2-772d655cdeb6@bootlin.com> On Tue, Sep 23, 2025 at 06:00:24PM +0200, Théo Lebrun wrote: > The MACB driver acts as if TBQPH/RBQPH are configurable on a per queue > basis; this is a lie. A single register configures the upper 32 bits of > each DMA descriptor buffers for all queues. > > Concrete actions: > > - Drop GEM_TBQPH/GEM_RBQPH macros which have a queue index argument. > Only use MACB_TBQPH/MACB_RBQPH constants. > > - Drop struct macb_queue->TBQPH/RBQPH fields. > > - In macb_init_buffers(): do a single write to TBQPH and RBQPH for all > queues instead of a write per queue. > > - In macb_tx_error_task(): drop the write to TBQPH. > > - In macb_alloc_consistent(): if allocations give different upper > 32-bits, fail. Previously, it would have lead to silent memory > corruption as queues would have used the upper 32 bits of the alloc > from queue 0 and their own low 32 bits. > > - In macb_suspend(): if we use the tie off descriptor for suspend, do > the write once for all queues instead of once per queue. > > Fixes: fff8019a08b6 ("net: macb: Add 64 bit addressing support for GEM") > Fixes: ae1f2a56d273 ("net: macb: Added support for many RX queues") > Reviewed-by: Sean Anderson > Acked-by: Nicolas Ferre > Signed-off-by: Théo Lebrun Reviewed-by: Simon Horman