patches.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	patches@lists.linux.dev,
	Vladimir Oltean <vladimir.oltean@nxp.com>,
	Daniel Golle <daniel@makrotopia.org>,
	Paolo Abeni <pabeni@redhat.com>, Sasha Levin <sashal@kernel.org>
Subject: [PATCH 6.6 49/91] net: dsa: lantiq_gswip: move gswip_add_single_port_br() call to port_setup()
Date: Tue, 30 Sep 2025 16:47:48 +0200	[thread overview]
Message-ID: <20250930143823.213724157@linuxfoundation.org> (raw)
In-Reply-To: <20250930143821.118938523@linuxfoundation.org>

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Vladimir Oltean <vladimir.oltean@nxp.com>

[ Upstream commit c0054b25e2f1045f47b4954cf13a539e5e6047df ]

A port added to a "single port bridge" operates as standalone, and this
is mutually exclusive to being part of a Linux bridge. In fact,
gswip_port_bridge_join() calls gswip_add_single_port_br() with
add=false, i.e. removes the port from the "single port bridge" to enable
autonomous forwarding.

The blamed commit seems to have incorrectly thought that ds->ops->port_enable()
is called one time per port, during the setup phase of the switch.

However, it is actually called during the ndo_open() implementation of
DSA user ports, which is to say that this sequence of events:

1. ip link set swp0 down
2. ip link add br0 type bridge
3. ip link set swp0 master br0
4. ip link set swp0 up

would cause swp0 to join back the "single port bridge" which step 3 had
just removed it from.

The correct DSA hook for one-time actions per port at switch init time
is ds->ops->port_setup(). This is what seems to match the coder's
intention; also see the comment at the beginning of the file:

 * At the initialization the driver allocates one bridge table entry for
   ~~~~~~~~~~~~~~~~~~~~~
 * each switch port which is used when the port is used without an
 * explicit bridge.

Fixes: 8206e0ce96b3 ("net: dsa: lantiq: Add VLAN unaware bridge offloading")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://patch.msgid.link/20250918072142.894692-2-vladimir.oltean@nxp.com
Tested-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/dsa/lantiq_gswip.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswip.c
index a2b10b28c11fa..054548294f039 100644
--- a/drivers/net/dsa/lantiq_gswip.c
+++ b/drivers/net/dsa/lantiq_gswip.c
@@ -682,18 +682,27 @@ static int gswip_add_single_port_br(struct gswip_priv *priv, int port, bool add)
 	return 0;
 }
 
