All of lore.kernel.org
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Tim Yamin <plasm@roo.me.uk>, linuxppc-dev@ozlabs.org
Subject: Re: [PATCH]: [MPC5200] (v2) Add ATA DMA support
Date: Thu, 3 Jul 2008 21:20:28 -0600	[thread overview]
Message-ID: <20080704032028.GC12945@secretlab.ca> (raw)
In-Reply-To: <1215128823.7960.12.camel@pasglop>

On Fri, Jul 04, 2008 at 09:47:03AM +1000, Benjamin Herrenschmidt wrote:
> On Thu, 2008-07-03 at 16:35 +0100, Tim Yamin wrote:
> > >> +static void
> > >> +mpc52xx_bmdma_start(struct ata_queued_cmd *qc)
> > >> +{
> > >> +     struct ata_port *ap = qc->ap;
> > >> +     struct mpc52xx_ata_priv *priv = ap->host->private_data;
> > >> +
> > >> +     /* LocalBus lock */
> > >> +     while (test_and_set_bit(0, &pata_mpc52xx_ata_dma_lock) != 0)
> > >> +             ;
> > >
> > > Need to be able to bail on timeout.
> > 
> > A deadlock can't occur within the PATA driver because you won't have
> > two DMA requests happening at once, so there is no point in adding a
> > timeout. And even if you do have a timeout, you'd have to drop the I/O
> > request somehow, so it's not really a good idea. If anything else
> > needs to touch the DMA lock, it should do so in a sensible fashion...
> 
> But why a hand-coded lock with bitops ? Why not a real spinlock then ?
> The later is more efficient anyway.

Umm, yeah.... (don't know why I didn't clue into that).  This definitely
should be a spinlock.

g.

  reply	other threads:[~2008-07-04  3:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-27 12:44 [PATCH]: [MPC5200] (v2) Add ATA DMA support Tim Yamin
2008-06-30 15:40 ` Daniel Schnell
2008-07-01 23:49 ` Grant Likely
2008-07-02 12:48   ` Tim Yamin
2008-07-02 17:30     ` Grant Likely
2008-07-03 15:35       ` Tim Yamin
2008-07-03 23:47         ` Benjamin Herrenschmidt
2008-07-04  3:20           ` Grant Likely [this message]
2008-07-04  3:26         ` Grant Likely

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=20080704032028.GC12945@secretlab.ca \
    --to=grant.likely@secretlab.ca \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=plasm@roo.me.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.