From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 092E3C4451B for ; Sun, 19 Jul 2026 17:34:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: Message-ID:Subject:To:From:Date:Reply-To:Cc:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=wWDQs/F2bMUnm9ZFF7c9/syWaa0d2pil0MzAXc51hOc=; b=B25fXBGJaoGYpNDJy72pFCHCrB bgBmOFDiZwCefHE7MOpTc9rXYVhA1dUZ+nRBD3m1B1U4256afNsvkKfZUQpXo9CxIOVPtKQ3E+G3O Gul6pspaL2FY8j716Lnh63NNOEkminCEL5KtOpaMkR+t6kHqDvsZP+TQYyx2KaV6GkhrllAbpgrU9 a3skXv52cm3S93PoDOUnPrwycD4eo3OdZUlQ8mTuTfG7WQHfMUKsuIQQ5agEvRlnTo6xRMQNBZVVX nFvYbXiNa7FpuPVVG1VYJkWpT3H6HSobEs5KEqecxZf+LGrQIheG3hLahTai3uUbWJ5T6YhsgmVym i12jYmDg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wlVP1-00000005DRL-0tl7; Sun, 19 Jul 2026 17:34:11 +0000 Received: from pidgin.makrotopia.org ([2a07:2ec0:3002::65]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wlVOz-00000005DQZ-1MLP; Sun, 19 Jul 2026 17:34:10 +0000 Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.99) (envelope-from ) id 1wlVOi-000000004iM-0VQi; Sun, 19 Jul 2026 17:33:52 +0000 Date: Sun, 19 Jul 2026 18:33:45 +0100 From: Daniel Golle To: "Chester A. Unal" , Daniel Golle , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Russell King , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next v4 0/8] net: dsa: mt7530: modernise register access and add two DSA ops Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260719_103409_386489_485121DB X-CRM114-Status: GOOD ( 12.97 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org The mt7530 driver carries its own register accessors that predate the regmap conversion and now largely duplicate what regmap already provides, including locking. Most of this series removes that layer. It first moves the MDIO bus locking into the switch regmap via .lock/.unlock callbacks, matching the PCS regmaps, so any path reaching the regmap is serialised automatically. With the wrappers no longer adding locking, the thin mt7530_mii_* indirection is folded away and the remaining accessors are replaced mechanically with the plain regmap API, using the coccinelle semantic patches included in the commit messages. Open-coded register fields are then converted to FIELD_GET/FIELD_PREP. None of this is intended to change behaviour. The last two patches implement .port_fast_age, which flushes dynamically learned MAC entries on topology changes, and .port_change_conduit, which moves a user port's CPU-port affinity at runtime. v3 of this series arrived too close to the end of the last development cycle and was deferred, hence this respin on top of current net-next. --- v4: * rebase onto current net-next * 5/8: zero the read-back buffer in mt7530_regmap_read() instead of initialising the result variables at every call site, as suggested by Jakub * 6/8: keep MT753X_CTRL_PHY_ADDR() as plain address arithmetic rather than converting it to FIELD_PREP() as suggested in review: the macro computes the MDIO bus address of the switch PHYs, used as the addr argument of bus->read/write and as an iterator base in mt7530_setup_mdio(), not a hardware register field v3: * 5/8: initialise register read-back variables to 0 so a failed regmap_read keeps the previous read-as-zero behaviour, and use u32 for the value in mt7530_setup_port5 * 6/8: name the age timer field AGE_TIMER_MASK and document the corrected ATC_HASH/VTCR_VID field macros * 7/8: serialise the port_fast_age ATC flush under reg_mutex and log on timeout, align a define, and correct the commit message which wrongly claimed per-port parity with b53/realtek * 8/8: populate the netlink extack on rejection and refuse a conduit that lives on a different switch v2: * fix stray 'static void' left-over in 4/8 which had a fix accidentally folded into 5/8 (byte-identical state at 8/8, but bisectability is restored) * extend port_change_conduit op commit message Daniel Golle (8): net: dsa: mt7530: move MDIO bus locking into regmap net: dsa: mt7530: fold mt7530_mii_write/read into mt7530_write/read net: dsa: mt7530: replace mt7530_write with regmap_write net: dsa: mt7530: replace mt7530_rmw/set/clear with regmap API net: dsa: mt7530: replace mt7530_read with regmap_read net: dsa: mt7530: convert to use field accessor macros net: dsa: mt7530: implement port_fast_age net: dsa: mt7530: implement port_change_conduit op drivers/net/dsa/mt7530-mdio.c | 12 +- drivers/net/dsa/mt7530.c | 809 +++++++++++++++++----------------- drivers/net/dsa/mt7530.h | 209 +++++---- 3 files changed, 537 insertions(+), 493 deletions(-) base-commit: ce6b4d3216b63f902bb8e9695ee6c10c83415f65 -- 2.55.0