x86: Call msix_set_enable for MSI-x interrupt
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 13 Jan 2009 15:53:47 +0000 (15:53 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 13 Jan 2009 15:53:47 +0000 (15:53 +0000)
For MSI-x, we should call msix_set_enable() instead of
msi_set_enable().

Signed-off-by: Jiang Yunhong <yunhong.jiang@intel.com>
xen/arch/x86/msi.c

index fdca2453cea1e943bb205f40cf13430678ababa8..44e617c5acce7325ddd08bd3b30be1611051c825 100644 (file)
@@ -671,7 +671,7 @@ static void __pci_disable_msix(struct msi_desc *entry)
 
     pos = pci_find_cap_offset(bus, slot, func, PCI_CAP_ID_MSIX);
     control = pci_conf_read16(bus, slot, func, msix_control_reg(pos));
-    msi_set_enable(dev, 0);
+    msix_set_enable(dev, 0);
 
     BUG_ON(list_empty(&dev->msi_list));
 
@@ -770,11 +770,20 @@ int pci_restore_msi_state(struct pci_dev *pdev)
             return -EINVAL;
         }
 
-        msi_set_enable(pdev, 0);
+        if ( entry->msi_attrib.type == PCI_CAP_ID_MSI )
+            msi_set_enable(pdev, 0);
+        else if ( entry->msi_attrib.type == PCI_CAP_ID_MSIX )
+            msix_set_enable(pdev, 0);
+
         write_msi_msg(entry, &entry->msg);
 
-        msi_set_enable(pdev, 1);
         msi_set_mask_bit(vector, entry->msi_attrib.masked);
+
+        if ( entry->msi_attrib.type == PCI_CAP_ID_MSI )
+            msi_set_enable(pdev, 1);
+        else if ( entry->msi_attrib.type == PCI_CAP_ID_MSIX )
+            msix_set_enable(pdev, 1);
+
         spin_unlock_irqrestore(&desc->lock, flags);
     }