ia64/xen-unstable

changeset 19036:4f6a2bbdff3f

x86: Call msix_set_enable for MSI-x interrupt

For MSI-x, we should call msix_set_enable() instead of
msi_set_enable().

Signed-off-by: Jiang Yunhong <yunhong.jiang@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jan 13 15:53:47 2009 +0000 (2009-01-13)
parents b169db55faf3
children d400a51a2f46
files xen/arch/x86/msi.c
line diff
     1.1 --- a/xen/arch/x86/msi.c	Tue Jan 13 15:42:47 2009 +0000
     1.2 +++ b/xen/arch/x86/msi.c	Tue Jan 13 15:53:47 2009 +0000
     1.3 @@ -671,7 +671,7 @@ static void __pci_disable_msix(struct ms
     1.4  
     1.5      pos = pci_find_cap_offset(bus, slot, func, PCI_CAP_ID_MSIX);
     1.6      control = pci_conf_read16(bus, slot, func, msix_control_reg(pos));
     1.7 -    msi_set_enable(dev, 0);
     1.8 +    msix_set_enable(dev, 0);
     1.9  
    1.10      BUG_ON(list_empty(&dev->msi_list));
    1.11  
    1.12 @@ -770,11 +770,20 @@ int pci_restore_msi_state(struct pci_dev
    1.13              return -EINVAL;
    1.14          }
    1.15  
    1.16 -        msi_set_enable(pdev, 0);
    1.17 +        if ( entry->msi_attrib.type == PCI_CAP_ID_MSI )
    1.18 +            msi_set_enable(pdev, 0);
    1.19 +        else if ( entry->msi_attrib.type == PCI_CAP_ID_MSIX )
    1.20 +            msix_set_enable(pdev, 0);
    1.21 +
    1.22          write_msi_msg(entry, &entry->msg);
    1.23  
    1.24 -        msi_set_enable(pdev, 1);
    1.25          msi_set_mask_bit(vector, entry->msi_attrib.masked);
    1.26 +
    1.27 +        if ( entry->msi_attrib.type == PCI_CAP_ID_MSI )
    1.28 +            msi_set_enable(pdev, 1);
    1.29 +        else if ( entry->msi_attrib.type == PCI_CAP_ID_MSIX )
    1.30 +            msix_set_enable(pdev, 1);
    1.31 +
    1.32          spin_unlock_irqrestore(&desc->lock, flags);
    1.33      }
    1.34