Re: [PATCH] Clarify pci_iomap() usage for MMIO-only devices

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linus Torvalds
Date: Tuesday, September 18, 2007 - 3:25 pm

On Tue, 18 Sep 2007, Linus Torvalds wrote:

Side note: just allowing readl/writel on the iomap'ed pointers obviously 
avoids that proliferation, but iomap really is architecture-specific, so 
not only will different architectures act very differently, it's not 
necessarily the case that iomap() will always have the same pointer as the 
old ioremap(), even though the routines in the *default* implementation in 
lib/iomap.c do that.

In fact, for IO port accesses, we already do some debugging to make sure 
that people don't misuse the iomap() interfaces (ie the whole "Bad IO 
access.." thing). I could well see the same thing happening for MMIO under 
some debugging option, explicitly using some high bits in a 64-bit address 
as a cookie - and that would make using regular readl/writel on the cookie 
just fail spectacularly.

That said, it does seem unlikely (ie if we added a cookie for MMIO 
pointers, we'd probably do it *both* for iomap and for ioremap(), and 
readl/writel would continue to work). So in practice the readl/writel 
probably works.

		Linus
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Clarify pci_iomap() usage for MMIO-only devices, Luis R. Rodriguez, (Mon Sep 17, 1:22 pm)
Re: [PATCH] Clarify pci_iomap() usage for MMIO-only devices, Luis R. Rodriguez, (Tue Sep 18, 11:46 am)
Re: [PATCH] Clarify pci_iomap() usage for MMIO-only devices, Linus Torvalds, (Tue Sep 18, 12:03 pm)
Re: [PATCH] Clarify pci_iomap() usage for MMIO-only devices, Luis R. Rodriguez, (Tue Sep 18, 12:07 pm)
Re: [PATCH] Clarify pci_iomap() usage for MMIO-only devices, Linus Torvalds, (Tue Sep 18, 12:22 pm)
Re: [PATCH] Clarify pci_iomap() usage for MMIO-only devices, Luis R. Rodriguez, (Tue Sep 18, 1:12 pm)
Re: [PATCH] Clarify pci_iomap() usage for MMIO-only devices, Luis R. Rodriguez, (Tue Sep 18, 2:02 pm)
Re: [PATCH] Clarify pci_iomap() usage for MMIO-only devices, Benjamin Herrenschmidt, (Tue Sep 18, 3:16 pm)
Re: [PATCH] Clarify pci_iomap() usage for MMIO-only devices, Benjamin Herrenschmidt, (Tue Sep 18, 3:20 pm)
Re: [PATCH] Clarify pci_iomap() usage for MMIO-only devices, Benjamin Herrenschmidt, (Tue Sep 18, 3:21 pm)
Re: [PATCH] Clarify pci_iomap() usage for MMIO-only devices, Linus Torvalds, (Tue Sep 18, 3:25 pm)
Re: [PATCH] Clarify pci_iomap() usage for MMIO-only devices, Nick Kossifidis, (Wed Sep 19, 8:07 am)