Re: [PATCH v2 net] net: dsa: sja1105: protect link replay helpers against NULL phylink instance
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
Date: 2026-02-18 16:21:57
Also in:
lkml
On Wed, Feb 18, 2026 at 06:10:37PM +0200, Vladimir Oltean wrote:
On Wed, Feb 18, 2026 at 04:08:17PM +0000, Russell King (Oracle) wrote:quoted
On Wed, Feb 18, 2026 at 06:05:51PM +0200, Vladimir Oltean wrote:quoted
There are multiple levels at which this could be avoided: - add an "if (dp->pl)" in sja1105_static_config_reload() - make the phylink replay helpers NULL-tolerant - mark ports as DSA_PORT_TYPE_UNUSED after dsa_port_phylink_destroy() has run, such that subsequent dsa_switch_for_each_available_port() iterations skip them - disconnect the entire switch at once from switchdev and NETDEV_CHANGEUPPER events while unbinding, not just port by port, likely using a "ds->unbinding = true" mechanism or similar however options 3 and 4 are quite heavy and might have side effects. Although 2 allows to keep the driver simpler, the phylink API it not NULL-tolerant in general and is not responsible for the NULL pointer (this is something done by dsa_port_phylink_destroy()). So I went with 1.^^^^^^^^quoted
v1->v2: select option 1 instead of 2Given this, I think the paragraph above needs updating.Sorry, I don't understand what needs updating.
Oh, you rearranged the options, which makes this changelog comment wrong. You're still going with option 1, but you've swapped what was option 1 and option 2. So, the changelog comment should be: v1->v2: implement option 2 in the original submission, swapping their order so it becomes option 1. since "select option 1 instead of 2" is ambiguous (obviously) because it doesn't state whether these refer to the initial patch or this patch. I assumed they were referring to the options on this patch, that the options hadn't changed, and thus "So, I went with option 1" was an error. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!