* [PATCH] arch/xx/pci: remap_pfn_range -> io_remap_pfn_range
@ 2005-07-25 22:32 Michael S. Tsirkin
2005-07-28 4:26 ` Greg KH
0 siblings, 1 reply; 10+ messages in thread
From: Michael S. Tsirkin @ 2005-07-25 22:32 UTC (permalink / raw)
To: gregkh, linux-pci, linux-kernel, mj; +Cc: openib-general
Greg, Martin, does the following make sense?
If it does, should other architectures be updated as well?
---
Convert i386/pci to use io_remap_pfn_range instead of remap_pfn_range.
Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Index: linux-2.6.12.2/arch/i386/pci/i386.c
===================================================================
--- linux-2.6.12.2.orig/arch/i386/pci/i386.c
+++ linux-2.6.12.2/arch/i386/pci/i386.c
@@ -295,9 +295,9 @@ int pci_mmap_page_range(struct pci_dev *
/* Write-combine setting is ignored, it is changed via the mtrr
* interfaces on this platform.
*/
- if (remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
- vma->vm_end - vma->vm_start,
- vma->vm_page_prot))
+ if (io_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
+ vma->vm_end - vma->vm_start,
+ vma->vm_page_prot))
return -EAGAIN;
return 0;
--
MST
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] arch/xx/pci: remap_pfn_range -> io_remap_pfn_range
2005-07-25 22:32 [PATCH] arch/xx/pci: remap_pfn_range -> io_remap_pfn_range Michael S. Tsirkin
@ 2005-07-28 4:26 ` Greg KH
2005-07-28 4:30 ` [openib-general] " Roland Dreier
2005-07-28 6:48 ` Michael S. Tsirkin
0 siblings, 2 replies; 10+ messages in thread
From: Greg KH @ 2005-07-28 4:26 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: linux-pci, linux-kernel, mj, openib-general
On Tue, Jul 26, 2005 at 01:32:00AM +0300, Michael S. Tsirkin wrote:
> Greg, Martin, does the following make sense?
> If it does, should other architectures be updated as well?
>
> ---
>
> Convert i386/pci to use io_remap_pfn_range instead of remap_pfn_range.
>
> Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
>
> Index: linux-2.6.12.2/arch/i386/pci/i386.c
> ===================================================================
> --- linux-2.6.12.2.orig/arch/i386/pci/i386.c
> +++ linux-2.6.12.2/arch/i386/pci/i386.c
> @@ -295,9 +295,9 @@ int pci_mmap_page_range(struct pci_dev *
> /* Write-combine setting is ignored, it is changed via the mtrr
> * interfaces on this platform.
> */
> - if (remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
> - vma->vm_end - vma->vm_start,
> - vma->vm_page_prot))
> + if (io_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
> + vma->vm_end - vma->vm_start,
> + vma->vm_page_prot))
Hm, you do realize that io_remap_pfn_range() is the same thing as
remap_pfn_range() on i386, right?
So, why would this patch change anything?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [openib-general] Re: [PATCH] arch/xx/pci: remap_pfn_range -> io_remap_pfn_range
2005-07-28 4:26 ` Greg KH
@ 2005-07-28 4:30 ` Roland Dreier
2005-07-28 4:50 ` Greg KH
2005-07-28 6:48 ` Michael S. Tsirkin
1 sibling, 1 reply; 10+ messages in thread
From: Roland Dreier @ 2005-07-28 4:30 UTC (permalink / raw)
To: Greg KH; +Cc: Michael S. Tsirkin, linux-pci, openib-general, linux-kernel, mj
Greg> Hm, you do realize that io_remap_pfn_range() is the same
Greg> thing as remap_pfn_range() on i386, right?
Greg> So, why would this patch change anything?
It's not the same thing under Xen. I think this patch fixes userspace
access to PCI memory for XenLinux.
- R.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [openib-general] Re: [PATCH] arch/xx/pci: remap_pfn_range -> io_remap_pfn_range
2005-07-28 4:30 ` [openib-general] " Roland Dreier
@ 2005-07-28 4:50 ` Greg KH
0 siblings, 0 replies; 10+ messages in thread
From: Greg KH @ 2005-07-28 4:50 UTC (permalink / raw)
To: Roland Dreier
Cc: Michael S. Tsirkin, linux-pci, openib-general, linux-kernel, mj
On Wed, Jul 27, 2005 at 09:30:17PM -0700, Roland Dreier wrote:
> Greg> Hm, you do realize that io_remap_pfn_range() is the same
> Greg> thing as remap_pfn_range() on i386, right?
>
> Greg> So, why would this patch change anything?
>
> It's not the same thing under Xen. I think this patch fixes userspace
> access to PCI memory for XenLinux.
But Xen is a separate arch, and hence, will get different pci arch
specific functions, right?
In short, what is this patch trying to fix? What is the problem anyone
is seeing with the existing code?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] arch/xx/pci: remap_pfn_range -> io_remap_pfn_range
2005-07-28 4:26 ` Greg KH
2005-07-28 4:30 ` [openib-general] " Roland Dreier
@ 2005-07-28 6:48 ` Michael S. Tsirkin
2005-07-28 6:58 ` Greg KH
1 sibling, 1 reply; 10+ messages in thread
From: Michael S. Tsirkin @ 2005-07-28 6:48 UTC (permalink / raw)
To: Greg KH; +Cc: linux-pci, linux-kernel, mj, openib-general
Quoting r. Greg KH <gregkh@suse.de>:
> Subject: Re: [PATCH] arch/xx/pci: remap_pfn_range -> io_remap_pfn_range
>
> On Tue, Jul 26, 2005 at 01:32:00AM +0300, Michael S. Tsirkin wrote:
> > Greg, Martin, does the following make sense?
> > If it does, should other architectures be updated as well?
> >
> Hm, you do realize that io_remap_pfn_range() is the same thing as
> remap_pfn_range() on i386, right?
>
> So, why would this patch change anything?
>
> thanks,
>
> greg k-h
>
It doesnt change any behaviour.
Its a style issue I'm trying to fix: even in arch specific code, isnt it better
to use a generic io_remap_pfn_range to map PCI memory?
--
MST
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] arch/xx/pci: remap_pfn_range -> io_remap_pfn_range
2005-07-28 6:48 ` Michael S. Tsirkin
@ 2005-07-28 6:58 ` Greg KH
0 siblings, 0 replies; 10+ messages in thread
From: Greg KH @ 2005-07-28 6:58 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: linux-pci, linux-kernel, mj, openib-general
On Thu, Jul 28, 2005 at 09:48:59AM +0300, Michael S. Tsirkin wrote:
> Quoting r. Greg KH <gregkh@suse.de>:
> > Subject: Re: [PATCH] arch/xx/pci: remap_pfn_range -> io_remap_pfn_range
> >
> > On Tue, Jul 26, 2005 at 01:32:00AM +0300, Michael S. Tsirkin wrote:
> > > Greg, Martin, does the following make sense?
> > > If it does, should other architectures be updated as well?
> > >
> > Hm, you do realize that io_remap_pfn_range() is the same thing as
> > remap_pfn_range() on i386, right?
> >
> > So, why would this patch change anything?
> >
> > thanks,
> >
> > greg k-h
> >
>
> It doesnt change any behaviour.
> Its a style issue I'm trying to fix: even in arch specific code, isnt it better
> to use a generic io_remap_pfn_range to map PCI memory?
As I said above, it's the same thing on i386.
But, if you are getting picky, you should fix all of the other arches
too, right?
Anyway, why change this, I don't really see the need.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [openib-general] Re: [PATCH] arch/xx/pci: remap_pfn_range -> io_remap_pfn_range
@ 2005-07-28 11:57 Ian Pratt
2005-07-28 14:18 ` Randy.Dunlap
2005-07-28 16:17 ` Greg KH
0 siblings, 2 replies; 10+ messages in thread
From: Ian Pratt @ 2005-07-28 11:57 UTC (permalink / raw)
To: Greg KH, Roland Dreier
Cc: Michael S. Tsirkin, linux-pci, openib-general, linux-kernel, mj,
ian.pratt
> > Greg> Hm, you do realize that io_remap_pfn_range() is the same
> > Greg> thing as remap_pfn_range() on i386, right?
> >
> > Greg> So, why would this patch change anything?
> >
> > It's not the same thing under Xen. I think this patch
> fixes userspace
> > access to PCI memory for XenLinux.
>
> But Xen is a separate arch, and hence, will get different pci
> arch specific functions, right?
>
> In short, what is this patch trying to fix? What is the
> problem anyone is seeing with the existing code?
As I understand it, remap_pfn_range should be used for mapping pages
that are backed by memory, and io_remap_pfn_range should be used for
mapping MMIO regions.
There's a distinciton between the two for architectures like Sparc and
xen/x86.
For example, drivers/char/mem.c uses io_remap_pfn_range for mmap'ing
/dev/mem
Ian
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [openib-general] Re: [PATCH] arch/xx/pci: remap_pfn_range -> io_remap_pfn_range
2005-07-28 11:57 [openib-general] " Ian Pratt
@ 2005-07-28 14:18 ` Randy.Dunlap
2005-07-28 16:17 ` Greg KH
1 sibling, 0 replies; 10+ messages in thread
From: Randy.Dunlap @ 2005-07-28 14:18 UTC (permalink / raw)
To: Ian Pratt
Cc: gregkh, rolandd, mst, linux-pci, openib-general, linux-kernel, mj,
ian.pratt
On Thu, 28 Jul 2005 12:57:51 +0100 Ian Pratt wrote:
> > > Greg> Hm, you do realize that io_remap_pfn_range() is the same
> > > Greg> thing as remap_pfn_range() on i386, right?
> > >
> > > Greg> So, why would this patch change anything?
> > >
> > > It's not the same thing under Xen. I think this patch
> > fixes userspace
> > > access to PCI memory for XenLinux.
> >
> > But Xen is a separate arch, and hence, will get different pci
> > arch specific functions, right?
> >
> > In short, what is this patch trying to fix? What is the
> > problem anyone is seeing with the existing code?
>
> As I understand it, remap_pfn_range should be used for mapping pages
> that are backed by memory, and io_remap_pfn_range should be used for
> mapping MMIO regions.
> There's a distinciton between the two for architectures like Sparc and
> xen/x86.
>
> For example, drivers/char/mem.c uses io_remap_pfn_range for mmap'ing
> /dev/mem
That is my (limited) understanding also, but when I built
io_remap_pfn_range(), I didn't search all callers of
remap_pfn_range() to see which ones that I could fix (or break)
by changing them. Mostly due to the possible breakage part.
---
~Randy
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [openib-general] Re: [PATCH] arch/xx/pci: remap_pfn_range -> io_remap_pfn_range
@ 2005-07-28 14:40 Ian Pratt
0 siblings, 0 replies; 10+ messages in thread
From: Ian Pratt @ 2005-07-28 14:40 UTC (permalink / raw)
To: Randy.Dunlap
Cc: gregkh, rolandd, mst, linux-pci, openib-general, linux-kernel, mj,
ian.pratt, ian.pratt
> > For example, drivers/char/mem.c uses io_remap_pfn_range for
> mmap'ing
> > /dev/mem
>
> That is my (limited) understanding also, but when I built
> io_remap_pfn_range(), I didn't search all callers of
> remap_pfn_range() to see which ones that I could fix (or
> break) by changing them. Mostly due to the possible breakage part.
Yep, its not entirely trivial to determine the intended usage. In
particular, some of the sound drivers require both versions in the same
file.
It's probably best to rely on Xen/Sparc users to find them on a case by
case basis and ask for them to be fixed (unless someone's feeling
brave...)
Ian
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [openib-general] Re: [PATCH] arch/xx/pci: remap_pfn_range -> io_remap_pfn_range
2005-07-28 11:57 [openib-general] " Ian Pratt
2005-07-28 14:18 ` Randy.Dunlap
@ 2005-07-28 16:17 ` Greg KH
1 sibling, 0 replies; 10+ messages in thread
From: Greg KH @ 2005-07-28 16:17 UTC (permalink / raw)
To: Ian Pratt
Cc: Roland Dreier, Michael S. Tsirkin, linux-pci, openib-general,
linux-kernel, mj, ian.pratt
On Thu, Jul 28, 2005 at 12:57:51PM +0100, Ian Pratt wrote:
> > > Greg> Hm, you do realize that io_remap_pfn_range() is the same
> > > Greg> thing as remap_pfn_range() on i386, right?
> > >
> > > Greg> So, why would this patch change anything?
> > >
> > > It's not the same thing under Xen. I think this patch
> > fixes userspace
> > > access to PCI memory for XenLinux.
> >
> > But Xen is a separate arch, and hence, will get different pci
> > arch specific functions, right?
> >
> > In short, what is this patch trying to fix? What is the
> > problem anyone is seeing with the existing code?
>
> As I understand it, remap_pfn_range should be used for mapping pages
> that are backed by memory, and io_remap_pfn_range should be used for
> mapping MMIO regions.
> There's a distinciton between the two for architectures like Sparc and
> xen/x86.
I agree, but not for i386, which is what the patch was trying to change.
If this is a fix for xen, fine, then say so in the changelog information
for the patch, as it is, no such information was given.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2005-07-28 16:19 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-25 22:32 [PATCH] arch/xx/pci: remap_pfn_range -> io_remap_pfn_range Michael S. Tsirkin
2005-07-28 4:26 ` Greg KH
2005-07-28 4:30 ` [openib-general] " Roland Dreier
2005-07-28 4:50 ` Greg KH
2005-07-28 6:48 ` Michael S. Tsirkin
2005-07-28 6:58 ` Greg KH
-- strict thread matches above, loose matches on Subject: below --
2005-07-28 11:57 [openib-general] " Ian Pratt
2005-07-28 14:18 ` Randy.Dunlap
2005-07-28 16:17 ` Greg KH
2005-07-28 14:40 Ian Pratt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox