Skip to contentSkip to conversation

linux: print at least a message if MSI-X restore failed

PATCH New Jan Beulich 1 participant 1 message Sep 4, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux: print at least a message if MSI-X restore failed

I'm not sure how to properly recover from that condition, but at least don't let it happen silently.

As usual, written and tested on 2.6.27-rc5 and made apply to the 2.6.18 tree without further testing.

drivers/pci/msi-xen.c +9 -3
Index: head-2008-09-01/drivers/pci/msi-xen.c
===================================================================
@@ -335,9 +335,15 @@ static void __pci_restore_msix_state(str
 
 	spin_lock_irqsave(&msi_dev_entry->pirq_list_lock, flags);
 	list_for_each_entry_safe(pirq_entry, tmp,
-				 &msi_dev_entry->pirq_list_head, list)
-		msi_map_pirq_to_vector(dev, pirq_entry->pirq,
-				       pirq_entry->entry_nr, table_base);
+				 &msi_dev_entry->pirq_list_head, list) {
+		int rc = msi_map_pirq_to_vector(dev, pirq_entry->pirq,
+						pirq_entry->entry_nr, table_base);
+		if (rc < 0)
+			printk(KERN_WARNING
+			       "%s: re-mapping irq #%d (pirq%d) failed: %d\n",
+			       pci_name(dev), pirq_entry->entry_nr,
+			       pirq_entry->pirq, rc);
+	}
 	spin_unlock_irqrestore(&msi_dev_entry->pirq_list_lock, flags);
 
 	enable_msi_mode(dev, pos, PCI_CAP_ID_MSIX);