Skip to contentSkip to conversation

arch/xx/pci: remap_pfn_range -> io_remap_pfn_range

PATCH In review Michael S. Tsirkin 3 participants 6 messages Jul 25, 2005 – Jul 28, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arch/xx/pci: remap_pfn_range -> io_remap_pfn_range

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.

arch/i386/pci/i386.c +3 -3
Index: 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;
Signature · 1 line
MST
#1 lore raw
Quoted 14 lines · Michael S. Tsirkin

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.

Index: linux-2.6.12.2/arch/i386/pci/i386.c
===================================================================

arch/i386/pci/i386.c int pci_mmap_page_range(struct pci_dev * · line 300

Quoted 9 lines
arch/i386/pci/i386.c +3 -3
@@ -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

#2 lore raw

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.

#3 lore raw
Quoted 7 lines · Roland Dreier

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

#4 lore raw
In reply to Greg KH

Quoting r. Greg KH <[email protected]>:

Quoted 6 lines

Subject: Re: [PATCH] arch/xx/pci: remap_pfn_range -> io_remap_pfn_range

Quoted 3 lines · Michael S. Tsirkin

Greg, Martin, does the following make sense?
If it does, should other architectures be updated as well?

Quoted 9 lines

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?

Signature · 1 line
MST
#5 lore raw
Quoted 12 lines · Michael S. Tsirkin

Quoting r. Greg KH <[email protected]>:

Quoted 11 lines

Subject: Re: [PATCH] arch/xx/pci: remap_pfn_range -> io_remap_pfn_range

Quoted 3 lines · Michael S. Tsirkin

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?

Quoted 8 lines
Quoted 4 lines

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