Merge branch 'pci/host-vmd' into next
* pci/host-vmd: iommu/vt-d: Prevent VMD child devices from being remapping targets x86/PCI: Use is_vmd() rather than relying on the domain number x86/PCI: Move VMD quirk to x86 fixups MAINTAINERS: Add Jonathan Derrick as VMD maintainer PCI: vmd: Remove IRQ affinity so we can allocate more IRQs PCI: vmd: Free up IRQs on suspend path PCI: vmd: Assign vector zero to all bridges PCI: vmd: Reserve IRQ pre-vector for better affinity
This commit is contained in:
@@ -183,7 +183,7 @@ static struct vmd_irq_list *vmd_next_irq(struct vmd_dev *vmd, struct msi_desc *d
|
||||
int i, best = 1;
|
||||
unsigned long flags;
|
||||
|
||||
if (!desc->msi_attrib.is_msix || vmd->msix_count == 1)
|
||||
if (pci_is_bridge(msi_desc_to_pci_dev(desc)) || vmd->msix_count == 1)
|
||||
return &vmd->irqs[0];
|
||||
|
||||
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)
|
||||
return -ENODEV;
|
||||
|
||||
vmd->msix_count = pci_alloc_irq_vectors(dev, 1, vmd->msix_count,
|
||||
PCI_IRQ_MSIX | PCI_IRQ_AFFINITY);
|
||||
PCI_IRQ_MSIX);
|
||||
if (vmd->msix_count < 0)
|
||||
return vmd->msix_count;
|
||||
|
||||
@@ -755,6 +755,11 @@ static void vmd_remove(struct pci_dev *dev)
|
||||
static int vmd_suspend(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pdev = to_pci_dev(dev);
|
||||
struct vmd_dev *vmd = pci_get_drvdata(pdev);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < vmd->msix_count; i++)
|
||||
devm_free_irq(dev, pci_irq_vector(pdev, i), &vmd->irqs[i]);
|
||||
|
||||
pci_save_state(pdev);
|
||||
return 0;
|
||||
@@ -763,6 +768,16 @@ static int vmd_suspend(struct device *dev)
|
||||
static int vmd_resume(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pdev = to_pci_dev(dev);
|
||||
struct vmd_dev *vmd = pci_get_drvdata(pdev);
|
||||
int err, i;
|
||||
|
||||
for (i = 0; i < vmd->msix_count; i++) {
|
||||
err = devm_request_irq(dev, pci_irq_vector(pdev, i),
|
||||
vmd_irq, IRQF_NO_THREAD,
|
||||
"vmd", &vmd->irqs[i]);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
pci_restore_state(pdev);
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user