Michael S. Tsirkin | 4 Dec 2011 11:48
Picon
Favicon

Re: [PATCH-RFC 07/10] parisc: switch to GENERIC_PCI_IOMAP

On Thu, Nov 24, 2011 at 10:19:34PM +0200, Michael S. Tsirkin wrote:
> parisc copied pci_iomap from generic code, probably to avoid
> pulling the rest of iomap.c in.  Since that's in
> a separate file now, we can reuse the common implementation.
> 
> Signed-off-by: Michael S. Tsirkin <mst <at> redhat.com>

Sorry to nag, any ACKs/NACKs on the parisc part?
I intend to send this to Linus if there are no
objections. Thanks!

> ---
>  arch/parisc/Kconfig     |    1 +
>  arch/parisc/lib/iomap.c |   23 -----------------------
>  2 files changed, 1 insertions(+), 23 deletions(-)
> 
> diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
> index fdfd8be..242a1b7 100644
> --- a/arch/parisc/Kconfig
> +++ b/arch/parisc/Kconfig
>  <at>  <at>  -14,6 +14,7  <at>  <at>  config PARISC
>  	select GENERIC_ATOMIC64 if !64BIT
>  	select HAVE_GENERIC_HARDIRQS
>  	select GENERIC_IRQ_PROBE
> +	select GENERIC_PCI_IOMAP
>  	select IRQ_PER_CPU
>  	select ARCH_HAVE_NMI_SAFE_CMPXCHG
>  
> diff --git a/arch/parisc/lib/iomap.c b/arch/parisc/lib/iomap.c
> index 8f470c9..fb8e10a 100644
(Continue reading)

James Bottomley | 4 Dec 2011 15:22

Re: [PATCH-RFC 07/10] parisc: switch to GENERIC_PCI_IOMAP

On Sun, 2011-12-04 at 12:48 +0200, Michael S. Tsirkin wrote:
> On Thu, Nov 24, 2011 at 10:19:34PM +0200, Michael S. Tsirkin wrote:
> > parisc copied pci_iomap from generic code, probably to avoid
> > pulling the rest of iomap.c in.  Since that's in
> > a separate file now, we can reuse the common implementation.
> > 
> > Signed-off-by: Michael S. Tsirkin <mst <at> redhat.com>
> 
> Sorry to nag, any ACKs/NACKs on the parisc part?
> I intend to send this to Linus if there are no
> objections. Thanks!

Next time, send the patch to linux-arch or linux-parisc ... it helps to
get people to review it.  Although this one looks completely trivial,
unless I'm missing something?

Obviously there was a bit of a brain fart when this was done: the parisc
piece shouldn't be a copy of the generic code: we don't have native i/o
ports and emulation is pretty expensive, so we should prefer
IORESOURCE_MEM over IORESOURCE_IO when both are available  ... but even
on x86, memory mapping is faster (although not by the order of magnitude
it is on parisc), so it looks like you could fix this in the generic
code.

James

--
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
(Continue reading)

Michael S. Tsirkin | 4 Dec 2011 15:30
Picon
Favicon

Re: [PATCH-RFC 07/10] parisc: switch to GENERIC_PCI_IOMAP

On Sun, Dec 04, 2011 at 08:22:34AM -0600, James Bottomley wrote:
> On Sun, 2011-12-04 at 12:48 +0200, Michael S. Tsirkin wrote:
> > On Thu, Nov 24, 2011 at 10:19:34PM +0200, Michael S. Tsirkin wrote:
> > > parisc copied pci_iomap from generic code, probably to avoid
> > > pulling the rest of iomap.c in.  Since that's in
> > > a separate file now, we can reuse the common implementation.
> > > 
> > > Signed-off-by: Michael S. Tsirkin <mst <at> redhat.com>
> > 
> > Sorry to nag, any ACKs/NACKs on the parisc part?
> > I intend to send this to Linus if there are no
> > objections. Thanks!
> 
> Next time, send the patch to linux-arch or linux-parisc ... it helps to
> get people to review it. Although this one looks completely trivial,
> unless I'm missing something?

I think it's trivial but I don't have the setup to even compile it so
depend on someone to ack.

