aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/msi.c
diff options
context:
space:
mode:
authorDuanZhenzhong <zhenzhong.duan@oracle.com>2013-12-04 00:09:16 -0500
committerBjorn Helgaas <bhelgaas@google.com>2013-12-13 10:44:30 -0500
commitac8344c4c0bf74c7efaf962cf2a6404331678ce4 (patch)
tree4c6e879af82fae20e86d408253f785d9f04b2f81 /drivers/pci/msi.c
parent6f825b73e249a2b46f0349d1f86adfbb3ea703e0 (diff)
PCI: Drop "irq" param from *_restore_msi_irqs()
Change x86_msi.restore_msi_irqs(struct pci_dev *dev, int irq) to x86_msi.restore_msi_irqs(struct pci_dev *dev). restore_msi_irqs() restores multiple MSI-X IRQs, so param 'int irq' is unneeded. This makes code more consistent between vm and bare metal. Dom0 MSI-X restore code can also be optimized as XEN only has a hypercall to restore all MSI-X vectors at one time. Tested-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/pci/msi.c')
-rw-r--r--drivers/pci/msi.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 3fcd67a16677..51bf0400a889 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -116,7 +116,7 @@ void __weak arch_teardown_msi_irqs(struct pci_dev *dev)
116 return default_teardown_msi_irqs(dev); 116 return default_teardown_msi_irqs(dev);
117} 117}
118 118
119void default_restore_msi_irqs(struct pci_dev *dev, int irq) 119static void default_restore_msi_irq(struct pci_dev *dev, int irq)
120{ 120{
121 struct msi_desc *entry; 121 struct msi_desc *entry;
122 122
@@ -134,9 +134,9 @@ void default_restore_msi_irqs(struct pci_dev *dev, int irq)
134 write_msi_msg(irq, &entry->msg); 134 write_msi_msg(irq, &entry->msg);
135} 135}
136 136
137void __weak arch_restore_msi_irqs(struct pci_dev *dev, int irq) 137void __weak arch_restore_msi_irqs(struct pci_dev *dev)
138{ 138{
139 return default_restore_msi_irqs(dev, irq); 139 return default_restore_msi_irqs(dev);
140} 140}
141 141
142static void msi_set_enable(struct pci_dev *dev, int enable) 142static void msi_set_enable(struct pci_dev *dev, int enable)
@@ -262,6 +262,15 @@ void unmask_msi_irq(struct irq_data *data)
262 msi_set_mask_bit(data, 0); 262 msi_set_mask_bit(data, 0);
263} 263}
264 264
265void default_restore_msi_irqs(struct pci_dev *dev)
266{
267 struct msi_desc *entry;
268
269 list_for_each_entry(entry, &dev->msi_list, list) {
270 default_restore_msi_irq(dev, entry->irq);
271 }
272}
273
265void __read_msi_msg(struct msi_desc *entry, struct msi_msg *msg) 274void __read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
266{ 275{
267 BUG_ON(entry->dev->current_state != PCI_D0); 276 BUG_ON(entry->dev->current_state != PCI_D0);
@@ -430,7 +439,7 @@ static void __pci_restore_msi_state(struct pci_dev *dev)
430 439
431 pci_intx_for_msi(dev, 0); 440 pci_intx_for_msi(dev, 0);
432 msi_set_enable(dev, 0); 441 msi_set_enable(dev, 0);
433 arch_restore_msi_irqs(dev, dev->irq); 442 arch_restore_msi_irqs(dev);
434 443
435 pci_read_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, &control); 444 pci_read_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, &control);
436 msi_mask_irq(entry, msi_capable_mask(control), entry->masked); 445 msi_mask_irq(entry, msi_capable_mask(control), entry->masked);
@@ -455,8 +464,8 @@ static void __pci_restore_msix_state(struct pci_dev *dev)
455 control |= PCI_MSIX_FLAGS_ENABLE | PCI_MSIX_FLAGS_MASKALL; 464 control |= PCI_MSIX_FLAGS_ENABLE | PCI_MSIX_FLAGS_MASKALL;
456 pci_write_config_word(dev, dev->msix_cap + PCI_MSIX_FLAGS, control); 465 pci_write_config_word(dev, dev->msix_cap + PCI_MSIX_FLAGS, control);
457 466
467 arch_restore_msi_irqs(dev);
458 list_for_each_entry(entry, &dev->msi_list, list) { 468 list_for_each_entry(entry, &dev->msi_list, list) {
459 arch_restore_msi_irqs(dev, entry->irq);
460 msix_mask_irq(entry, entry->masked); 469 msix_mask_irq(entry, entry->masked);
461 } 470 }
462 471