-static int gswip_port_enable(struct dsa_switch *ds, int port,
-			     struct phy_device *phydev)
+static int gswip_port_setup(struct dsa_switch *ds, int port)
 {
 	struct gswip_priv *priv = ds->priv;
 	int err;
 
 	if (!dsa_is_cpu_port(ds, port)) {
-		u32 mdio_phy = 0;
-
 		err = gswip_add_single_port_br(priv, port, true);
 		if (err)
 			return err;
+	}
+
+	return 0;
+}
+
+static int gswip_port_enable(struct dsa_switch *ds, int port,
+			     struct phy_device *phydev)
+{
+	struct gswip_priv *priv = ds->priv;
+
+	if (!dsa_is_cpu_port(ds, port)) {
+		u32 mdio_phy = 0;
 
 		if (phydev)
 			mdio_phy = phydev->mdio.addr & GSWIP_MDIO_PHY_ADDR_MASK;
@@ -1813,6 +1822,7 @@ static int gswip_get_sset_count(struct dsa_switch *ds, int port, int sset)
 static const struct dsa_switch_ops gswip_xrx200_switch_ops = {
 	.get_tag_protocol	= gswip_get_tag_protocol,
 	.setup			= gswip_setup,
+	.port_setup		= gswip_port_setup,
 	.port_enable		= gswip_port_enable,
 	.port_disable		= gswip_port_disable,
 	.port_bridge_join	= gswip_port_bridge_join,
-- 
2.51.0




  parent reply	other threads:[~2025-09-30 15:23 UTC|newest]

Thread overview: 103+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-30 14:46 [PATCH 6.6 00/91] 6.6.109-rc1 review Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 01/91] scsi: ufs: mcq: Fix memory allocation checks for SQE and CQE Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 02/91] firewire: core: fix overlooked update of subsystem ABI version Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 03/91] ALSA: usb-audio: Fix block comments in mixer_quirks Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 04/91] ALSA: usb-audio: Drop unnecessary parentheses " Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 05/91] ALSA: usb-audio: Avoid multiple assignments " Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 06/91] ALSA: usb-audio: Simplify NULL comparison " Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 07/91] ALSA: usb-audio: Remove unneeded wmb() " Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 08/91] ALSA: usb-audio: Add mixer quirk for Sony DualSense PS5 Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 09/91] HID: multitouch: Get the contact ID from HID_DG_TRANSDUCER_INDEX fields in case of Apple Touch Bar Greg Kroah-Hartman
2025-09-30 15:26   ` Aditya Garg
2025-09-30 14:47 ` [PATCH 6.6 10/91] HID: multitouch: support getting the tip state from HID_DG_TOUCH fields in " Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 11/91] HID: multitouch: take cls->maxcontacts into account for Apple Touch Bar even without a HID_DG_CONTACTMAX field Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 12/91] HID: multitouch: specify that Apple Touch Bar is direct Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 13/91] ALSA: usb-audio: Convert comma to semicolon Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 14/91] ALSA: usb-audio: Fix build with CONFIG_INPUT=n Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 15/91] usb: core: Add 0x prefix to quirks debug output Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 16/91] mmc: sdhci-cadence: add Mobileye eyeQ support Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 17/91] i2c: designware: Add quirk for Intel Xe Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 18/91] ALSA: usb-audio: Add DSD support for Comtrue USB Audio device Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 19/91] ALSA: usb-audio: move mixer_quirks min_mute into common quirk Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 20/91] ALSA: usb-audio: Add mute TLV for playback volumes on more devices Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 21/91] IB/mlx5: Fix obj_type mismatch for SRQ event subscriptions Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 22/91] mm/gup: revert "mm: gup: fix infinite loop within __get_longterm_locked" Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 23/91] mm: add folio_expected_ref_count() for reference count calculation Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 24/91] mm/gup: check ref_count instead of lru before migration Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 25/91] mm/gup: local lru_add_drain() to avoid lru_add_drain_all() Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 26/91] mm: folio_may_be_lru_cached() unless folio_test_large() Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 27/91] arm64: dts: imx8mp: Correct thermal sensor index Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 28/91] ARM: dts: kirkwood: Fix sound DAI cells for OpenRD clients Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 29/91] cpufreq: Initialize cpufreq-based invariance before subsys Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 30/91] smb: server: dont use delayed_work for post_recv_credits_work Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 31/91] wifi: virt_wifi: Fix page fault on connect Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 32/91] can: rcar_can: rcar_can_resume(): fix s2ram with PSCI Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 33/91] bpf: Reject bpf_timer for PREEMPT_RT Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 34/91] xfrm: xfrm_alloc_spi shouldnt use 0 as SPI Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 35/91] can: etas_es58x: populate ndo_change_mtu() to prevent buffer overflow Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 36/91] can: hi311x: " Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 37/91] can: sun4i_can: " Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 38/91] can: mcba_usb: " Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 39/91] can: peak_usb: fix shift-out-of-bounds issue Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 40/91] ethernet: rvu-af: Remove slash from the driver name Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 41/91] Bluetooth: hci_sync: Fix hci_resume_advertising_sync Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 42/91] Bluetooth: hci_event: Fix UAF in hci_acl_create_conn_sync Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 43/91] vhost: Take a reference on the task in struct vhost_task Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 44/91] bnxt_en: correct offset handling for IPv6 destination address Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 45/91] net: allow alloc_skb_with_frags() to use MAX_SKB_FRAGS Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 46/91] nexthop: Forbid FDB status change while nexthop is in a group Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 47/91] selftests: fib_nexthops: Fix creation of non-FDB nexthops Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 48/91] net: dsa: lantiq_gswip: do also enable or disable cpu port Greg Kroah-Hartman
2025-09-30 14:47 ` Greg Kroah-Hartman [this message]
2025-09-30 14:47 ` [PATCH 6.6 50/91] net: dsa: lantiq_gswip: suppress -EINVAL errors for bridge FDB entries added to the CPU port Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 51/91] octeontx2-pf: Fix potential use after free in otx2_tc_add_flow() Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 52/91] drm/gma500: Fix null dereference in hdmi teardown Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 53/91] futex: Prevent use-after-free during requeue-PI Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 54/91] smb: client: fix wrong index reference in smb2_compound_op() Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 55/91] HID: asus: add support for missing PX series fn keys Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 56/91] i40e: fix idx validation in i40e_validate_queue_map Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 57/91] i40e: fix idx validation in config queues msg Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 58/91] i40e: fix input validation logic for action_meta Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 59/91] i40e: fix validation of VF state in get resources Greg Kroah-Hartman
2025-09-30 14:47 ` [PATCH 6.6 60/91] i40e: add max boundary check for VF filters Greg Kroah-Hartman
2025-09-30 14:48 ` [PATCH 6.6 61/91] i40e: add mask to apply valid bits for itr_idx Greg Kroah-Hartman
2025-09-30 14:48 ` [PATCH 6.6 62/91] i40e: improve VF MAC filters accounting Greg Kroah-Hartman
2025-09-30 14:48 ` [PATCH 6.6 63/91] crypto: af_alg - Fix incorrect boolean values in af_alg_ctx Greg Kroah-Hartman
2025-09-30 14:48 ` [PATCH 6.6 64/91] tracing: dynevent: Add a missing lockdown check on dynevent Greg Kroah-Hartman
2025-09-30 14:48 ` [PATCH 6.6 65/91] ARM: dts: socfpga: sodia: Fix mdio bus probe and PHY address Greg Kroah-Hartman
2025-09-30 14:48 ` [PATCH 6.6 66/91] afs: Fix potential null pointer dereference in afs_put_server Greg Kroah-Hartman
2025-09-30 14:48 ` [PATCH 6.6 67/91] kmsan: fix out-of-bounds access to shadow memory Greg Kroah-Hartman
2025-09-30 14:48 ` [PATCH 6.6 68/91] mm/hugetlb: fix folio is still mapped when deleted Greg Kroah-Hartman
2025-09-30 14:48 ` [PATCH 6.6 69/91] fbcon: fix integer overflow in fbcon_do_set_font Greg Kroah-Hartman
2025-09-30 14:48 ` [PATCH 6.6 70/91] fbcon: Fix OOB access in font allocation Greg Kroah-Hartman
2025-09-30 14:48 ` [PATCH 6.6 71/91] s390/cpum_cf: Fix uninitialized warning after backport of ce971233242b Greg Kroah-Hartman
2025-09-30 14:48 ` [PATCH 6.6 72/91] ARM: bcm: Select ARM_GIC_V3 for ARCH_BRCMSTB Greg Kroah-Hartman
2025-09-30 14:48 ` [PATCH 6.6 73/91] mm: migrate_device: use more folio in migrate_device_finalize() Greg Kroah-Hartman
2025-09-30 14:48 ` [PATCH 6.6 74/91] mm/migrate_device: dont add folio to be freed to LRU " Greg Kroah-Hartman
2025-09-30 14:48 ` [PATCH 6.6 75/91] loop: Avoid updating block size under exclusive owner Greg Kroah-Hartman
2025-09-30 14:48 ` [PATCH 6.6 76/91] gpiolib: Extend software-node support to support secondary software-nodes Greg Kroah-Hartman
2025-09-30 14:48 ` [PATCH 6.6 77/91] drm/ast: Use msleep instead of mdelay for edid read Greg Kroah-Hartman
2025-09-30 14:48 ` [PATCH 6.6 78/91] i40e: increase max descriptors for XL710 Greg Kroah-Hartman
2025-09-30 14:48 ` [PATCH 6.6 79/91] i40e: add validation for ring_len param Greg Kroah-Hartman
2025-09-30 14:48 ` [PATCH 6.6 80/91] minmax: make generic MIN() and MAX() macros available everywhere Greg Kroah-Hartman
2025-09-30 14:48 ` [PATCH 6.6 81/91] minmax: simplify min()/max()/clamp() implementation Greg Kroah-Hartman
2025-09-30 14:48 ` [PATCH 6.6 82/91] minmax: dont use max() in situations that want a C constant expression Greg Kroah-Hartman
2025-09-30 14:48 ` [PATCH 6.6 83/91] minmax: improve macro expansion and type checking Greg Kroah-Hartman
2025-09-30 14:48 ` [PATCH 6.6 84/91] minmax: fix up min3() and max3() too Greg Kroah-Hartman
2025-09-30 14:48 ` [PATCH 6.6 85/91] minmax.h: add whitespace around operators and after commas Greg Kroah-Hartman
2025-09-30 14:48 ` [PATCH 6.6 86/91] minmax.h: update some comments Greg Kroah-Hartman
2025-09-30 14:48 ` [PATCH 6.6 87/91] minmax.h: reduce the #define expansion of min(), max() and clamp() Greg Kroah-Hartman
2025-09-30 14:48 ` [PATCH 6.6 88/91] minmax.h: use BUILD_BUG_ON_MSG() for the lo < hi test in clamp() Greg Kroah-Hartman
2025-09-30 14:48 ` [PATCH 6.6 89/91] minmax.h: move all the clamp() definitions after the min/max() ones Greg Kroah-Hartman
2025-09-30 14:48 ` [PATCH 6.6 90/91] minmax.h: simplify the variants of clamp() Greg Kroah-Hartman
2025-09-30 14:48 ` [PATCH 6.6 91/91] minmax.h: remove some #defines that are only expanded once Greg Kroah-Hartman
2025-09-30 18:37 ` [PATCH 6.6 00/91] 6.6.109-rc1 review Florian Fainelli
2025-09-30 18:49 ` Brett A C Sheffield
2025-09-30 19:56 ` [PATCH 6.6 00/91] " Peter Schneider
2025-10-01  2:57 ` Ron Economos
2025-10-01  9:11 ` Jon Hunter
2025-10-01  9:12 ` Jon Hunter
2025-10-01 10:15 ` Mark Brown
2025-10-01 10:22 ` Naresh Kamboju
2025-10-01 16:08 ` Shuah Khan
2025-10-01 17:20 ` Miguel Ojeda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250930143823.213724157@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=daniel@makrotopia.org \
    --cc=pabeni@redhat.com \
    --cc=patches@lists.linux.dev \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=vladimir.oltean@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).