linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: usb: lan78xx: Fix suspend/resume PHY register access error
@ 2019-12-12 11:52 Cristian Birsan
  2019-12-12 18:57 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Cristian Birsan @ 2019-12-12 11:52 UTC (permalink / raw)
  To: woojung.huh, UNGLinuxDriver, davem
  Cc: netdev, linux-usb, linux-kernel, Cristian Birsan

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: ce85e13ad6ef ("lan78xx: Update to use phylib instead of mii_if_info.")
Signed-off-by: Cristian Birsan <cristian.birsan@microchip.com>
---
 drivers/net/usb/lan78xx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
index cf1f3f0a4b9b..d7bf1918ca62 100644
--- a/drivers/net/usb/lan78xx.c
+++ b/drivers/net/usb/lan78xx.c
@@ -1808,6 +1808,7 @@ static int lan78xx_mdio_init(struct lan78xx_net *dev)
 	dev->mdiobus->read = lan78xx_mdiobus_read;
 	dev->mdiobus->write = lan78xx_mdiobus_write;
 	dev->mdiobus->name = "lan78xx-mdiobus";
+	dev->mdiobus->parent = &dev->udev->dev;
 
 	snprintf(dev->mdiobus->id, MII_BUS_ID_SIZE, "usb-%03d:%03d",
 		 dev->udev->bus->busnum, dev->udev->devnum);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: usb: lan78xx: Fix suspend/resume PHY register access error
  2019-12-12 11:52 [PATCH] net: usb: lan78xx: Fix suspend/resume PHY register access error Cristian Birsan
@ 2019-12-12 18:57 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-12-12 18:57 UTC (permalink / raw)
  To: cristian.birsan
  Cc: woojung.huh, UNGLinuxDriver, netdev, linux-usb, linux-kernel

From: Cristian Birsan <cristian.birsan@microchip.com>
Date: Thu, 12 Dec 2019 13:52:47 +0200

> 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: ce85e13ad6ef ("lan78xx: Update to use phylib instead of mii_if_info.")
> Signed-off-by: Cristian Birsan <cristian.birsan@microchip.com>

Applied and queued up for -stable.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-12-12 18:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-12 11:52 [PATCH] net: usb: lan78xx: Fix suspend/resume PHY register access error Cristian Birsan
2019-12-12 18:57 ` David Miller

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).