From: slash.tmp@free.fr (Mason)
To: linux-arm-kernel@lists.infradead.org
Subject: Write to memory-mapped register has actually reached the device
Date: Wed, 22 Jul 2015 16:46:07 +0200 [thread overview]
Message-ID: <55AFACAF.7020004@free.fr> (raw)
Hello everyone,
I'm using an ARMv7 platform (Cortex A9).
The hardware designer said something that confused me: he said
that when a driver writes to a device memory-mapped register,
there is no way to "know" when the write has actually reached
the device, other than to read the value back.
I had been using this kind of code:
static void __iomem *device_base;
device_base = ioremap(DEVICE_ADDR, RANGE);
writel_relaxed(val, device_base + N);
The situation where he said this would bite me is:
write to a device register to clear an interrupt notification
unmask interrupts
The interrupt might fire because the interrupt bit has
not been cleared yet. Does that make any sense?
Should I use writel instead of writel_relaxed in that
situation? Do I really have to read-after-write?
Regards.
WARNING: multiple messages have this Message-ID (diff)
From: Mason <slash.tmp@free.fr>
To: Linux ARM <linux-arm-kernel@lists.infradead.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Write to memory-mapped register has actually reached the device
Date: Wed, 22 Jul 2015 16:46:07 +0200 [thread overview]
Message-ID: <55AFACAF.7020004@free.fr> (raw)
Hello everyone,
I'm using an ARMv7 platform (Cortex A9).
The hardware designer said something that confused me: he said
that when a driver writes to a device memory-mapped register,
there is no way to "know" when the write has actually reached
the device, other than to read the value back.
I had been using this kind of code:
static void __iomem *device_base;
device_base = ioremap(DEVICE_ADDR, RANGE);
writel_relaxed(val, device_base + N);
The situation where he said this would bite me is:
write to a device register to clear an interrupt notification
unmask interrupts
The interrupt might fire because the interrupt bit has
not been cleared yet. Does that make any sense?
Should I use writel instead of writel_relaxed in that
situation? Do I really have to read-after-write?
Regards.
next reply other threads:[~2015-07-22 14:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-22 14:46 Mason [this message]
2015-07-22 14:46 ` Write to memory-mapped register has actually reached the device Mason
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=55AFACAF.7020004@free.fr \
--to=slash.tmp@free.fr \
--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 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.