aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw@amazon.co.uk>2017-04-12 08:26:04 -0400
committerBjorn Helgaas <bhelgaas@google.com>2017-04-20 09:47:47 -0400
commit6a94ca14c389b00515b026cd35bcd074dec6f7ff (patch)
tree2f9973c89c78bdb96494dd3eb724ca50db3a83ea
parent903bdbe271217f656d13767d8a3e74b8aabc54c2 (diff)
parisc: Use generic pci_mmap_resource_range()
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-rw-r--r--arch/parisc/include/asm/pci.h1
-rw-r--r--arch/parisc/kernel/pci.c29
2 files changed, 1 insertions, 29 deletions
diff --git a/arch/parisc/include/asm/pci.h b/arch/parisc/include/asm/pci.h
index bb9ea9003e08..1de1a3f412ec 100644
--- a/arch/parisc/include/asm/pci.h
+++ b/arch/parisc/include/asm/pci.h
@@ -200,5 +200,6 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
200} 200}
201 201
202#define HAVE_PCI_MMAP 202#define HAVE_PCI_MMAP
203#define ARCH_GENERIC_PCI_MMAP_RESOURCE
203 204
204#endif /* __ASM_PARISC_PCI_H */ 205#endif /* __ASM_PARISC_PCI_H */
diff --git a/arch/parisc/kernel/pci.c b/arch/parisc/kernel/pci.c
index 653877553acd..13ee3569959a 100644
--- a/arch/parisc/kernel/pci.c
+++ b/arch/parisc/kernel/pci.c
@@ -227,35 +227,6 @@ resource_size_t pcibios_align_resource(void *data, const struct resource *res,
227 return start; 227 return start;
228} 228}
229 229
230
231int pci_mmap_page_range(struct pci_dev *dev, int bar,
232 struct vm_area_struct *vma,
233 enum pci_mmap_state mmap_state, int write_combine)
234{
235 unsigned long prot;
236
237 /*
238 * I/O space can be accessed via normal processor loads and stores on
239 * this platform but for now we elect not to do this and portable
240 * drivers should not do this anyway.
241 */
242 if (mmap_state == pci_mmap_io)
243 return -EINVAL;
244
245 if (write_combine)
246 return -EINVAL;
247
248 /*
249 * Ignore write-combine; for now only return uncached mappings.
250 */
251 prot = pgprot_val(vma->vm_page_prot);
252 prot |= _PAGE_NO_CACHE;
253 vma->vm_page_prot = __pgprot(prot);
254
255 return remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
256 vma->vm_end - vma->vm_start, vma->vm_page_prot);
257}
258
259/* 230/*
260 * A driver is enabling the device. We make sure that all the appropriate 231 * A driver is enabling the device. We make sure that all the appropriate
261 * bits are set to allow the device to operate as the driver is expecting. 232 * bits are set to allow the device to operate as the driver is expecting.