> Obviously there was a bit of a brain fart when this was done: the parisc
> piece shouldn't be a copy of the generic code: we don't have native i/o
> ports and emulation is pretty expensive, so we should prefer
> IORESOURCE_MEM over IORESOURCE_IO when both are available  ... but even
> on x86, memory mapping is faster (although not by the order of magnitude
> it is on parisc), so it looks like you could fix this in the generic
> code.
> 
> James

(Continue reading)

James Bottomley | 4 Dec 2011 15:32

Re: [PATCH-RFC 07/10] parisc: switch to GENERIC_PCI_IOMAP

On Sun, 2011-12-04 at 16:30 +0200, Michael S. Tsirkin wrote:
> On Sun, Dec 04, 2011 at 08:22:34AM -0600, James Bottomley wrote:
> > On Sun, 2011-12-04 at 12:48 +0200, Michael S. Tsirkin wrote:
> > > On Thu, Nov 24, 2011 at 10:19:34PM +0200, Michael S. Tsirkin wrote:
> > > > parisc copied pci_iomap from generic code, probably to avoid
> > > > pulling the rest of iomap.c in.  Since that's in
> > > > a separate file now, we can reuse the common implementation.
> > > > 
> > > > Signed-off-by: Michael S. Tsirkin <mst <at> redhat.com>
> > > 
> > > Sorry to nag, any ACKs/NACKs on the parisc part?
> > > I intend to send this to Linus if there are no
> > > objections. Thanks!
> > 
> > Next time, send the patch to linux-arch or linux-parisc ... it helps to
> > get people to review it. Although this one looks completely trivial,
> > unless I'm missing something?
> 
> I think it's trivial but I don't have the setup to even compile it so
> depend on someone to ack.
> 
> > Obviously there was a bit of a brain fart when this was done: the parisc
> > piece shouldn't be a copy of the generic code: we don't have native i/o
> > ports and emulation is pretty expensive, so we should prefer
> > IORESOURCE_MEM over IORESOURCE_IO when both are available  ... but even
> > on x86, memory mapping is faster (although not by the order of magnitude
> > it is on parisc), so it looks like you could fix this in the generic
> > code.
> > 
> > James
(Continue reading)

Michael S. Tsirkin | 4 Dec 2011 15:42
Picon
Favicon

Re: [PATCH-RFC 07/10] parisc: switch to GENERIC_PCI_IOMAP

On Sun, Dec 04, 2011 at 08:32:24AM -0600, James Bottomley wrote:
> On Sun, 2011-12-04 at 16:30 +0200, Michael S. Tsirkin wrote:
> > On Sun, Dec 04, 2011 at 08:22:34AM -0600, James Bottomley wrote:
> > > On Sun, 2011-12-04 at 12:48 +0200, Michael S. Tsirkin wrote:
> > > > On Thu, Nov 24, 2011 at 10:19:34PM +0200, Michael S. Tsirkin wrote:
> > > > > parisc copied pci_iomap from generic code, probably to avoid
> > > > > pulling the rest of iomap.c in.  Since that's in
> > > > > a separate file now, we can reuse the common implementation.
> > > > > 
> > > > > Signed-off-by: Michael S. Tsirkin <mst <at> redhat.com>
> > > > 
> > > > Sorry to nag, any ACKs/NACKs on the parisc part?
> > > > I intend to send this to Linus if there are no
> > > > objections. Thanks!
> > > 
> > > Next time, send the patch to linux-arch or linux-parisc ... it helps to
> > > get people to review it. Although this one looks completely trivial,
> > > unless I'm missing something?
> > 
> > I think it's trivial but I don't have the setup to even compile it so
> > depend on someone to ack.
> > 
> > > Obviously there was a bit of a brain fart when this was done: the parisc
> > > piece shouldn't be a copy of the generic code: we don't have native i/o
> > > ports and emulation is pretty expensive, so we should prefer
> > > IORESOURCE_MEM over IORESOURCE_IO when both are available  ... but even
> > > on x86, memory mapping is faster (although not by the order of magnitude
> > > it is on parisc), so it looks like you could fix this in the generic
> > > code.
> > > 
(Continue reading)

