Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 903bdbe2 authored by David Woodhouse's avatar David Woodhouse Committed by Bjorn Helgaas
Browse files

mn10300/PCI: Use generic pci_mmap_resource_range()



This was setting vma->vm_flags |= VM_LOCKED. Not sure why...

Signed-off-by: default avatarDavid Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Reviewed-by: default avatarDavid Howells <dhowells@redhat.com>
parent 35368f80
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ static inline int pci_controller_num(struct pci_dev *dev)
}

#define HAVE_PCI_MMAP
#define ARCH_GENERIC_PCI_MMAP_RESOURCE

#endif /* __KERNEL__ */

+0 −24
Original line number Diff line number Diff line
@@ -210,27 +210,3 @@ void __init pcibios_resource_survey(void)
	pcibios_allocate_resources(0);
	pcibios_allocate_resources(1);
}

int pci_mmap_page_range(struct pci_dev *dev, int bar,
			struct vm_area_struct *vma,
			enum pci_mmap_state mmap_state, int write_combine)
{
	unsigned long prot;

	/* Leave vm_pgoff as-is, the PCI space address is the physical
	 * address on this platform.
	 */
	vma->vm_flags |= VM_LOCKED;

	prot = pgprot_val(vma->vm_page_prot);
	prot &= ~_PAGE_CACHE;
	vma->vm_page_prot = __pgprot(prot);

	/* Write-combine setting is ignored */
	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;
}