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

Commit 95025d6b authored by Linus Torvalds's avatar Linus Torvalds
Browse files


arch: fix ioport mapping on mips,sh

Kevin Cernekee reported that recent cleanup that replaced pci_iomap with
a generic function failed to take into account the differences in io
port handling on mips and sh architectures.

Rather than revert the changes reintroducing the code duplication, this
patchset fixes this by adding ability for architectures to override
ioport mapping for pci devices.

Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
  sh: use the the PCI channels's io_map_base
  mips: use the the PCI controller's io_map_base
  lib: add NO_GENERIC_PCI_IOPORT_MAP
parents 59c1204d 1e05b62a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2356,6 +2356,7 @@ config PCI
	depends on HW_HAS_PCI
	select PCI_DOMAINS
	select GENERIC_PCI_IOMAP
	select NO_GENERIC_PCI_IOPORT_MAP
	help
	  Find out whether you have a PCI motherboard. PCI is the name of a
	  bus system, i.e. the way the CPU talks to the other stuff inside
+2 −2
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@
#include <linux/module.h>
#include <asm/io.h>

static void __iomem *ioport_map_pci(struct pci_dev *dev,
void __iomem *__pci_ioport_map(struct pci_dev *dev,
			       unsigned long port, unsigned int nr)
{
	struct pci_controller *ctrl = dev->bus->sysdata;
+1 −0
Original line number Diff line number Diff line
@@ -859,6 +859,7 @@ config PCI
	depends on SYS_SUPPORTS_PCI
	select PCI_DOMAINS
	select GENERIC_PCI_IOMAP
	select NO_GENERIC_PCI_IOPORT_MAP
	help
	  Find out whether you have a PCI motherboard. PCI is the name of a
	  bus system, i.e. the way the CPU talks to the other stuff inside
+2 −2
Original line number Diff line number Diff line
@@ -356,7 +356,7 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,

#ifndef CONFIG_GENERIC_IOMAP

static void __iomem *ioport_map_pci(struct pci_dev *dev,
void __iomem *__pci_ioport_map(struct pci_dev *dev,
			       unsigned long port, unsigned int nr)
{
	struct pci_channel *chan = dev->sysdata;
+10 −0
Original line number Diff line number Diff line
@@ -15,6 +15,16 @@ struct pci_dev;
#ifdef CONFIG_PCI
/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */
extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
/* Create a virtual mapping cookie for a port on a given PCI device.
 * Do not call this directly, it exists to make it easier for architectures
 * to override */
#ifdef CONFIG_NO_GENERIC_PCI_IOPORT_MAP
extern void __iomem *__pci_ioport_map(struct pci_dev *dev, unsigned long port,
				      unsigned int nr);
#else
#define __pci_ioport_map(dev, port, nr) ioport_map((port), (nr))
#endif

#else
static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max)
{
Loading