* Re: [PATCH] revert ath5k ioread32()/iowrite32() usage - use readl()/writel(), we're MMIO-only [not found] ` <46EEEA9B.70407@garzik.org> @ 2007-09-17 21:44 ` Jiri Slaby 2007-09-18 19:03 ` Luis R. Rodriguez 0 siblings, 1 reply; 5+ messages in thread From: Jiri Slaby @ 2007-09-17 21:44 UTC (permalink / raw) To: Jeff Garzik Cc: Luis R. Rodriguez, John W. Linville, linux-wireless, Alan Cox, Linux Kernel Mailing List On 09/17/2007 10:59 PM, Jeff Garzik wrote: > Jiri Slaby wrote: >> NACK, this is wrong. iomap returns platform dependant return value, >> which may or > > Incorrect. readl() and writel() work just fine on all existing > platforms where Atheros may be used. Ok, this is what Alan Cox wrote about that and you didn't reply to it, so I thought he's right. Anyway I wouldn't rely on iomap that it will never be changed even on x86 -- what's the (performance) impact of having ioread instead of readl? How much data are transferred this way? <cite from="http://lkml.org/lkml/2007/8/25/50"> On Sat, 25 Aug 2007 04:56:19 -0400 Jeff Garzik <jgarzik@pobox.com> wrote: > If the driver knows its MMIO, using readX/writeX after pci_iomap() is > just fine, for all current implementations, and it makes sense that way. There is nothing that guarantees this is permitted, any more than there is anything saying not to use outb/outl. Some of the implementations do quite strange things. It may happen to work but its not in the documentation or the comments. If you want to change this then you need to check the existing usages and update all the docs if its safe, oh and tell the sparc64 pcmcia people to take a hike, which is probably not a big problem. </cite> Please, can anybody clarify it? thanks, -- Jiri Slaby (jirislaby@gmail.com) Faculty of Informatics, Masaryk University ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] revert ath5k ioread32()/iowrite32() usage - use readl()/writel(), we're MMIO-only 2007-09-17 21:44 ` [PATCH] revert ath5k ioread32()/iowrite32() usage - use readl()/writel(), we're MMIO-only Jiri Slaby @ 2007-09-18 19:03 ` Luis R. Rodriguez 2007-09-18 19:12 ` Luis R. Rodriguez 0 siblings, 1 reply; 5+ messages in thread From: Luis R. Rodriguez @ 2007-09-18 19:03 UTC (permalink / raw) To: Jiri Slaby Cc: Jeff Garzik, John W. Linville, linux-wireless, Alan Cox, Linux Kernel Mailing List On 9/17/07, Jiri Slaby <jirislaby@gmail.com> wrote: > On 09/17/2007 10:59 PM, Jeff Garzik wrote: > > Jiri Slaby wrote: > >> NACK, this is wrong. iomap returns platform dependant return value, > >> which may or > > > > Incorrect. readl() and writel() work just fine on all existing > > platforms where Atheros may be used. > > Ok, this is what Alan Cox wrote about that and you didn't reply to it, so I > thought he's right. Anyway I wouldn't rely on iomap that it will never be > changed even on x86 -- what's the (performance) impact of having ioread instead > of readl? How much data are transferred this way? > > <cite from="http://lkml.org/lkml/2007/8/25/50"> > On Sat, 25 Aug 2007 04:56:19 -0400 > Jeff Garzik <jgarzik@pobox.com> wrote: > > > If the driver knows its MMIO, using readX/writeX after pci_iomap() is > > just fine, for all current implementations, and it makes sense that way. > > There is nothing that guarantees this is permitted, any more than there > is anything saying not to use outb/outl. Some of the implementations do > quite strange things. It may happen to work but its not in the > documentation or the comments. I posted a patch to update the documentation with this. > Please, can anybody clarify it? Based on Alan's 'Review-by' remarks on my patch for updating the documenation on pci_iomap() it seems this validates this patch. Please see thread with subject: [PATCH] Clarify pci_iomap() usage for MMIO-only devices Luis ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] revert ath5k ioread32()/iowrite32() usage - use readl()/writel(), we're MMIO-only 2007-09-18 19:03 ` Luis R. Rodriguez @ 2007-09-18 19:12 ` Luis R. Rodriguez 2007-09-18 22:18 ` Benjamin Herrenschmidt 0 siblings, 1 reply; 5+ messages in thread From: Luis R. Rodriguez @ 2007-09-18 19:12 UTC (permalink / raw) To: Jiri Slaby Cc: Jeff Garzik, John W. Linville, linux-wireless, Alan Cox, Linux Kernel Mailing List On 9/18/07, Luis R. Rodriguez <mcgrof@gmail.com> wrote: > On 9/17/07, Jiri Slaby <jirislaby@gmail.com> wrote: > > On 09/17/2007 10:59 PM, Jeff Garzik wrote: > > > Jiri Slaby wrote: > > >> NACK, this is wrong. iomap returns platform dependant return value, > > >> which may or > > > > > > Incorrect. readl() and writel() work just fine on all existing > > > platforms where Atheros may be used. > > > > Ok, this is what Alan Cox wrote about that and you didn't reply to it, so I > > thought he's right. Anyway I wouldn't rely on iomap that it will never be > > changed even on x86 -- what's the (performance) impact of having ioread instead > > of readl? How much data are transferred this way? > > > > <cite from="http://lkml.org/lkml/2007/8/25/50"> > > On Sat, 25 Aug 2007 04:56:19 -0400 > > Jeff Garzik <jgarzik@pobox.com> wrote: > > > > > If the driver knows its MMIO, using readX/writeX after pci_iomap() is > > > just fine, for all current implementations, and it makes sense that way. > > > > There is nothing that guarantees this is permitted, any more than there > > is anything saying not to use outb/outl. Some of the implementations do > > quite strange things. It may happen to work but its not in the > > documentation or the comments. > > I posted a patch to update the documentation with this. > > > Please, can anybody clarify it? > > Based on Alan's 'Review-by' remarks on my patch for updating the > documenation on pci_iomap() it seems this validates this patch. Please > see thread with subject: > > [PATCH] Clarify pci_iomap() usage for MMIO-only devices Well spoke too soon. Now Linus disagrees. We'll see the outcome on the other thread then. Luis ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] revert ath5k ioread32()/iowrite32() usage - use readl()/writel(), we're MMIO-only 2007-09-18 19:12 ` Luis R. Rodriguez @ 2007-09-18 22:18 ` Benjamin Herrenschmidt 2007-09-18 22:44 ` Jeff Garzik 0 siblings, 1 reply; 5+ messages in thread From: Benjamin Herrenschmidt @ 2007-09-18 22:18 UTC (permalink / raw) To: Luis R. Rodriguez Cc: Jiri Slaby, Jeff Garzik, John W. Linville, linux-wireless, Alan Cox, Linux Kernel Mailing List > > > > If the driver knows its MMIO, using readX/writeX after pci_iomap() is > > > > just fine, for all current implementations, and it makes sense that way. > > > > > > There is nothing that guarantees this is permitted, any more than there > > > is anything saying not to use outb/outl. Some of the implementations do > > > quite strange things. It may happen to work but its not in the > > > documentation or the comments. > > > > I posted a patch to update the documentation with this. > > > > > Please, can anybody clarify it? > > > > Based on Alan's 'Review-by' remarks on my patch for updating the > > documenation on pci_iomap() it seems this validates this patch. Please > > see thread with subject: > > > > [PATCH] Clarify pci_iomap() usage for MMIO-only devices > > Well spoke too soon. Now Linus disagrees. We'll see the outcome on the > other thread then. To be more precise, a platform has every right to return some kind of "token" from ioport_map/pci_iomap that encodes the type of address, and that is -different- from what a normal ioremap does. In which case, you will -not- be able to use readb/writeb & cie on such a token. The fact that current implementations seem to return something for MMIO that is equivalent to what ioremap returns is an accident and cannot be relied upon. Cheers, Ben. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] revert ath5k ioread32()/iowrite32() usage - use readl()/writel(), we're MMIO-only 2007-09-18 22:18 ` Benjamin Herrenschmidt @ 2007-09-18 22:44 ` Jeff Garzik 0 siblings, 0 replies; 5+ messages in thread From: Jeff Garzik @ 2007-09-18 22:44 UTC (permalink / raw) To: Benjamin Herrenschmidt Cc: Luis R. Rodriguez, Jiri Slaby, John W. Linville, linux-wireless, Alan Cox, Linux Kernel Mailing List Benjamin Herrenschmidt wrote: > To be more precise, a platform has every right to return some kind of > "token" from ioport_map/pci_iomap that encodes the type of address, and > that is -different- from what a normal ioremap does. In which case, you > will -not- be able to use readb/writeb & cie on such a token. > > The fact that current implementations seem to return something for MMIO > that is equivalent to what ioremap returns is an accident and cannot be > relied upon. Fair enough. It's easy enough to change ath5k to using ioremap (or pci_ioremap). Jeff ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-09-18 22:44 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <43e72e890709171334y321dc2c8ke255a126a733dad6@mail.gmail.com>
[not found] ` <46EEE735.5050306@gmail.com>
[not found] ` <46EEEA9B.70407@garzik.org>
2007-09-17 21:44 ` [PATCH] revert ath5k ioread32()/iowrite32() usage - use readl()/writel(), we're MMIO-only Jiri Slaby
2007-09-18 19:03 ` Luis R. Rodriguez
2007-09-18 19:12 ` Luis R. Rodriguez
2007-09-18 22:18 ` Benjamin Herrenschmidt
2007-09-18 22:44 ` Jeff Garzik
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox