diff options
author | Len Brown <len.brown@intel.com> | 2005-09-08 01:45:47 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2005-09-08 01:45:47 -0400 |
commit | 64e47488c913ac704d465a6af86a26786d1412a5 (patch) | |
tree | d3b0148592963dcde26e4bb35ddfec8b1eaf8e23 /drivers/pci | |
parent | 4a35a46bf1cda4737c428380d1db5d15e2590d18 (diff) | |
parent | caf39e87cc1182f7dae84eefc43ca14d54c78ef9 (diff) |
Merge linux-2.6 with linux-acpi-2.6
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/msi.c | 17 | ||||
-rw-r--r-- | drivers/pci/msi.h | 5 | ||||
-rw-r--r-- | drivers/pci/pci.c | 14 | ||||
-rw-r--r-- | drivers/pci/quirks.c | 19 |
4 files changed, 33 insertions, 22 deletions
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 2b85aa39f954..532f73bb2224 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c | |||
@@ -91,6 +91,7 @@ static void set_msi_affinity(unsigned int vector, cpumask_t cpu_mask) | |||
91 | { | 91 | { |
92 | struct msi_desc *entry; | 92 | struct msi_desc *entry; |
93 | struct msg_address address; | 93 | struct msg_address address; |
94 | unsigned int irq = vector; | ||
94 | 95 | ||
95 | entry = (struct msi_desc *)msi_desc[vector]; | 96 | entry = (struct msi_desc *)msi_desc[vector]; |
96 | if (!entry || !entry->dev) | 97 | if (!entry || !entry->dev) |
@@ -112,6 +113,7 @@ static void set_msi_affinity(unsigned int vector, cpumask_t cpu_mask) | |||
112 | entry->msi_attrib.current_cpu = cpu_mask_to_apicid(cpu_mask); | 113 | entry->msi_attrib.current_cpu = cpu_mask_to_apicid(cpu_mask); |
113 | pci_write_config_dword(entry->dev, msi_lower_address_reg(pos), | 114 | pci_write_config_dword(entry->dev, msi_lower_address_reg(pos), |
114 | address.lo_address.value); | 115 | address.lo_address.value); |
116 | set_native_irq_info(irq, cpu_mask); | ||
115 | break; | 117 | break; |
116 | } | 118 | } |
117 | case PCI_CAP_ID_MSIX: | 119 | case PCI_CAP_ID_MSIX: |
@@ -125,22 +127,13 @@ static void set_msi_affinity(unsigned int vector, cpumask_t cpu_mask) | |||
125 | MSI_TARGET_CPU_SHIFT); | 127 | MSI_TARGET_CPU_SHIFT); |
126 | entry->msi_attrib.current_cpu = cpu_mask_to_apicid(cpu_mask); | 128 | entry->msi_attrib.current_cpu = cpu_mask_to_apicid(cpu_mask); |
127 | writel(address.lo_address.value, entry->mask_base + offset); | 129 | writel(address.lo_address.value, entry->mask_base + offset); |
130 | set_native_irq_info(irq, cpu_mask); | ||
128 | break; | 131 | break; |
129 | } | 132 | } |
130 | default: | 133 | default: |
131 | break; | 134 | break; |
132 | } | 135 | } |
133 | } | 136 | } |
134 | |||
135 | #ifdef CONFIG_IRQBALANCE | ||
136 | static inline void move_msi(int vector) | ||
137 | { | ||
138 | if (!cpus_empty(pending_irq_balance_cpumask[vector])) { | ||
139 | set_msi_affinity(vector, pending_irq_balance_cpumask[vector]); | ||
140 | cpus_clear(pending_irq_balance_cpumask[vector]); | ||
141 | } | ||
142 | } | ||
143 | #endif /* CONFIG_IRQBALANCE */ | ||
144 | #endif /* CONFIG_SMP */ | 137 | #endif /* CONFIG_SMP */ |
145 | 138 | ||
146 | static void mask_MSI_irq(unsigned int vector) | 139 | static void mask_MSI_irq(unsigned int vector) |
@@ -191,13 +184,13 @@ static void shutdown_msi_irq(unsigned int vector) | |||
191 | 184 | ||
192 | static void end_msi_irq_wo_maskbit(unsigned int vector) | 185 | static void end_msi_irq_wo_maskbit(unsigned int vector) |
193 | { | 186 | { |
194 | move_msi(vector); | 187 | move_native_irq(vector); |
195 | ack_APIC_irq(); | 188 | ack_APIC_irq(); |
196 | } | 189 | } |
197 | 190 | ||
198 | static void end_msi_irq_w_maskbit(unsigned int vector) | 191 | static void end_msi_irq_w_maskbit(unsigned int vector) |
199 | { | 192 | { |
200 | move_msi(vector); | 193 | move_native_irq(vector); |
201 | unmask_MSI_irq(vector); | 194 | unmask_MSI_irq(vector); |
202 | ack_APIC_irq(); | 195 | ack_APIC_irq(); |
203 | } | 196 | } |
diff --git a/drivers/pci/msi.h b/drivers/pci/msi.h index 390f1851c0f1..402136a5c9e4 100644 --- a/drivers/pci/msi.h +++ b/drivers/pci/msi.h | |||
@@ -19,7 +19,6 @@ | |||
19 | #define NR_HP_RESERVED_VECTORS 20 | 19 | #define NR_HP_RESERVED_VECTORS 20 |
20 | 20 | ||
21 | extern int vector_irq[NR_VECTORS]; | 21 | extern int vector_irq[NR_VECTORS]; |
22 | extern cpumask_t pending_irq_balance_cpumask[NR_IRQS]; | ||
23 | extern void (*interrupt[NR_IRQS])(void); | 22 | extern void (*interrupt[NR_IRQS])(void); |
24 | extern int pci_vector_resources(int last, int nr_released); | 23 | extern int pci_vector_resources(int last, int nr_released); |
25 | 24 | ||
@@ -29,10 +28,6 @@ extern int pci_vector_resources(int last, int nr_released); | |||
29 | #define set_msi_irq_affinity NULL | 28 | #define set_msi_irq_affinity NULL |
30 | #endif | 29 | #endif |
31 | 30 | ||
32 | #ifndef CONFIG_IRQBALANCE | ||
33 | static inline void move_msi(int vector) {} | ||
34 | #endif | ||
35 | |||
36 | /* | 31 | /* |
37 | * MSI-X Address Register | 32 | * MSI-X Address Register |
38 | */ | 33 | */ |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 1b34fc56067e..c62d2f043397 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -333,13 +333,17 @@ pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state) | |||
333 | if (platform_pci_choose_state) { | 333 | if (platform_pci_choose_state) { |
334 | ret = platform_pci_choose_state(dev, state); | 334 | ret = platform_pci_choose_state(dev, state); |
335 | if (ret >= 0) | 335 | if (ret >= 0) |
336 | state = ret; | 336 | state.event = ret; |
337 | } | 337 | } |
338 | switch (state) { | 338 | |
339 | case 0: return PCI_D0; | 339 | switch (state.event) { |
340 | case 3: return PCI_D3hot; | 340 | case PM_EVENT_ON: |
341 | return PCI_D0; | ||
342 | case PM_EVENT_FREEZE: | ||
343 | case PM_EVENT_SUSPEND: | ||
344 | return PCI_D3hot; | ||
341 | default: | 345 | default: |
342 | printk("They asked me for state %d\n", state); | 346 | printk("They asked me for state %d\n", state.event); |
343 | BUG(); | 347 | BUG(); |
344 | } | 348 | } |
345 | return PCI_D0; | 349 | return PCI_D0; |
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index bb36bb69803f..140354a2aa72 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -422,6 +422,25 @@ static void __devinit quirk_via_ioapic(struct pci_dev *dev) | |||
422 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686, quirk_via_ioapic ); | 422 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686, quirk_via_ioapic ); |
423 | 423 | ||
424 | /* | 424 | /* |
425 | * VIA 8237: Some BIOSs don't set the 'Bypass APIC De-Assert Message' Bit. | ||
426 | * This leads to doubled level interrupt rates. | ||
427 | * Set this bit to get rid of cycle wastage. | ||
428 | * Otherwise uncritical. | ||
429 | */ | ||
430 | static void __devinit quirk_via_vt8237_bypass_apic_deassert(struct pci_dev *dev) | ||
431 | { | ||
432 | u8 misc_control2; | ||
433 | #define BYPASS_APIC_DEASSERT 8 | ||
434 | |||
435 | pci_read_config_byte(dev, 0x5B, &misc_control2); | ||
436 | if (!(misc_control2 & BYPASS_APIC_DEASSERT)) { | ||
437 | printk(KERN_INFO "PCI: Bypassing VIA 8237 APIC De-Assert Message\n"); | ||
438 | pci_write_config_byte(dev, 0x5B, misc_control2|BYPASS_APIC_DEASSERT); | ||
439 | } | ||
440 | } | ||
441 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, quirk_via_vt8237_bypass_apic_deassert); | ||
442 | |||
443 | /* | ||
425 | * The AMD io apic can hang the box when an apic irq is masked. | 444 | * The AMD io apic can hang the box when an apic irq is masked. |
426 | * We check all revs >= B0 (yet not in the pre production!) as the bug | 445 | * We check all revs >= B0 (yet not in the pre production!) as the bug |
427 | * is currently marked NoFix | 446 | * is currently marked NoFix |