From: "Luis R. Rodriguez" <mcgrof@gmail.com>
To: "Linus Torvalds" <torvalds@linux-foundation.org>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
"Jeff Garzik" <jeff@garzik.org>,
"John W. Linville" <linville@tuxdriver.com>,
linux-wireless <linux-wireless@vger.kernel.org>
Subject: [PATCH] Clarify pci_iomap() usage for MMIO-only devices
Date: Mon, 17 Sep 2007 16:22:07 -0400 [thread overview]
Message-ID: <43e72e890709171322x76ab6b70xd29bf97e3643c553@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 470 bytes --]
This patch updates the pci_iomap() kernel-doc to make it clarify the
case when read*()/write*() can be called over ioread*/iowrite*(). When
driver writers read this documenation sometimes it is assumed you just
*need* to use ioread*()/iorwrite*(). We have an exception so lets just
clarify this is not true for the exception.
lib/iomap.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
Signed-off-by: Luis R. Rodriguez <mcgrof@gmail.com>
Luis
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: pci_iomap-doc-clarification.diff --]
[-- Type: text/x-patch; name="pci_iomap-doc-clarification.diff", Size: 1208 bytes --]
diff --git a/lib/iomap.c b/lib/iomap.c
index 864f2ec..33651f8 100644
--- a/lib/iomap.c
+++ b/lib/iomap.c
@@ -247,9 +247,14 @@ EXPORT_SYMBOL(ioport_unmap);
* @maxlen: length of the memory to map
*
* Using this function you will get a __iomem address to your device BAR.
- * You can access it using ioread*() and iowrite*(). These functions hide
- * the details if this is a MMIO or PIO address space and will just do what
- * you expect from them in the correct way.
+ * If you use pci_iomap() it is recommended you use ioread*() and iowrite*(). If
+ * your device is MMIO-only and as long as future architectures don't break the
+ * assumption that pcio_iomap()-returned cookie can be used by read*()/write*()
+ * then you can use read*()/write*() instead. The ioread*() and iowrite*()
+ * functions hide the details if this is a MMIO or PIO address space and will
+ * just do what you expect from them in the correct way. Drivers for MMIO-only
+ * devices would use this only to save themselves from having to call
+ * &pci_resource_start().
*
* @maxlen specifies the maximum length to map. If you want to get access to
* the complete BAR without checking for its length first, pass %0 here.
next reply other threads:[~2007-09-17 20:22 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-17 20:22 Luis R. Rodriguez [this message]
2007-09-18 10:34 ` Alan Cox
2007-09-18 18:46 ` Luis R. Rodriguez
2007-09-18 19:03 ` Linus Torvalds
2007-09-18 19:07 ` Luis R. Rodriguez
2007-09-18 19:22 ` Linus Torvalds
2007-09-18 20:12 ` Luis R. Rodriguez
2007-09-18 20:30 ` Linus Torvalds
2007-09-18 21:02 ` Luis R. Rodriguez
2007-09-18 21:14 ` Linus Torvalds
2007-09-18 21:30 ` Jeff Garzik
2007-09-18 21:42 ` Linus Torvalds
2007-09-18 22:25 ` Linus Torvalds
2007-09-18 22:21 ` Benjamin Herrenschmidt
2007-09-18 22:36 ` Linus Torvalds
2007-09-18 20:21 ` Jeff Garzik
2007-09-18 22:20 ` Benjamin Herrenschmidt
2007-09-18 23:08 ` Jeff Garzik
2007-09-18 23:27 ` Linus Torvalds
2007-09-18 22:16 ` Benjamin Herrenschmidt
2007-09-18 22:25 ` Alan Cox
2007-09-19 15:07 ` Nick Kossifidis
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=43e72e890709171322x76ab6b70xd29bf97e3643c553@mail.gmail.com \
--to=mcgrof@gmail.com \
--cc=jeff@garzik.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=torvalds@linux-foundation.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
all inboxes | Powered by JetHome®