Skip to content

Commit 4faff70

Browse files
Xu YangPaolo Abeni
authored andcommitted
net: usb: asix_devices: add phy_mask for ax88772 mdio bus
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/[email protected] Fixes: e532a09 ("net: usb: asix: ax88772: add phylib support") Cc: [email protected] Signed-off-by: Xu Yang <[email protected]> Tested-by: Oleksij Rempel <[email protected]> Reviewed-by: Oleksij Rempel <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 52565a9 commit 4faff70

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/net/usb/asix_devices.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,7 @@ static int ax88772_init_mdio(struct usbnet *dev)
676676
priv->mdio->read = &asix_mdio_bus_read;
677677
priv->mdio->write = &asix_mdio_bus_write;
678678
priv->mdio->name = "Asix MDIO Bus";
679+
priv->mdio->phy_mask = ~(BIT(priv->phy_addr) | BIT(AX_EMBD_PHY_ADDR));
679680
/* mii bus name is usb-<usb bus number>-<usb device number> */
680681
snprintf(priv->mdio->id, MII_BUS_ID_SIZE, "usb-%03d:%03d",
681682
dev->udev->bus->busnum, dev->udev->devnum);

0 commit comments

Comments
 (0)