public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [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
* 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 16:17 ` Greg KH
  0 siblings, 1 reply; 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

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-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 16:17 ` Greg KH
2005-07-31  8:51   ` Michael S. Tsirkin

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