* [PATCH net v2] net: dsa: motorcomm: Isolate all ports during chip setup
@ 2026-10-25 14:48 David Yang
2026-10-25 14:51 ` netdev-bot+sinfo
2026-10-26 0:50 ` Andrew Lunn
0 siblings, 2 replies; 3+ messages in thread
From: David Yang @ 2026-10-25 14:48 UTC (permalink / raw)
To: netdev
Cc: David Yang, Andrew Lunn, Vladimir Oltean, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, linux-kernel
The chip setup only blocked unknown unicast and unknown multicast
frames, known multicast and broadcast were left open (though the former
cannot appear while the FDB is still empty). Before port_setup() runs,
broadcast frames received on a port flood out of the other ports.
Close the window by fully isolating every port right after the hardware
reset.
Fixes: 186623f4aa72 ("net: dsa: yt921x: Add support for Motorcomm YT921x")
Signed-off-by: David Yang <mmyangfl@gmail.com>
---
v2:
- reword and reduce code changes
v1: https://lore.kernel.org/r/20261024144023.1010237-1-mmyangfl@gmail.com
drivers/net/dsa/motorcomm/chip.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/net/dsa/motorcomm/chip.c b/drivers/net/dsa/motorcomm/chip.c
index d4fc20c52a58..08a880867ee1 100644
--- a/drivers/net/dsa/motorcomm/chip.c
+++ b/drivers/net/dsa/motorcomm/chip.c
@@ -2221,6 +2221,7 @@ static int yt921x_chip_reset(struct yt921x_priv *priv)
{
struct device *dev = yt921x_priv_to_device(priv);
u16 eth_p_tag;
+ u32 ctrl;
u32 val;
int res;
@@ -2258,6 +2259,17 @@ static int yt921x_chip_reset(struct yt921x_priv *priv)
return -EINVAL;
}
+ /* Block all traffic as soon as we reset the hardware since it now acts
+ * as a dump switch.
+ */
+ for (int port = 0; port < YT921X_PORT_NUM; port++) {
+ ctrl = ~(u32)0;
+ res = yt921x_reg_write(priv, YT921X_PORTn_ISOLATION(port),
+ ctrl);
+ if (res)
+ return res;
+ }
+
return 0;
}
--
2.53.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net v2] net: dsa: motorcomm: Isolate all ports during chip setup
2026-10-25 14:48 [PATCH net v2] net: dsa: motorcomm: Isolate all ports during chip setup David Yang
@ 2026-10-25 14:51 ` netdev-bot+sinfo
2026-10-26 0:50 ` Andrew Lunn
1 sibling, 0 replies; 3+ messages in thread
From: netdev-bot+sinfo @ 2026-10-25 14:51 UTC (permalink / raw)
To: David Yang
Cc: netdev, Andrew Lunn, Vladimir Oltean, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, linux-kernel
Hi!
This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:
- How the issue was discovered, e.g. hit in production, hit during
development, syzbot report, manual code inspection, LLM or static
analysis tool scan.
- Whether the issue was actually triggered, or is only theoretical
(e.g. found by code inspection). If it was triggered please include
the symptoms, like the stack trace or error messages.
Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account. If the series needs another revision for
other reasons, please include the information in the commit messages
then.
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net v2] net: dsa: motorcomm: Isolate all ports during chip setup
2026-10-25 14:48 [PATCH net v2] net: dsa: motorcomm: Isolate all ports during chip setup David Yang
2026-10-25 14:51 ` netdev-bot+sinfo
@ 2026-10-26 0:50 ` Andrew Lunn
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2026-10-26 0:50 UTC (permalink / raw)
To: David Yang
Cc: netdev, Vladimir Oltean, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, linux-kernel
On Sun, Oct 25, 2026 at 10:48:31PM +0800, David Yang wrote:
> The chip setup only blocked unknown unicast and unknown multicast
> frames, known multicast and broadcast were left open (though the former
> cannot appear while the FDB is still empty). Before port_setup() runs,
> broadcast frames received on a port flood out of the other ports.
>
> Close the window by fully isolating every port right after the hardware
> reset.
>
> Fixes: 186623f4aa72 ("net: dsa: yt921x: Add support for Motorcomm YT921x")
> Signed-off-by: David Yang <mmyangfl@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-26 0:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-25 14:48 [PATCH net v2] net: dsa: motorcomm: Isolate all ports during chip setup David Yang
2026-10-25 14:51 ` netdev-bot+sinfo
2026-10-26 0:50 ` Andrew Lunn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®