net: usb: asix: replace mii_nway_restart in resume path
authorAlexander Couzens <lynxis@fe80.eu>
Tue, 17 Jul 2018 11:17:09 +0000 (13:17 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Jul 2018 09:24:02 +0000 (11:24 +0200)
commitc439f620382a2cb0c9df3609e180f59d3ff2ee10
tree8ef77f35d1cb484f5d0bf2e8f8a5966c21fefa52
parentdd08f4e69154625200efa7a239ba1147b2d04db9
net: usb: asix: replace mii_nway_restart in resume path

[ Upstream commit 5c968f48021a9b3faa61ac2543cfab32461c0e05 ]

mii_nway_restart is not pm aware which results in a rtnl deadlock.
Implement mii_nway_restart manual by setting BMCR_ANRESTART if
BMCR_ANENABLE is set.

To reproduce:
* plug an asix based usb network interface
* wait until the device enters PM (~5 sec)
* `ip link set eth1 up` will never return

Fixes: d9fe64e51114 ("net: asix: Add in_pm parameter")
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/usb/asix_devices.c