diff options
Diffstat (limited to 'drivers/pci/host/vmd.c')
-rw-r--r-- | drivers/pci/host/vmd.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/pci/host/vmd.c b/drivers/pci/host/vmd.c index 6088c3083194..509893bc3e63 100644 --- a/drivers/pci/host/vmd.c +++ b/drivers/pci/host/vmd.c | |||
@@ -183,7 +183,7 @@ static struct vmd_irq_list *vmd_next_irq(struct vmd_dev *vmd, struct msi_desc *d | |||
183 | int i, best = 1; | 183 | int i, best = 1; |
184 | unsigned long flags; | 184 | unsigned long flags; |
185 | 185 | ||
186 | if (!desc->msi_attrib.is_msix || vmd->msix_count == 1) | 186 | if (pci_is_bridge(msi_desc_to_pci_dev(desc)) || vmd->msix_count == 1) |
187 | return &vmd->irqs[0]; | 187 | return &vmd->irqs[0]; |
188 | 188 | ||
189 | raw_spin_lock_irqsave(&list_lock, flags); | 189 | raw_spin_lock_irqsave(&list_lock, flags); |
@@ -697,7 +697,7 @@ static int vmd_probe(struct pci_dev *dev, const struct pci_device_id *id) | |||
697 | return -ENODEV; | 697 | return -ENODEV; |
698 | 698 | ||
699 | vmd->msix_count = pci_alloc_irq_vectors(dev, 1, vmd->msix_count, | 699 | vmd->msix_count = pci_alloc_irq_vectors(dev, 1, vmd->msix_count, |
700 | PCI_IRQ_MSIX | PCI_IRQ_AFFINITY); | 700 | PCI_IRQ_MSIX); |
701 | if (vmd->msix_count < 0) | 701 | if (vmd->msix_count < 0) |
702 | return vmd->msix_count; | 702 | return vmd->msix_count; |
703 | 703 | ||
@@ -755,6 +755,11 @@ static void vmd_remove(struct pci_dev *dev) | |||
755 | static int vmd_suspend(struct device *dev) | 755 | static int vmd_suspend(struct device *dev) |
756 | { | 756 | { |
757 | struct pci_dev *pdev = to_pci_dev(dev); | 757 | struct pci_dev *pdev = to_pci_dev(dev); |
758 | struct vmd_dev *vmd = pci_get_drvdata(pdev); | ||
759 | int i; | ||
760 | |||
761 | for (i = 0; i < vmd->msix_count; i++) | ||
762 | devm_free_irq(dev, pci_irq_vector(pdev, i), &vmd->irqs[i]); | ||
758 | 763 | ||
759 | pci_save_state(pdev); | 764 | pci_save_state(pdev); |
760 | return 0; | 765 | return 0; |
@@ -763,6 +768,16 @@ static int vmd_suspend(struct device *dev) | |||
763 | static int vmd_resume(struct device *dev) | 768 | static int vmd_resume(struct device *dev) |
764 | { | 769 | { |
765 | struct pci_dev *pdev = to_pci_dev(dev); | 770 | struct pci_dev *pdev = to_pci_dev(dev); |
771 | struct vmd_dev *vmd = pci_get_drvdata(pdev); | ||
772 | int err, i; | ||
773 | |||
774 | for (i = 0; i < vmd->msix_count; i++) { | ||
775 | err = devm_request_irq(dev, pci_irq_vector(pdev, i), | ||
776 | vmd_irq, IRQF_NO_THREAD, | ||
777 | "vmd", &vmd->irqs[i]); | ||
778 | if (err) | ||
779 | return err; | ||
780 | } | ||
766 | 781 | ||
767 | pci_restore_state(pdev); | 782 | pci_restore_state(pdev); |
768 | return 0; | 783 | return 0; |