* [PATCH net-next 1/2] net: systemport: Fix missing phy-handle parsing for non-fixed PHYs
2026-09-22 22:25 [PATCH net-next 0/2] net: broadcom: Couple of minor changes Florian Fainelli
@ 2026-09-22 22:25 ` Florian Fainelli
2026-09-27 19:39 ` Nicolai Buchwitz
2026-09-22 22:25 ` [PATCH net-next 2/2] net: bcmasp: remove duplicate MDA filter register definitions Florian Fainelli
2026-09-27 10:49 ` [PATCH net-next 0/2] net: broadcom: Couple of minor changes Simon Horman
2 siblings, 1 reply; 6+ messages in thread
From: Florian Fainelli @ 2026-09-22 22:25 UTC (permalink / raw)
To: netdev
Cc: Florian Fainelli, Doug Berger,
Broadcom internal kernel review list, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Zak Kemble, Simon Horman, Ryo Takakura, open list,
Nicolai Buchwitz
In bcm_sysport_probe(), priv->phy_dn is only initialized if the device
tree node has a fixed-link configuration (of_phy_is_fixed_link). When
connecting to a discrete MDIO-attached PHY referenced via 'phy-handle',
priv->phy_dn remains NULL. This causes of_phy_connect() during
bcm_sysport_open() to fail with -ENODEV since of_phy_find_device(NULL)
returns NULL.
Fix this by parsing 'phy-handle' via of_parse_phandle() and falling back
to of_phy_is_fixed_link(). Ensure proper of_node_get() and of_node_put()
refcounting lifecycle on both error unwinding and module remove paths.
Assisted-by: LLM
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
Change-Id: I714a31091e833c87fc766445b90cea53090fcec9
---
drivers/net/ethernet/broadcom/bcmsysport.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
index 4f0ec136b606..8a566b98f486 100644
--- a/drivers/net/ethernet/broadcom/bcmsysport.c
+++ b/drivers/net/ethernet/broadcom/bcmsysport.c
@@ -2522,17 +2522,19 @@ static int bcm_sysport_probe(struct platform_device *pdev)
if (ret)
priv->phy_interface = PHY_INTERFACE_MODE_GMII;
+ priv->phy_dn = of_parse_phandle(dn, "phy-handle", 0);
+
/* In the case of a fixed PHY, the DT node associated
* to the PHY is the Ethernet MAC DT node.
*/
- if (of_phy_is_fixed_link(dn)) {
+ if (!priv->phy_dn && of_phy_is_fixed_link(dn)) {
ret = of_phy_register_fixed_link(dn);
if (ret) {
dev_err(&pdev->dev, "failed to register fixed PHY\n");
goto err_free_netdev;
}
- priv->phy_dn = dn;
+ priv->phy_dn = of_node_get(dn);
}
/* Initialize netdevice members */
@@ -2617,6 +2619,7 @@ static int bcm_sysport_probe(struct platform_device *pdev)
err_deregister_fixed_link:
if (of_phy_is_fixed_link(dn))
of_phy_deregister_fixed_link(dn);
+ of_node_put(priv->phy_dn);
err_free_netdev:
free_netdev(dev);
return ret;
@@ -2635,6 +2638,7 @@ static void bcm_sysport_remove(struct platform_device *pdev)
unregister_netdev(dev);
if (of_phy_is_fixed_link(dn))
of_phy_deregister_fixed_link(dn);
+ of_node_put(priv->phy_dn);
free_netdev(dev);
dev_set_drvdata(&pdev->dev, NULL);
}
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH net-next 1/2] net: systemport: Fix missing phy-handle parsing for non-fixed PHYs
2026-09-22 22:25 ` [PATCH net-next 1/2] net: systemport: Fix missing phy-handle parsing for non-fixed PHYs Florian Fainelli
@ 2026-09-27 19:39 ` Nicolai Buchwitz
0 siblings, 0 replies; 6+ messages in thread
From: Nicolai Buchwitz @ 2026-09-27 19:39 UTC (permalink / raw)
To: Florian Fainelli
Cc: netdev, Doug Berger, Broadcom internal kernel review list,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Zak Kemble, Simon Horman, Ryo Takakura,
linux-kernel
Hi Florian
On 23.9.2026 00:25, Florian Fainelli wrote:
> In bcm_sysport_probe(), priv->phy_dn is only initialized if the device
> tree node has a fixed-link configuration (of_phy_is_fixed_link). When
> connecting to a discrete MDIO-attached PHY referenced via 'phy-handle',
> priv->phy_dn remains NULL. This causes of_phy_connect() during
> bcm_sysport_open() to fail with -ENODEV since of_phy_find_device(NULL)
> returns NULL.
>
> Fix this by parsing 'phy-handle' via of_parse_phandle() and falling
> back
> to of_phy_is_fixed_link(). Ensure proper of_node_get() and
> of_node_put()
> refcounting lifecycle on both error unwinding and module remove paths.
>
> Assisted-by: LLM
> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
> Change-Id: I714a31091e833c87fc766445b90cea53090fcec9
nit: remove gerrit trailer
> [...]
Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>
Thanks,
Nicolai
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH net-next 2/2] net: bcmasp: remove duplicate MDA filter register definitions
2026-09-22 22:25 [PATCH net-next 0/2] net: broadcom: Couple of minor changes Florian Fainelli
2026-09-22 22:25 ` [PATCH net-next 1/2] net: systemport: Fix missing phy-handle parsing for non-fixed PHYs Florian Fainelli
@ 2026-09-22 22:25 ` Florian Fainelli
2026-09-27 19:40 ` Nicolai Buchwitz
2026-09-27 10:49 ` [PATCH net-next 0/2] net: broadcom: Couple of minor changes Simon Horman
2 siblings, 1 reply; 6+ messages in thread
From: Florian Fainelli @ 2026-09-22 22:25 UTC (permalink / raw)
To: netdev
Cc: Florian Fainelli, Doug Berger,
Broadcom internal kernel review list, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Zak Kemble, Simon Horman, Ryo Takakura, open list,
Nicolai Buchwitz
Remove the redundant duplicate definitions of ASP_RX_FILTER_MDA_CFG,
ASP_RX_FILTER_MDA_PAT_H, ASP_RX_FILTER_MDA_PAT_L, ASP_RX_FILTER_MDA_MSK_H,
and ASP_RX_FILTER_MDA_MSK_L in bcmasp.h.
Assisted-by: LLM
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
drivers/net/ethernet/broadcom/asp2/bcmasp.h | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp.h b/drivers/net/ethernet/broadcom/asp2/bcmasp.h
index 8c8ffaeadc79..b08a7ddc4c64 100644
--- a/drivers/net/ethernet/broadcom/asp2/bcmasp.h
+++ b/drivers/net/ethernet/broadcom/asp2/bcmasp.h
@@ -80,11 +80,6 @@
#define ASP_RX_FILTER_MDA_PAT_L(sel) (((sel) * 0x14) + 0x108)
#define ASP_RX_FILTER_MDA_MSK_H(sel) (((sel) * 0x14) + 0x10c)
#define ASP_RX_FILTER_MDA_MSK_L(sel) (((sel) * 0x14) + 0x110)
-#define ASP_RX_FILTER_MDA_CFG(sel) (((sel) * 0x14) + 0x100)
-#define ASP_RX_FILTER_MDA_PAT_H(sel) (((sel) * 0x14) + 0x104)
-#define ASP_RX_FILTER_MDA_PAT_L(sel) (((sel) * 0x14) + 0x108)
-#define ASP_RX_FILTER_MDA_MSK_H(sel) (((sel) * 0x14) + 0x10c)
-#define ASP_RX_FILTER_MDA_MSK_L(sel) (((sel) * 0x14) + 0x110)
#define ASP_RX_FILTER_NET_CFG(sel) (((sel) * 0xa04) + 0x400)
#define ASP_RX_FILTER_NET_CFG_CH(sel) ((sel) << 0)
#define ASP_RX_FILTER_NET_CFG_EN BIT(9)
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next 2/2] net: bcmasp: remove duplicate MDA filter register definitions
2026-09-22 22:25 ` [PATCH net-next 2/2] net: bcmasp: remove duplicate MDA filter register definitions Florian Fainelli
@ 2026-09-27 19:40 ` Nicolai Buchwitz
0 siblings, 0 replies; 6+ messages in thread
From: Nicolai Buchwitz @ 2026-09-27 19:40 UTC (permalink / raw)
To: Florian Fainelli
Cc: netdev, Doug Berger, Broadcom internal kernel review list,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Zak Kemble, Simon Horman, Ryo Takakura,
linux-kernel
On 23.9.2026 00:25, Florian Fainelli wrote:
> Remove the redundant duplicate definitions of ASP_RX_FILTER_MDA_CFG,
> ASP_RX_FILTER_MDA_PAT_H, ASP_RX_FILTER_MDA_PAT_L,
> ASP_RX_FILTER_MDA_MSK_H,
> and ASP_RX_FILTER_MDA_MSK_L in bcmasp.h.
>
> Assisted-by: LLM
> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
> ---
> drivers/net/ethernet/broadcom/asp2/bcmasp.h | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp.h
> b/drivers/net/ethernet/broadcom/asp2/bcmasp.h
> index 8c8ffaeadc79..b08a7ddc4c64 100644
> --- a/drivers/net/ethernet/broadcom/asp2/bcmasp.h
> +++ b/drivers/net/ethernet/broadcom/asp2/bcmasp.h
> @@ -80,11 +80,6 @@
> #define ASP_RX_FILTER_MDA_PAT_L(sel) (((sel) * 0x14) + 0x108)
> #define ASP_RX_FILTER_MDA_MSK_H(sel) (((sel) * 0x14) + 0x10c)
> #define ASP_RX_FILTER_MDA_MSK_L(sel) (((sel) * 0x14) + 0x110)
> -#define ASP_RX_FILTER_MDA_CFG(sel) (((sel) * 0x14) + 0x100)
> -#define ASP_RX_FILTER_MDA_PAT_H(sel) (((sel) * 0x14) + 0x104)
> -#define ASP_RX_FILTER_MDA_PAT_L(sel) (((sel) * 0x14) + 0x108)
> -#define ASP_RX_FILTER_MDA_MSK_H(sel) (((sel) * 0x14) + 0x10c)
> -#define ASP_RX_FILTER_MDA_MSK_L(sel) (((sel) * 0x14) + 0x110)
> #define ASP_RX_FILTER_NET_CFG(sel) (((sel) * 0xa04) + 0x400)
> #define ASP_RX_FILTER_NET_CFG_CH(sel) ((sel) << 0)
> #define ASP_RX_FILTER_NET_CFG_EN BIT(9)
Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>
Thanks,
Nicolai
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next 0/2] net: broadcom: Couple of minor changes
2026-09-22 22:25 [PATCH net-next 0/2] net: broadcom: Couple of minor changes Florian Fainelli
2026-09-22 22:25 ` [PATCH net-next 1/2] net: systemport: Fix missing phy-handle parsing for non-fixed PHYs Florian Fainelli
2026-09-22 22:25 ` [PATCH net-next 2/2] net: bcmasp: remove duplicate MDA filter register definitions Florian Fainelli
@ 2026-09-27 10:49 ` Simon Horman
2 siblings, 0 replies; 6+ messages in thread
From: Simon Horman @ 2026-09-27 10:49 UTC (permalink / raw)
To: Florian Fainelli
Cc: netdev, Doug Berger, Broadcom internal kernel review list,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Zak Kemble, Ryo Takakura, open list,
Nicolai Buchwitz
On Tue, Sep 22, 2026 at 03:25:23PM -0700, Florian Fainelli wrote:
> The first change makes sure there is proper reference counting handling
> in case of error/removal for the bcmsysport driver.
>
> The second change removes duplicates definitions in the ASP2 driver.
>
> Florian Fainelli (2):
> net: systemport: Fix missing phy-handle parsing for non-fixed PHYs
> net: bcmasp: remove duplicate MDA filter register definitions
For the series:
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 6+ messages in thread