James Bottomley | 5 Dec 2011 16:33

Re: [PATCH-RFC 07/10] parisc: switch to GENERIC_PCI_IOMAP

On Sun, 2011-12-04 at 16:42 +0200, Michael S. Tsirkin wrote:
> On Sun, Dec 04, 2011 at 08:32:24AM -0600, James Bottomley wrote:
> > On Sun, 2011-12-04 at 16:30 +0200, Michael S. Tsirkin wrote:
> > > On Sun, Dec 04, 2011 at 08:22:34AM -0600, James Bottomley wrote:
> > > > On Sun, 2011-12-04 at 12:48 +0200, Michael S. Tsirkin wrote:
> > > > > On Thu, Nov 24, 2011 at 10:19:34PM +0200, Michael S. Tsirkin wrote:
> > > > > > parisc copied pci_iomap from generic code, probably to avoid
> > > > > > pulling the rest of iomap.c in.  Since that's in
> > > > > > a separate file now, we can reuse the common implementation.
> > > > > > 
> > > > > > Signed-off-by: Michael S. Tsirkin <mst <at> redhat.com>
> > > > > 
> > > > > Sorry to nag, any ACKs/NACKs on the parisc part?
> > > > > I intend to send this to Linus if there are no
> > > > > objections. Thanks!
> > > > 
> > > > Next time, send the patch to linux-arch or linux-parisc ... it helps to
> > > > get people to review it. Although this one looks completely trivial,
> > > > unless I'm missing something?
> > > 
> > > I think it's trivial but I don't have the setup to even compile it so
> > > depend on someone to ack.
> > > 
> > > > Obviously there was a bit of a brain fart when this was done: the parisc
> > > > piece shouldn't be a copy of the generic code: we don't have native i/o
> > > > ports and emulation is pretty expensive, so we should prefer
> > > > IORESOURCE_MEM over IORESOURCE_IO when both are available  ... but even
> > > > on x86, memory mapping is faster (although not by the order of magnitude
> > > > it is on parisc), so it looks like you could fix this in the generic
> > > > code.
(Continue reading)

Michael S. Tsirkin | 5 Dec 2011 17:24
Picon
Favicon

Re: [PATCH-RFC 07/10] parisc: switch to GENERIC_PCI_IOMAP

On Mon, Dec 05, 2011 at 09:33:29AM -0600, James Bottomley wrote:
> On Sun, 2011-12-04 at 16:42 +0200, Michael S. Tsirkin wrote:
> > On Sun, Dec 04, 2011 at 08:32:24AM -0600, James Bottomley wrote:
> > > On Sun, 2011-12-04 at 16:30 +0200, Michael S. Tsirkin wrote:
> > > > On Sun, Dec 04, 2011 at 08:22:34AM -0600, James Bottomley wrote:
> > > > > On Sun, 2011-12-04 at 12:48 +0200, Michael S. Tsirkin wrote:
> > > > > > On Thu, Nov 24, 2011 at 10:19:34PM +0200, Michael S. Tsirkin wrote:
> > > > > > > parisc copied pci_iomap from generic code, probably to avoid
> > > > > > > pulling the rest of iomap.c in.  Since that's in
> > > > > > > a separate file now, we can reuse the common implementation.
> > > > > > > 
> > > > > > > Signed-off-by: Michael S. Tsirkin <mst <at> redhat.com>
> > > > > > 
> > > > > > Sorry to nag, any ACKs/NACKs on the parisc part?
> > > > > > I intend to send this to Linus if there are no
> > > > > > objections. Thanks!
> > > > > 
> > > > > Next time, send the patch to linux-arch or linux-parisc ... it helps to
> > > > > get people to review it. Although this one looks completely trivial,
> > > > > unless I'm missing something?
> > > > 
> > > > I think it's trivial but I don't have the setup to even compile it so
> > > > depend on someone to ack.
> > > > 
> > > > > Obviously there was a bit of a brain fart when this was done: the parisc
> > > > > piece shouldn't be a copy of the generic code: we don't have native i/o
> > > > > ports and emulation is pretty expensive, so we should prefer
> > > > > IORESOURCE_MEM over IORESOURCE_IO when both are available  ... but even
> > > > > on x86, memory mapping is faster (although not by the order of magnitude
> > > > > it is on parisc), so it looks like you could fix this in the generic
(Continue reading)

