Re: [PATCH 15/30] iwlwifi: mvm: reprobe device on firmware error during restart
From: Eliad Peller <hidden>
Date: 2013-07-30 21:56:10
On Fri, Jul 26, 2013 at 11:28 AM, Johannes Berg [off-list ref] wrote:
From: Johannes Berg <redacted> If we get a firmware error during restart, we currently abandon any hope and simply fail, getting stuck until the driver is reloaded. Unfortunately, there isn't really much else we can do since restart will likely continue to fail, and asking mac80211 for disconnection just causes more error. To allow the user to at least set up the device again completely from scratch, reprobe the device and in doing so completely destroy any mac80211/driver state. Reviewed-by: Emmanuel Grumbach <redacted> Signed-off-by: Johannes Berg <redacted> ---
[...]
+ /*
+ * get a module reference to avoid doing this while unloading
+ * anyway and to avoid scheduling a work with code that's
+ * being removed.
+ */
+ if (!try_module_get(THIS_MODULE)) {
+ IWL_ERR(mvm, "Module is being unloaded - abort\n");
+ return;
+ }
+
+ reprobe = kzalloc(sizeof(*reprobe), GFP_ATOMIC);
+ if (!reprobe)
+ return;missing module_put() :) Eliad.