Skip to content

Commit e1957db

Browse files
committed
cfg80211: process events caused by suspend before suspending
When suspending without WoWLAN, cfg80211 will ask drivers to disconnect. Even when the driver does this synchronously, and immediately returns with a notification, cfg80211 schedules the handling thereof to a workqueue, and may then call back into the driver when the driver was already suspended/ing. Fix this by processing all events caused by cfg80211_leave_all() directly after that function returns. The driver still needs to do the right thing here and wait for the firmware response, but that is - at least - true for mwifiex where this occurred. Reported-by: Amitkumar Karwar <[email protected]> Tested-by: Amitkumar Karwar <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
1 parent b4f0fd4 commit e1957db

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

net/wireless/sysfs.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,16 @@ static int wiphy_suspend(struct device *dev)
104104

105105
rtnl_lock();
106106
if (rdev->wiphy.registered) {
107-
if (!rdev->wiphy.wowlan_config)
107+
if (!rdev->wiphy.wowlan_config) {
108108
cfg80211_leave_all(rdev);
109+
cfg80211_process_rdev_events(rdev);
110+
}
109111
if (rdev->ops->suspend)
110112
ret = rdev_suspend(rdev, rdev->wiphy.wowlan_config);
111113
if (ret == 1) {
112114
/* Driver refuse to configure wowlan */
113115
cfg80211_leave_all(rdev);
116+
cfg80211_process_rdev_events(rdev);
114117
ret = rdev_suspend(rdev, NULL);
115118
}
116119
}

0 commit comments

Comments
 (0)