Merge tag 'pci-v5.17-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaa...
[platform/kernel/linux-rpi.git] / drivers / pci / controller / pci-hyperv.c
index 31743f9..20ea2ee 100644 (file)
@@ -2030,7 +2030,7 @@ static void prepopulate_bars(struct hv_pcibus_device *hbus)
         * If the memory enable bit is already set, Hyper-V silently ignores
         * the below BAR updates, and the related PCI device driver can not
         * work, because reading from the device register(s) always returns
-        * 0xFFFFFFFF.
+        * 0xFFFFFFFF (PCI_ERROR_RESPONSE).
         */
        list_for_each_entry(hpdev, &hbus->children, list_entry) {
                _hv_pcifront_read_config(hpdev, PCI_COMMAND, 2, &command);
@@ -3701,18 +3701,23 @@ static int hv_pci_suspend(struct hv_device *hdev)
 
 static int hv_pci_restore_msi_msg(struct pci_dev *pdev, void *arg)
 {
-       struct msi_desc *entry;
        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);
-               if (WARN_ON_ONCE(!irq_data))
-                       return -EINVAL;
+               if (WARN_ON_ONCE(!irq_data)) {
+                       ret = -EINVAL;
+                       break;
+               }
 
                hv_compose_msi_msg(irq_data, &entry->msg);
        }
+       msi_unlock_descs(&pdev->dev);
 
-       return 0;
+       return ret;
 }
 
 /*