* [PATCH v2] usbnet: smsc95xx: disable carrier check while suspending
@ 2018-10-31 21:52 Frieder Schrempf
2018-11-01 13:58 ` RaghuramChary.Jallipalli
2018-11-03 6:50 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Frieder Schrempf @ 2018-10-31 21:52 UTC (permalink / raw)
To: steve.glendinning, UNGLinuxDriver
Cc: davem, netdev, linux-usb, linux-kernel, Frieder Schrempf, stable
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: d69d169493 ("usbnet: smsc95xx: fix link detection for disabled autonegotiation")
Cc: <stable@vger.kernel.org>
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
---
Changes in v2:
* move cancel_delayed_work_sync() to correct error path
drivers/net/usb/smsc95xx.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 262e7a3..2d17f3b 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -1598,6 +1598,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;
@@ -1840,6 +1842,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;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [PATCH v2] usbnet: smsc95xx: disable carrier check while suspending
2018-10-31 21:52 [PATCH v2] usbnet: smsc95xx: disable carrier check while suspending Frieder Schrempf
@ 2018-11-01 13:58 ` RaghuramChary.Jallipalli
2018-11-03 6:50 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: RaghuramChary.Jallipalli @ 2018-11-01 13:58 UTC (permalink / raw)
To: frieder.schrempf, steve.glendinning, UNGLinuxDriver
Cc: davem, netdev, linux-usb, linux-kernel, stable
> 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: d69d169493 ("usbnet: smsc95xx: fix link detection for disabled
> autonegotiation")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Raghuram Chary J <RaghuramChary.Jallipalli@microchip.com>
-Raghu
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] usbnet: smsc95xx: disable carrier check while suspending
2018-10-31 21:52 [PATCH v2] usbnet: smsc95xx: disable carrier check while suspending Frieder Schrempf
2018-11-01 13:58 ` RaghuramChary.Jallipalli
@ 2018-11-03 6:50 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2018-11-03 6:50 UTC (permalink / raw)
To: frieder.schrempf
Cc: steve.glendinning, UNGLinuxDriver, netdev, linux-usb,
linux-kernel, stable
From: Frieder Schrempf <frieder.schrempf@kontron.de>
Date: Wed, 31 Oct 2018 22:52:19 +0100
> 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: d69d169493 ("usbnet: smsc95xx: fix link detection for disabled autonegotiation")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Applied and queued up for -stable.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-11-03 6:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-31 21:52 [PATCH v2] usbnet: smsc95xx: disable carrier check while suspending Frieder Schrempf
2018-11-01 13:58 ` RaghuramChary.Jallipalli
2018-11-03 6:50 ` 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).