Skip to content

Commit

Permalink
usbnet: smsc95xx: disable carrier check while suspending
Browse files Browse the repository at this point in the history
[ Upstream commit 7b900ea ]

We need to make sure, that the carrier check polling is disabled
while suspending. Otherwise we can end up with usbnet_read_cmd()
being issued when only usbnet_read_cmd_nopm() is allowed. If this
happens, read operations lock up.

Fixes: d69d169 ("usbnet: smsc95xx: fix link detection for disabled autonegotiation")
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Raghuram Chary J <RaghuramChary.Jallipalli@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Frieder Schrempf authored and Greg Kroah-Hartman committed Nov 23, 2018
1 parent 36b0575 commit 520d564
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/net/usb/smsc95xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1600,6 +1600,8 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message)
return ret;
}

cancel_delayed_work_sync(&pdata->carrier_check);

if (pdata->suspend_flags) {
netdev_warn(dev->net, "error during last resume\n");
pdata->suspend_flags = 0;
Expand Down Expand Up @@ -1842,6 +1844,11 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message)
*/
if (ret && PMSG_IS_AUTO(message))
usbnet_resume(intf);

if (ret)
schedule_delayed_work(&pdata->carrier_check,
CARRIER_CHECK_DELAY);

return ret;
}

Expand Down

0 comments on commit 520d564

Please sign in to comment.