* [PATCH v2] net: usb: asix_devices: add phy_mask for ax88772 mdio bus
@ 2025-08-11 9:29 Xu Yang
2025-08-13 23:36 ` Jakub Kicinski
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Xu Yang @ 2025-08-11 9:29 UTC (permalink / raw)
To: andrew+netdev, davem, edumazet, kuba, pabeni, max.schulze,
khalasa, o.rempel
Cc: linux-usb, netdev, imx
Without setting phy_mask for ax88772 mdio bus, current driver may create
at most 32 mdio phy devices with phy address range from 0x00 ~ 0x1f.
DLink DUB-E100 H/W Ver B1 is such a device. However, only one main phy
device will bind to net phy driver. This is creating issue during system
suspend/resume since phy_polling_mode() in phy_state_machine() will
directly deference member of phydev->drv for non-main phy devices. Then
NULL pointer dereference issue will occur. Due to only external phy or
internal phy is necessary, add phy_mask for ax88772 mdio bus to workarnoud
the issue.
Closes: https://lore.kernel.org/netdev/20250806082931.3289134-1-xu.yang_2@nxp.com
Fixes: e532a096be0e ("net: usb: asix: ax88772: add phylib support")
Cc: stable@vger.kernel.org
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
---
Changes in v2:
- fix the issue in asix_devices driver
---
drivers/net/usb/asix_devices.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c
index ac28f5fe7ac2..8d50b2c7e1be 100644
--- a/drivers/net/usb/asix_devices.c
+++ b/drivers/net/usb/asix_devices.c
@@ -676,6 +676,7 @@ static int ax88772_init_mdio(struct usbnet *dev)
priv->mdio->read = &asix_mdio_bus_read;
priv->mdio->write = &asix_mdio_bus_write;
priv->mdio->name = "Asix MDIO Bus";
+ priv->mdio->phy_mask = ~(BIT(priv->phy_addr) | BIT(AX_EMBD_PHY_ADDR));
/* mii bus name is usb-<usb bus number>-<usb device number> */
snprintf(priv->mdio->id, MII_BUS_ID_SIZE, "usb-%03d:%03d",
dev->udev->bus->busnum, dev->udev->devnum);
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] net: usb: asix_devices: add phy_mask for ax88772 mdio bus
2025-08-11 9:29 [PATCH v2] net: usb: asix_devices: add phy_mask for ax88772 mdio bus Xu Yang
@ 2025-08-13 23:36 ` Jakub Kicinski
2025-08-14 6:48 ` Oleksij Rempel
2025-08-14 9:50 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Jakub Kicinski @ 2025-08-13 23:36 UTC (permalink / raw)
To: andrew, o.rempel
Cc: Xu Yang, davem, edumazet, pabeni, max.schulze, khalasa, linux-usb,
netdev, imx
On Mon, 11 Aug 2025 17:29:31 +0800 Xu Yang wrote:
> Without setting phy_mask for ax88772 mdio bus, current driver may create
> at most 32 mdio phy devices with phy address range from 0x00 ~ 0x1f.
> DLink DUB-E100 H/W Ver B1 is such a device. However, only one main phy
> device will bind to net phy driver. This is creating issue during system
> suspend/resume since phy_polling_mode() in phy_state_machine() will
> directly deference member of phydev->drv for non-main phy devices. Then
> NULL pointer dereference issue will occur. Due to only external phy or
> internal phy is necessary, add phy_mask for ax88772 mdio bus to workarnoud
> the issue.
Andrew, Oleksij, this looks like v2 of
https://lore.kernel.org/all/20250806082931.3289134-1-xu.yang_2@nxp.com/
are you willing to venture a Review tag here ? :)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] net: usb: asix_devices: add phy_mask for ax88772 mdio bus
2025-08-11 9:29 [PATCH v2] net: usb: asix_devices: add phy_mask for ax88772 mdio bus Xu Yang
2025-08-13 23:36 ` Jakub Kicinski
@ 2025-08-14 6:48 ` Oleksij Rempel
2025-08-14 9:50 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Oleksij Rempel @ 2025-08-14 6:48 UTC (permalink / raw)
To: Xu Yang
Cc: andrew+netdev, davem, edumazet, kuba, pabeni, max.schulze,
khalasa, linux-usb, netdev, imx
On Mon, Aug 11, 2025 at 05:29:31PM +0800, Xu Yang wrote:
> Without setting phy_mask for ax88772 mdio bus, current driver may create
> at most 32 mdio phy devices with phy address range from 0x00 ~ 0x1f.
> DLink DUB-E100 H/W Ver B1 is such a device. However, only one main phy
> device will bind to net phy driver. This is creating issue during system
> suspend/resume since phy_polling_mode() in phy_state_machine() will
> directly deference member of phydev->drv for non-main phy devices. Then
> NULL pointer dereference issue will occur. Due to only external phy or
> internal phy is necessary, add phy_mask for ax88772 mdio bus to workarnoud
> the issue.
>
> Closes: https://lore.kernel.org/netdev/20250806082931.3289134-1-xu.yang_2@nxp.com
> Fixes: e532a096be0e ("net: usb: asix: ax88772: add phylib support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Tested-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Oleksij Rempel <o.rempel@pengutronix.de>
Thank you!
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] net: usb: asix_devices: add phy_mask for ax88772 mdio bus
2025-08-11 9:29 [PATCH v2] net: usb: asix_devices: add phy_mask for ax88772 mdio bus Xu Yang
2025-08-13 23:36 ` Jakub Kicinski
2025-08-14 6:48 ` Oleksij Rempel
@ 2025-08-14 9:50 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-08-14 9:50 UTC (permalink / raw)
To: Xu Yang
Cc: andrew+netdev, davem, edumazet, kuba, pabeni, max.schulze,
khalasa, o.rempel, linux-usb, netdev, imx
Hello:
This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Mon, 11 Aug 2025 17:29:31 +0800 you wrote:
> Without setting phy_mask for ax88772 mdio bus, current driver may create
> at most 32 mdio phy devices with phy address range from 0x00 ~ 0x1f.
> DLink DUB-E100 H/W Ver B1 is such a device. However, only one main phy
> device will bind to net phy driver. This is creating issue during system
> suspend/resume since phy_polling_mode() in phy_state_machine() will
> directly deference member of phydev->drv for non-main phy devices. Then
> NULL pointer dereference issue will occur. Due to only external phy or
> internal phy is necessary, add phy_mask for ax88772 mdio bus to workarnoud
> the issue.
>
> [...]
Here is the summary with links:
- [v2] net: usb: asix_devices: add phy_mask for ax88772 mdio bus
https://git.kernel.org/netdev/net/c/4faff70959d5
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-08-14 9:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-11 9:29 [PATCH v2] net: usb: asix_devices: add phy_mask for ax88772 mdio bus Xu Yang
2025-08-13 23:36 ` Jakub Kicinski
2025-08-14 6:48 ` Oleksij Rempel
2025-08-14 9:50 ` patchwork-bot+netdevbpf
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).