diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-28 13:59:18 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-28 13:59:18 -0500 |
commit | c7e15899d07c9813c1aa96b21699d2d9c8314c4b (patch) | |
tree | 16e9b4dceddf1b4d1dad05588d700c70cf8fcb88 /drivers/pci/pci.c | |
parent | f6a0b5cd34d6e922cc7258c5429fb0f17508ceb6 (diff) | |
parent | 78c06176466cbd1b3f0f67709d3023c40dbebcbd (diff) |
Merge branch 'x86-pci-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-pci-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
x86: Enable NMI on all cpus on UV
vgaarb: Add user selectability of the number of GPUS in a system
vgaarb: Fix VGA arbiter to accept PCI domains other than 0
x86, uv: Update UV arch to target Legacy VGA I/O correctly.
pci: Update pci_set_vga_state() to call arch functions
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r-- | drivers/pci/pci.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 2b9ac9e594af..5b548aee9cbc 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -2754,6 +2754,23 @@ int pci_resource_bar(struct pci_dev *dev, int resno, enum pci_bar_type *type) | |||
2754 | return 0; | 2754 | return 0; |
2755 | } | 2755 | } |
2756 | 2756 | ||
2757 | /* Some architectures require additional programming to enable VGA */ | ||
2758 | static arch_set_vga_state_t arch_set_vga_state; | ||
2759 | |||
2760 | void __init pci_register_set_vga_state(arch_set_vga_state_t func) | ||
2761 | { | ||
2762 | arch_set_vga_state = func; /* NULL disables */ | ||
2763 | } | ||
2764 | |||
2765 | static int pci_set_vga_state_arch(struct pci_dev *dev, bool decode, | ||
2766 | unsigned int command_bits, bool change_bridge) | ||
2767 | { | ||
2768 | if (arch_set_vga_state) | ||
2769 | return arch_set_vga_state(dev, decode, command_bits, | ||
2770 | change_bridge); | ||
2771 | return 0; | ||
2772 | } | ||
2773 | |||
2757 | /** | 2774 | /** |
2758 | * pci_set_vga_state - set VGA decode state on device and parents if requested | 2775 | * pci_set_vga_state - set VGA decode state on device and parents if requested |
2759 | * @dev: the PCI device | 2776 | * @dev: the PCI device |
@@ -2767,9 +2784,15 @@ int pci_set_vga_state(struct pci_dev *dev, bool decode, | |||
2767 | struct pci_bus *bus; | 2784 | struct pci_bus *bus; |
2768 | struct pci_dev *bridge; | 2785 | struct pci_dev *bridge; |
2769 | u16 cmd; | 2786 | u16 cmd; |
2787 | int rc; | ||
2770 | 2788 | ||
2771 | WARN_ON(command_bits & ~(PCI_COMMAND_IO|PCI_COMMAND_MEMORY)); | 2789 | WARN_ON(command_bits & ~(PCI_COMMAND_IO|PCI_COMMAND_MEMORY)); |
2772 | 2790 | ||
2791 | /* ARCH specific VGA enables */ | ||
2792 | rc = pci_set_vga_state_arch(dev, decode, command_bits, change_bridge); | ||
2793 | if (rc) | ||
2794 | return rc; | ||
2795 | |||
2773 | pci_read_config_word(dev, PCI_COMMAND, &cmd); | 2796 | pci_read_config_word(dev, PCI_COMMAND, &cmd); |
2774 | if (decode == true) | 2797 | if (decode == true) |
2775 | cmd |= command_bits; | 2798 | cmd |= command_bits; |
@@ -2984,6 +3007,7 @@ EXPORT_SYMBOL(pcim_pin_device); | |||
2984 | EXPORT_SYMBOL(pci_disable_device); | 3007 | EXPORT_SYMBOL(pci_disable_device); |
2985 | EXPORT_SYMBOL(pci_find_capability); | 3008 | EXPORT_SYMBOL(pci_find_capability); |
2986 | EXPORT_SYMBOL(pci_bus_find_capability); | 3009 | EXPORT_SYMBOL(pci_bus_find_capability); |
3010 | EXPORT_SYMBOL(pci_register_set_vga_state); | ||
2987 | EXPORT_SYMBOL(pci_release_regions); | 3011 | EXPORT_SYMBOL(pci_release_regions); |
2988 | EXPORT_SYMBOL(pci_request_regions); | 3012 | EXPORT_SYMBOL(pci_request_regions); |
2989 | EXPORT_SYMBOL(pci_request_regions_exclusive); | 3013 | EXPORT_SYMBOL(pci_request_regions_exclusive); |
@@ -3015,4 +3039,3 @@ EXPORT_SYMBOL(pci_target_state); | |||
3015 | EXPORT_SYMBOL(pci_prepare_to_sleep); | 3039 | EXPORT_SYMBOL(pci_prepare_to_sleep); |
3016 | EXPORT_SYMBOL(pci_back_from_sleep); | 3040 | EXPORT_SYMBOL(pci_back_from_sleep); |
3017 | EXPORT_SYMBOL_GPL(pci_set_pcie_reset_state); | 3041 | EXPORT_SYMBOL_GPL(pci_set_pcie_reset_state); |
3018 | |||