diff options
author | Gavin Shan <gwshan@linux.vnet.ibm.com> | 2014-05-30 13:35:54 -0400 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2014-05-30 13:35:54 -0400 |
commit | fd49c81f080a997aad4b0e73541cd42772b6a772 (patch) | |
tree | 280bab4ea61a5a99ec2fcf0199ba7adc41eeacd8 | |
parent | b13460b92093b29347e99d6c3242e350052b62cd (diff) |
drivers/vfio/pci: Fix wrong MSI interrupt count
According PCI local bus specification, the register of Message
Control for MSI (offset: 2, length: 2) has bit#0 to enable or
disable MSI logic and it shouldn't be part contributing to the
calculation of MSI interrupt count. The patch fixes the issue.
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
-rw-r--r-- | drivers/vfio/pci/vfio_pci.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c index 85063f1c12d7..010e0f8b8e4f 100644 --- a/drivers/vfio/pci/vfio_pci.c +++ b/drivers/vfio/pci/vfio_pci.c | |||
@@ -197,8 +197,7 @@ static int vfio_pci_get_irq_count(struct vfio_pci_device *vdev, int irq_type) | |||
197 | if (pos) { | 197 | if (pos) { |
198 | pci_read_config_word(vdev->pdev, | 198 | pci_read_config_word(vdev->pdev, |
199 | pos + PCI_MSI_FLAGS, &flags); | 199 | pos + PCI_MSI_FLAGS, &flags); |
200 | 200 | return 1 << ((flags & PCI_MSI_FLAGS_QMASK) >> 1); | |
201 | return 1 << (flags & PCI_MSI_FLAGS_QMASK); | ||
202 | } | 201 | } |
203 | } else if (irq_type == VFIO_PCI_MSIX_IRQ_INDEX) { | 202 | } else if (irq_type == VFIO_PCI_MSIX_IRQ_INDEX) { |
204 | u8 pos; | 203 | u8 pos; |