linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Tim Yamin <plasm@roo.me.uk>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH]: [MPC5200] (v2) Add ATA DMA support
Date: Fri, 04 Jul 2008 09:47:03 +1000	[thread overview]
Message-ID: <1215128823.7960.12.camel@pasglop> (raw)
In-Reply-To: <792f5f410807030835q4589a27eh4b7d13e93e922a5e@mail.gmail.com>

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.

Ben.

  reply	other threads:[~2008-07-03 23:47 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 [this message]
2008-07-04  3:20           ` Grant Likely
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=1215128823.7960.12.camel@pasglop \
    --to=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).