linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] DMA: PL08x: fix channel pausing to timeout rather than lockup
Date: Sun, 30 Jan 2011 16:53:24 +0000	[thread overview]
Message-ID: <20110130165324.GB27436@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <AANLkTinF0hfp81n_6jo3bGFVJadtKQUV8vc4Hxn5JSc2@mail.gmail.com>

On Sun, Jan 30, 2011 at 08:48:27AM -0800, Dan Williams wrote:
> On Thu, Jan 27, 2011 at 4:37 AM, Russell King - ARM Linux
> <linux@arm.linux.org.uk> wrote:
> > If a transfer is initiated from memory to a peripheral, then data is
> > fetched and the channel is marked busy. ?This busy status persists until
> > the HALT bit is set and the queued data has been transfered to the
> > peripheral. ?Waiting indefinitely after setting the HALT bit results in
> > system lockups. ?Timeout this operation, and print an error when this
> > happens.
> >
> > Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> > ---
> > This happens when a M->P transfer is started, but the peripheral doesn't
> > take the data. ?The DMA controller will mark itself active and fetch data
> > from memory, in anticipation of the peripheral wanting the data. ?This
> > advances the source address.
> >
> > An alternative approach here is to just set the HALT bit and return
> > immediately, without waiting for the primecell to show that it is no
> > longer active. ?In any case, resuming the channel will allow the
> > transfer to continue without data loss.
> >
> 
> Ok, and the other infinite busy wait in pl08x_start_txd() is
> guaranteed to be after a resume operation, or does it also need a
> timeout?

The channel should not be active at that point.  If it is, that means
we're trying to setup a new transfer on a physical channel on top of an
already active transfer, which obviously could result in the previous
transfer being destroyed.

Maybe a BUG_ON(pl08x_phy_channel_busy(phychan)) would be more appropriate
there - but I think that's something to address in future patches.

  reply	other threads:[~2011-01-30 16:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-27 12:32 [PATCH 1/2] DMA: PL08x: fix infinite wait when terminating transfers Russell King - ARM Linux
2011-01-27 12:37 ` [PATCH 2/2] DMA: PL08x: fix channel pausing to timeout rather than lockup Russell King - ARM Linux
2011-01-27 14:30   ` Linus Walleij
2011-01-30 16:48   ` Dan Williams
2011-01-30 16:53     ` Russell King - ARM Linux [this message]
2011-01-31  5:48       ` Dan Williams
2011-01-27 14:28 ` [PATCH 1/2] DMA: PL08x: fix infinite wait when terminating transfers Linus Walleij

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=20110130165324.GB27436@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).