On Sunday 06 January 2008, Geoff Levand wrote:
> 
> > This mutex is documented as the 'open/close' mutex and you use it
> > to prevent concurrent execution of the open and close functions.
> > However, it's unclear what data structures are actually protected
> > by it.
> > 
> > I think this is the result of unusual lifetime rules for the lpm_priv
> > object, which I already mentioned above.
> 
> Yes, we really just need to use the mutex to allow only a single instance,
> and so do a mutex_trylock() in ps3_lpm_open() and return -EBUSY on fail,
> and then a mutex_unlock() in ps3_lpm_close().

A simple atomic_test_and_set in open() should do the job just as well then.

        Arnd <><
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Reply via email to