From: Brian Gerst <bgerst@quark.didntduck.org>
To: root@chaos.analogic.com
Cc: Linux kernel <linux-kernel@vger.kernel.org>
Subject: Re: ix86 Atomic ops during DMA...
Date: Mon, 09 Aug 2004 08:38:00 -0400 [thread overview]
Message-ID: <41177028.8000905@quark.didntduck.org> (raw)
In-Reply-To: <Pine.LNX.4.53.0408090809520.7612@chaos>
Richard B. Johnson wrote:
> Hello,
>
> A piece of hardware needs its interrupt status written back
> to its status register to "clear" interrupts and thus enable
> more.. This is in an uninterruptible ISR. This, of course
> can be readily accomplished by using the standard readl() and
> writel() macros.........but! If a DMA is in progress, a hardware
> debugger shows many milliseconds between the read and the write.
>
> This allows a race condition to exist. So, how do I lock the bus
> during the read and write? A lock on ix86 locks only the
> next instruction, not the next plus time for another lock
> which appears to be needed.
>
> I need...
>
> movl (%ebx), %eax # Read status from register in ebx
> movl %eax, (%ebx) # Write it back
>
> ..to occur together without the bus being taken away by a DMA
> operation until these two instructions are complete.
You need a single read-modify-write instruction like:
lock orl $0, addr
--
Brian Gerst
prev parent reply other threads:[~2004-08-09 12:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-09 12:22 Richard B. Johnson
2004-08-09 12:31 ` Bart Hartgers
2004-08-09 12:38 ` Brian Gerst [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=41177028.8000905@quark.didntduck.org \
--to=bgerst@quark.didntduck.org \
--cc=linux-kernel@vger.kernel.org \
--cc=root@chaos.analogic.com \
/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
all inboxes | Powered by JetHome®