public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* 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; 7+ 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] 7+ 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; 7+ 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] 7+ messages in thread
* [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; 7+ 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] 7+ messages in thread

end of thread, other threads:[~2005-07-31  8:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-28 11:57 [openib-general] Re: [PATCH] arch/xx/pci: remap_pfn_range -> io_remap_pfn_range Ian Pratt
2005-07-28 14:18 ` Randy.Dunlap
2005-07-28 16:17 ` Greg KH
2005-07-31  8:51   ` Michael S. Tsirkin
  -- strict thread matches above, loose matches on Subject: below --
2005-07-28 14:40 [openib-general] " Ian Pratt
2005-07-25 22:32 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

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