Commit dc2b4532 authored by Thomas Gleixner's avatar Thomas Gleixner

PCI: hv: Rework MSI handling

Replace the about to vanish iterators and make use of the filtering. Take
the descriptor lock around the iterators.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Tested-by: default avatarMichael Kelley <mikelley@microsoft.com>
Reviewed-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Acked-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Link: https://lore.kernel.org/r/20211206210748.629363944@linutronix.de
parent 706b585a
...@@ -3445,18 +3445,23 @@ static int hv_pci_suspend(struct hv_device *hdev) ...@@ -3445,18 +3445,23 @@ static int hv_pci_suspend(struct hv_device *hdev)
static int hv_pci_restore_msi_msg(struct pci_dev *pdev, void *arg) static int hv_pci_restore_msi_msg(struct pci_dev *pdev, void *arg)
{ {
struct msi_desc *entry;
struct irq_data *irq_data; struct irq_data *irq_data;
struct msi_desc *entry;
int ret = 0;
for_each_pci_msi_entry(entry, pdev) { msi_lock_descs(&pdev->dev);
msi_for_each_desc(entry, &pdev->dev, MSI_DESC_ASSOCIATED) {
irq_data = irq_get_irq_data(entry->irq); irq_data = irq_get_irq_data(entry->irq);
if (WARN_ON_ONCE(!irq_data)) if (WARN_ON_ONCE(!irq_data)) {
return -EINVAL; ret = -EINVAL;
break;
}
hv_compose_msi_msg(irq_data, &entry->msg); hv_compose_msi_msg(irq_data, &entry->msg);
} }
msi_unlock_descs(&pdev->dev);
return 0; return ret;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment