diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2008-10-22 22:55:31 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-01-07 14:12:32 -0500 |
commit | e8de1481fd7126ee9e93d6889da6f00c05e1e019 (patch) | |
tree | 3e0e564f6aff2f8f0f66bdf37dc2eb87d6e17cde /include/linux/pci.h | |
parent | 23616941914917cf25b94789856b5326b68d8ee8 (diff) |
resource: allow MMIO exclusivity for device drivers
Device drivers that use pci_request_regions() (and similar APIs) have a
reasonable expectation that they are the only ones accessing their device.
As part of the e1000e hunt, we were afraid that some userland (X or some
bootsplash stuff) was mapping the MMIO region that the driver thought it
had exclusively via /dev/mem or via various sysfs resource mappings.
This patch adds the option for device drivers to cause their reserved
regions to the "banned from /dev/mem use" list, so now both kernel memory
and device-exclusive MMIO regions are banned.
NOTE: This is only active when CONFIG_STRICT_DEVMEM is set.
In addition to the config option, a kernel parameter iomem=relaxed is
provided for the cases where developers want to diagnose, in the field,
drivers issues from userspace.
Reviewed-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'include/linux/pci.h')
-rw-r--r-- | include/linux/pci.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h index 59a3dc2059d3..bfcb39ca8879 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -686,10 +686,13 @@ void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *), | |||
686 | int (*)(struct pci_dev *, u8, u8)); | 686 | int (*)(struct pci_dev *, u8, u8)); |
687 | #define HAVE_PCI_REQ_REGIONS 2 | 687 | #define HAVE_PCI_REQ_REGIONS 2 |
688 | int __must_check pci_request_regions(struct pci_dev *, const char *); | 688 | int __must_check pci_request_regions(struct pci_dev *, const char *); |
689 | int __must_check pci_request_regions_exclusive(struct pci_dev *, const char *); | ||
689 | void pci_release_regions(struct pci_dev *); | 690 | void pci_release_regions(struct pci_dev *); |
690 | int __must_check pci_request_region(struct pci_dev *, int, const char *); | 691 | int __must_check pci_request_region(struct pci_dev *, int, const char *); |
692 | int __must_check pci_request_region_exclusive(struct pci_dev *, int, const char *); | ||
691 | void pci_release_region(struct pci_dev *, int); | 693 | void pci_release_region(struct pci_dev *, int); |
692 | int pci_request_selected_regions(struct pci_dev *, int, const char *); | 694 | int pci_request_selected_regions(struct pci_dev *, int, const char *); |
695 | int pci_request_selected_regions_exclusive(struct pci_dev *, int, const char *); | ||
693 | void pci_release_selected_regions(struct pci_dev *, int); | 696 | void pci_release_selected_regions(struct pci_dev *, int); |
694 | 697 | ||
695 | /* drivers/pci/bus.c */ | 698 | /* drivers/pci/bus.c */ |