Commit 3e96cd2
net: usb: asix: hold PM usage ref to avoid PM/MDIO + RTNL deadlock
commit 3d3c4cd upstream.
Prevent USB runtime PM (autosuspend) for AX88772* in bind.
usbnet enables runtime PM (autosuspend) by default, so disabling it via
the usb_driver flag is ineffective. On AX88772B, autosuspend shows no
measurable power saving with current driver (no link partner, admin
up/down). The ~0.453 W -> ~0.248 W drop on v6.1 comes from phylib powering
the PHY off on admin-down, not from USB autosuspend.
The real hazard is that with runtime PM enabled, ndo_open() (under RTNL)
may synchronously trigger autoresume (usb_autopm_get_interface()) into
asix_resume() while the USB PM lock is held. Resume paths then invoke
phylink/phylib and MDIO, which also expect RTNL, leading to possible
deadlocks or PM lock vs MDIO wake issues.
To avoid this, keep the device runtime-PM active by taking a usage
reference in ax88772_bind() and dropping it in unbind(). A non-zero PM
usage count blocks runtime suspend regardless of userspace policy
(.../power/control - pm_runtime_allow/forbid), making this approach
robust against sysfs overrides.
Holding a runtime-PM usage ref does not affect system-wide suspend;
system sleep/resume callbacks continue to run as before.
Fixes: 4a2c721 ("net: usb: asix: ax88772: manage PHY PM from MAC")
Reported-by: Hubert Wiśniewski <[email protected]>
Closes: https://lore.kernel.org/all/[email protected]
Tested-by: Hubert Wiśniewski <[email protected]>
Reported-by: Marek Szyprowski <[email protected]>
Closes: https://lore.kernel.org/all/[email protected]
Cc: [email protected]
Signed-off-by: Oleksij Rempel <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Paolo Abeni <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>1 parent e60d556 commit 3e96cd2
1 file changed
+29
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
625 | 625 | | |
626 | 626 | | |
627 | 627 | | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
628 | 643 | | |
629 | 644 | | |
630 | 645 | | |
| |||
922 | 937 | | |
923 | 938 | | |
924 | 939 | | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
925 | 947 | | |
926 | 948 | | |
927 | 949 | | |
| |||
951 | 973 | | |
952 | 974 | | |
953 | 975 | | |
| 976 | + | |
| 977 | + | |
954 | 978 | | |
955 | 979 | | |
956 | 980 | | |
| |||
1575 | 1599 | | |
1576 | 1600 | | |
1577 | 1601 | | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
1578 | 1607 | | |
1579 | 1608 | | |
1580 | 1609 | | |
| |||
0 commit comments