[PATCH v2 29/30] cxlflash: Fix to avoid state change collision

Matthew R. Ochs mrochs at linux.vnet.ibm.com
Tue Sep 22 08:59:45 AEST 2015

> On Sep 21, 2015, at 7:44 AM, Tomas Henzl <thenzl at redhat.com> wrote:
> On 16.9.2015 23:32, Matthew R. Ochs wrote:
>> The adapter state machine is susceptible to missing and/or
>> corrupting state updates at runtime. This can lead to a variety
>> of unintended issues and is due to the lack of a serialization
>> mechanism to protect the adapter state.
>> Use an adapter-wide mutex to serialize state changes.
> I've just briefly looked into your code, but it seems to me that
> an atomic variable would serve your needs also and might be 
> more effective resulting in a faster code execution?

Will keep this in mind. 

> If you keep the mutex way you don't need two mutexes
> in cxlflash_afu_sync - you should remove the mutex &sync_active

Agreed. Will remove as part of this patch in v3.

More information about the Linuxppc-dev mailing list