Commit 55285235 authored by Cristian Birsan's avatar Cristian Birsan Committed by Kleber Sacilotto de Souza

net: usb: lan78xx: Fix suspend/resume PHY register access error

BugLink: https://bugs.launchpad.net/bugs/1858462

[ Upstream commit 20032b63 ]

Lan78xx driver accesses the PHY registers through MDIO bus over USB
connection. When performing a suspend/resume, the PHY registers can be
accessed before the USB connection is resumed. This will generate an
error and will prevent the device to resume correctly.
This patch adds the dependency between the MDIO bus and USB device to
allow correct handling of suspend/resume.

Fixes: ce85e13a ("lan78xx: Update to use phylib instead of mii_if_info.")
Signed-off-by: default avatarCristian Birsan <cristian.birsan@microchip.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 06b71812
...@@ -1448,6 +1448,7 @@ static int lan78xx_mdio_init(struct lan78xx_net *dev) ...@@ -1448,6 +1448,7 @@ static int lan78xx_mdio_init(struct lan78xx_net *dev)
dev->mdiobus->read = lan78xx_mdiobus_read; dev->mdiobus->read = lan78xx_mdiobus_read;
dev->mdiobus->write = lan78xx_mdiobus_write; dev->mdiobus->write = lan78xx_mdiobus_write;
dev->mdiobus->name = "lan78xx-mdiobus"; dev->mdiobus->name = "lan78xx-mdiobus";
dev->mdiobus->parent = &dev->udev->dev;
snprintf(dev->mdiobus->id, MII_BUS_ID_SIZE, "usb-%03d:%03d", snprintf(dev->mdiobus->id, MII_BUS_ID_SIZE, "usb-%03d:%03d",
dev->udev->bus->busnum, dev->udev->devnum); dev->udev->bus->busnum, dev->udev->devnum);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment