public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Clarify pci_iomap() usage for MMIO-only devices
@ 2007-09-17 20:22 Luis R. Rodriguez
  2007-09-18 10:34 ` Alan Cox
  0 siblings, 1 reply; 22+ messages in thread
From: Luis R. Rodriguez @ 2007-09-17 20:22 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: linux-kernel, Jeff Garzik, John W. Linville, linux-wireless

[-- 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.

^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2007-09-19 15:07 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-17 20:22 [PATCH] Clarify pci_iomap() usage for MMIO-only devices Luis R. Rodriguez
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox