diff options
author | Yinghai Lu <yinghai@kernel.org> | 2012-11-04 00:39:28 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2013-01-07 17:58:43 -0500 |
commit | 745216025de0354eea23493d994e3fc0ab7369fc (patch) | |
tree | f078a19befc5fd3699b4ed4e637c91a11d44fe40 /arch/x86/pci | |
parent | dc2f56fa8400677ef4852d5128f03b795cf57e7b (diff) |
x86/PCI: Don't track firmware-assigned BAR values for hot-added devices
The BIOS doesn't assign BAR values for hot-added devices, so don't
bother saving the original values when we enumerate these devices.
[bhelgaas: changelog, return constant 0 in pcibios_retrieve_fw_addr]
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'arch/x86/pci')
-rw-r--r-- | arch/x86/pci/i386.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c index 42dd75552351..1bd672ab0084 100644 --- a/arch/x86/pci/i386.c +++ b/arch/x86/pci/i386.c | |||
@@ -51,6 +51,7 @@ struct pcibios_fwaddrmap { | |||
51 | 51 | ||
52 | static LIST_HEAD(pcibios_fwaddrmappings); | 52 | static LIST_HEAD(pcibios_fwaddrmappings); |
53 | static DEFINE_SPINLOCK(pcibios_fwaddrmap_lock); | 53 | static DEFINE_SPINLOCK(pcibios_fwaddrmap_lock); |
54 | static bool pcibios_fw_addr_done; | ||
54 | 55 | ||
55 | /* Must be called with 'pcibios_fwaddrmap_lock' lock held. */ | 56 | /* Must be called with 'pcibios_fwaddrmap_lock' lock held. */ |
56 | static struct pcibios_fwaddrmap *pcibios_fwaddrmap_lookup(struct pci_dev *dev) | 57 | static struct pcibios_fwaddrmap *pcibios_fwaddrmap_lookup(struct pci_dev *dev) |
@@ -72,6 +73,9 @@ pcibios_save_fw_addr(struct pci_dev *dev, int idx, resource_size_t fw_addr) | |||
72 | unsigned long flags; | 73 | unsigned long flags; |
73 | struct pcibios_fwaddrmap *map; | 74 | struct pcibios_fwaddrmap *map; |
74 | 75 | ||
76 | if (pcibios_fw_addr_done) | ||
77 | return; | ||
78 | |||
75 | spin_lock_irqsave(&pcibios_fwaddrmap_lock, flags); | 79 | spin_lock_irqsave(&pcibios_fwaddrmap_lock, flags); |
76 | map = pcibios_fwaddrmap_lookup(dev); | 80 | map = pcibios_fwaddrmap_lookup(dev); |
77 | if (!map) { | 81 | if (!map) { |
@@ -97,6 +101,9 @@ resource_size_t pcibios_retrieve_fw_addr(struct pci_dev *dev, int idx) | |||
97 | struct pcibios_fwaddrmap *map; | 101 | struct pcibios_fwaddrmap *map; |
98 | resource_size_t fw_addr = 0; | 102 | resource_size_t fw_addr = 0; |
99 | 103 | ||
104 | if (pcibios_fw_addr_done) | ||
105 | return 0; | ||
106 | |||
100 | spin_lock_irqsave(&pcibios_fwaddrmap_lock, flags); | 107 | spin_lock_irqsave(&pcibios_fwaddrmap_lock, flags); |
101 | map = pcibios_fwaddrmap_lookup(dev); | 108 | map = pcibios_fwaddrmap_lookup(dev); |
102 | if (map) | 109 | if (map) |
@@ -106,7 +113,7 @@ resource_size_t pcibios_retrieve_fw_addr(struct pci_dev *dev, int idx) | |||
106 | return fw_addr; | 113 | return fw_addr; |
107 | } | 114 | } |
108 | 115 | ||
109 | static void pcibios_fw_addr_list_del(void) | 116 | static void __init pcibios_fw_addr_list_del(void) |
110 | { | 117 | { |
111 | unsigned long flags; | 118 | unsigned long flags; |
112 | struct pcibios_fwaddrmap *entry, *next; | 119 | struct pcibios_fwaddrmap *entry, *next; |
@@ -118,6 +125,7 @@ static void pcibios_fw_addr_list_del(void) | |||
118 | kfree(entry); | 125 | kfree(entry); |
119 | } | 126 | } |
120 | spin_unlock_irqrestore(&pcibios_fwaddrmap_lock, flags); | 127 | spin_unlock_irqrestore(&pcibios_fwaddrmap_lock, flags); |
128 | pcibios_fw_addr_done = true; | ||
121 | } | 129 | } |
122 | 130 | ||
123 | static int | 131 | static int |