public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb•de>
To: Geoff Levand <geoffrey.levand@am•sony.com>
Cc: linuxppc-dev@ozlabs•org, paulus@samba•org,
	Takashi Yamamoto <Takashi02_Yamamoto@hq•scei.sony.co.jp>
Subject: Re: [patch 3/3] PS3: Add logical performance monitor driver support
Date: Sun, 6 Jan 2008 22:56:17 +0100	[thread overview]
Message-ID: <200801062256.18885.arnd@arndb.de> (raw)
In-Reply-To: <47813CA4.8000203@am.sony.com>

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 <><

      reply	other threads:[~2008-01-06 21:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20080105003019.595703814@am.sony.com>
2008-01-05  3:12 ` [patch 1/3] PS3: Add logical performance monitor repository routines Geoff Levand
2008-01-05  3:12 ` [patch 2/3] PS3: Add logical performance monitor device support Geoff Levand
2008-01-05 11:29   ` Arnd Bergmann
2008-01-06 20:39     ` Geoff Levand
2008-01-05  3:30 ` [patch 3/3] PS3: Add logical performance monitor driver support Geoff Levand
2008-01-05 11:56   ` Arnd Bergmann
2008-01-06 20:40     ` Geoff Levand
2008-01-06 21:56       ` Arnd Bergmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200801062256.18885.arnd@arndb.de \
    --to=arnd@arndb$(echo .)de \
    --cc=Takashi02_Yamamoto@hq$(echo .)scei.sony.co.jp \
    --cc=geoffrey.levand@am$(echo .)sony.com \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    --cc=paulus@samba$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox