public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Mundt <lethal@linux-sh.org>
To: Adrian McMenamin <adrian@newgolddream.dyndns.info>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	dwmw2@infradead.org, greg@kroah.com,
	linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org,
	linux-mtd@vger.kernel.org
Subject: Re: [PATCH] 1/2 Maple: Update bus driver to allow support of VMU device
Date: Fri, 21 Mar 2008 05:11:44 +0000	[thread overview]
Message-ID: <20080321051144.GA16926@linux-sh.org> (raw)
In-Reply-To: <1206053547.6274.28.camel@localhost.localdomain>

On Thu, Mar 20, 2008 at 10:52:27PM +0000, Adrian McMenamin wrote:
> 
> On Thu, 2008-03-20 at 15:39 -0700, Andrew Morton wrote:
> > On Thu, 20 Mar 2008 22:23:17 +0000
> > Adrian McMenamin <adrian@newgolddream.dyndns.info> wrote:
> > 
> > > 
> > > > urgh, down_trylock().  And a secret, undocumented one too.
> > > > 
> > > > A trylock is always an exceptional thing.  How is *any* reader of this code
> > > > supposed to work out what the heck it's doing there?  Convert it into
> > > > down(), run the code and decrypt the lockdep warnings, I suspect.
> > > > 
> > > > <looks>
> > > > 
> > > > Nope, I can't see any other lock being held when we call this function.
> > > > 
> > > > The trylocks are an utter mystery to me.  Please don't write mysterious
> > > > code.
> > > > 
> > > 
> > > OK, I am sure this is my problem but I have no idea why you are
> > > describing down_trylock as undocumented
> > 
> > I'm describing your use of it!  I'm sitting here trying to work out why on
> > earth this code is using the highly unusual (and highly suspicious) trylock
> > idiom and this is far from clear.
> > 
> 
> OK, I understand your point now. Some comments wouldn't go amiss, for
> sure.
> 
Other than the fact the locking is bizarre and utterly incomprehensible,
why are you using a semaphore here at all? You're effectively using it as
a mutex, and you really should be using that API instead, especially for
the debugging capabilities. This patch set looks like an excellent stress
test for the mutex debugging code.

      reply	other threads:[~2008-03-21  5:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-18 22:30 [PATCH] 0/2 Add support for maple "Visual Memory Unit" on SEGA Adrian McMenamin
2008-03-18 22:49 ` [PATCH] 1/2 Maple: Update bus driver to allow support of VMU device Adrian McMenamin
2008-03-18 22:56   ` [PATCH] 2/2 mtd: Add support for the Dreamcast VMU flash Adrian McMenamin
2008-03-20 21:10     ` Andrew Morton
2008-03-20 22:34       ` Adrian McMenamin
2008-03-20 20:56   ` [PATCH] 1/2 Maple: Update bus driver to allow support of VMU Andrew Morton
2008-03-20 22:23     ` Adrian McMenamin
2008-03-20 22:39       ` Andrew Morton
2008-03-20 22:52         ` Adrian McMenamin
2008-03-21  5:11           ` Paul Mundt [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=20080321051144.GA16926@linux-sh.org \
    --to=lethal@linux-sh.org \
    --cc=adrian@newgolddream.dyndns.info \
    --cc=akpm@linux-foundation.org \
    --cc=dwmw2@infradead.org \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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