[patch 3/3] PS3: Add logical performance monitor driver support
Arnd Bergmann
arnd at arndb.de
Mon Jan 7 08:56:17 EST 2008
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 <><
More information about the Linuxppc-dev
mailing list