James Bottomley | 5 Dec 2011 17:46

Re: [PATCH-RFC 07/10] parisc: switch to GENERIC_PCI_IOMAP

On Mon, 2011-12-05 at 18:24 +0200, Michael S. Tsirkin wrote:
> > > so ... ACK?
> > 
> > Um, well, it looks like a trivial code shift, so it doesn't really need
> > one (it can just go through the trivial tree).
> 
> It's part of a larger set not all of which is trivial.

OK, so it looks fine to me.

> >  Unless there's some
> > reason actually to test it out on parisc because something will break
> > (in which case, I'll need the actual patch, not just a quoted one).
> > 
> > James
> 
> A build test would be nice. Just forwarded you a patch.
> It's also on linux-next.

Actually, sending it to me doesn't help.  Being busy and lazy, I want to
see if someone else will test it ... that's why we send patches to the
list.

James

--
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

(Continue reading)

Grant Grundler | 5 Dec 2011 19:23
Picon

Re: [PATCH-RFC 07/10] parisc: switch to GENERIC_PCI_IOMAP

On Sun, Dec 4, 2011 at 6:30 AM, Michael S. Tsirkin <mst <at> redhat.com> wrote:
...
> AFAIK, on PCI a resource is either IO or MEM, but never both.
> What am I missing?

Yes, a particular PCI BAR (Base Address Register) is either IO or MEM
(not both) address space resource.

James is observing many older devices have the same set of registers
mapped in both address spaces using two BARs. As you already know,
MMIO is "lighter weight" (CPU cost to generate transactions on PCI
bus). I think this is orthogonal to the issue you are addressing.

Regarding handling of IO Port space cookies:
> -     if (flags & IORESOURCE_IO)
> -             return ioport_map(start, len);

I don't know who all the consumers of pci_iomap() are. If user space
can somehow call this, it should fail for IO port space "mappings"
since unlike x86, parisc has no INB/OUTB instructions. Generating IO
Port space requires frobbing PCI Bus controller registers that I don't
think we want to expose to user space.

I'm going to assume this is NOT a problem since any code that
generates anything that tries to look like an INB/OUTB just won't
compile on parisc.  I think removing the parisc specific definition
and using the generic one instead looks fine to me.  But I'm not
confident enough to offer a formal ACKed-by line. Sorry. :(

cheers,
(Continue reading)

Michael S. Tsirkin | 6 Dec 2011 12:06
Picon
Favicon

Re: [PATCH-RFC 07/10] parisc: switch to GENERIC_PCI_IOMAP

On Mon, Dec 05, 2011 at 10:23:17AM -0800, Grant Grundler wrote:
> On Sun, Dec 4, 2011 at 6:30 AM, Michael S. Tsirkin <mst <at> redhat.com> wrote:
> ...
> > AFAIK, on PCI a resource is either IO or MEM, but never both.
> > What am I missing?
> 
> Yes, a particular PCI BAR (Base Address Register) is either IO or MEM
> (not both) address space resource.
> 
> James is observing many older devices have the same set of registers
> mapped in both address spaces using two BARs. As you already know,
> MMIO is "lighter weight" (CPU cost to generate transactions on PCI
> bus). I think this is orthogonal to the issue you are addressing.
> 
> Regarding handling of IO Port space cookies:
> > -     if (flags & IORESOURCE_IO)
> > -             return ioport_map(start, len);
> 
> I don't know who all the consumers of pci_iomap() are. If user space
> can somehow call this, it should fail for IO port space "mappings"
> since unlike x86, parisc has no INB/OUTB instructions. Generating IO
> Port space requires frobbing PCI Bus controller registers that I don't
> think we want to expose to user space.
> 
> I'm going to assume this is NOT a problem since any code that
> generates anything that tries to look like an INB/OUTB just won't
> compile on parisc.  I think removing the parisc specific definition
> and using the generic one instead looks fine to me.  But I'm not
> confident enough to offer a formal ACKed-by line. Sorry. :(
> 
(Continue reading)


Gmane