Re: [patch -stable] firware_class oops: fix firmware_loading_storelocking

From: Sachin Sant
Date: Thu Sep 24 2009 - 11:14:13 EST


Linus Torvalds wrote:
I don't think this is correct.

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.
I did a quick boot test with this patch and didn't find any issues.

But that said i haven't been able to recreate the problem reported by Lars,
so not sure how relevant would be the test results from me.

Thanks
-Sachin


--

---------------------------------
Sachin Sant
IBM Linux Technology Center
India Systems and Technology Labs
Bangalore, India
---------------------------------

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/