[PATCH] staging: goldfish: switch from spinlock to mutex

Kristina Martšenko kristina.martsenko at gmail.com
Fri Apr 4 09:26:27 UTC 2014


On 03/04/14 13:13, Dan Carpenter wrote:
> On Thu, Apr 03, 2014 at 01:00:53PM +0300, Kristina Martšenko wrote:
>> On 03/04/14 11:32, Dan Carpenter wrote:
>>> On Tue, Mar 25, 2014 at 01:45:09AM +0200, Kristina Martšenko wrote:
>>>> Use a mutex instead of a spinlock in goldfish_nand.c, as suggested by
>>>> the TODO list.
>>>>
>>>> Signed-off-by: Kristina Martšenko <kristina.martsenko at gmail.com>
>>>
>>> Have you tested this change?
>>
>> Nope, just compile-tested. After a day of trying to get the emulator to
>> work I finally gave up and decided that it looked okay enough... I
>> should have mentioned under the patch description that it wasn't tested,
>> sorry.
> 
> It's not a wrong thing to submit patches that you can't test, but in
> this case the irq save/restores make me nervous.  I can't see that they
> served any purpose and it's certainly not unheard of for staging code to
> do pointless things for unexplainable reasons.  But on the other hand, I
> would feel a lot more comfortable if this change were tested or if there
> were more comments about how the change is safe.

I'm not sure I understand. A mutex doesn't disable interrupts, so the
cpu irq flags should be the same after the mutex-protected code as they
were before. I.e. it would have the same effect as the save/restore. Or
am I missing something?

In any case I can take another shot at getting the Android emulator to
work so that I can test this. (Probably not anytime soon though.)

Kristina


More information about the devel mailing list