I don't think this is correct.I did a quick boot test with this patch and didn't find any issues.
I think you should protect the FW_STATUS_LOADING bit too, shouldn't you?
As it is, it does this:
if (test_bit(FW_STATUS_LOADING, &fw_priv->status)) {
mutex_lock(&fw_lock);
...
clear_bit(FW_STATUS_LOADING, &fw_priv->status);
mutex_unlock(&fw_lock);
break;
}
and if this code can race (which it obviously can, since your addition of fw_lock mutex matters), then I think it can race on that FW_STATUS_LOADING bit too. No?
So my gut feel is that the whole damn function should be protected by the mutex_lock thing. IOW, the patch would be something like the appended.
UNTESTED. Somebody needs to test this, verify, and send it back to me.