Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mwl8787: add a completion for firmware load callback
If the firmware loader callback is queued before suspend but invoked on resume, we will try to set up the card even though some things like the mmc controller may not be there anymore. This can cause a crash or warnings like the one below. Wait for the callback before leaving remove(). Fixes: [ 112.506713] ------------[ cut here ]------------ [ 112.514282] WARNING: at lib/kobject.c:196 kobject_add_internal+0x1c4/0x230() [ 112.523956] kobject_add_internal failed for phy1 with -EEXIST, don't try to register things with the same name in the same directory. [ 112.536621] Modules linked in: arc4 mwl8787_sdio mac80211 cfg80211 [ 112.541351] CPU: 0 PID: 4 Comm: kworker/0:0 Tainted: G W 3.10.0 #38 [ 112.550781] Workqueue: events request_firmware_work_func [ 112.551239] [<c001b4b4>] (unwind_backtrace+0x0/0x130) from [<c0017b7c>] (show_stack+0x10/0x14) [ 112.565490] [<c0017b7c>] (show_stack+0x10/0x14) from [<c0043890>] (warn_slowpath_common+0x4c/0x68) [ 112.575012] [<c0043890>] (warn_slowpath_common+0x4c/0x68) from [<c0043940>] (warn_slowpath_fmt+0x30/0x40) [ 112.585144] [<c0043940>] (warn_slowpath_fmt+0x30/0x40) from [<c02b7ad4>] (kobject_add_internal+0x1c4/0x230) [ 112.595458] [<c02b7ad4>] (kobject_add_internal+0x1c4/0x230) from [<c02b7d6c>] (kobject_add+0x50/0x98) [ 112.605194] [<c02b7d6c>] (kobject_add+0x50/0x98) from [<c03254f8>] (device_add+0xcc/0x5c4) [ 112.614105] [<c03254f8>] (device_add+0xcc/0x5c4) from [<bf000920>] (wiphy_register+0x408/0x67c [cfg80211]) [ 112.624572] [<bf000920>] (wiphy_register+0x408/0x67c [cfg80211]) from [<bf08e55c>] (ieee80211_register_hw+0x3c4/0x810 [mac80211]) [ 112.637084] [<bf08e55c>] (ieee80211_register_hw+0x3c4/0x810 [mac80211]) from [<bf144df0>] (mwl8787_register+0x10/0x38 [mwl8787_sdio]) [ 112.649810] [<bf144df0>] (mwl8787_register+0x10/0x38 [mwl8787_sdio]) from [<bf146fd8>] (mwl8787_fw_cb+0x64/0x84 [mwl8787_sdio]) [ 112.661926] [<bf146fd8>] (mwl8787_fw_cb+0x64/0x84 [mwl8787_sdio]) from [<c0335da8>] (request_firmware_work_func+0x40/0x64) [ 112.673645] [<c0335da8>] (request_firmware_work_func+0x40/0x64) from [<c005f4b0>] (process_one_work+0x1ac/0x4c8) [ 112.684417] [<c005f4b0>] (process_one_work+0x1ac/0x4c8) from [<c005fc0c>] (worker_thread+0x144/0x3ac) [ 112.694152] [<c005fc0c>] (worker_thread+0x144/0x3ac) from [<c0065b6c>] (kthread+0xa4/0xb0) [ 112.702880] [<c0065b6c>] (kthread+0xa4/0xb0) from [<c0013c28>] (ret_from_fork+0x14/0x2c) [ 112.704925] ---[ end trace 92baea39fd3e9318 ]--- Signed-off-by: Bob Copeland <me@bobcopeland.com>
- Loading branch information