[PATCH] Fix MSI masking bug

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit 5993760f7fc75b77e4701f1e56dc84c0d6cf18d5 replaced:

-               pci_write_config_dword(dev,
-                       msi_mask_bits_reg(pos, is_64bit_address(control)),
-                       maskbits);
+               pci_write_config_dword(dev, entry->msi_attrib.is_64, maskbits);

which, instead of writing to an offset from the MSI capability, writes
to the PCI vendor and device IDs.  Fortunately these are specified to
be read-only, and we won't even do the write if the capability is 64-bit
(due to the write being misaligned), but it would be nice to actually do
the masking.

Signed-off-by: Matthew Wilcox <willy@xxxxxxxxxxxxxxx>
Cc: Jike Song <albcamus@xxxxxxxxx>
Cc: Jesse Barnes <jbarnes@xxxxxxxxxxxxxxxx>
Cc: stable@xxxxxxxxxx
---
 drivers/pci/msi.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index b4a90ba..429c596 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -412,7 +412,9 @@ static int msi_capability_init(struct pci_dev *dev)
 		temp = (1 << multi_msi_capable(control));
 		temp = ((temp - 1) & ~temp);
 		maskbits |= temp;
-		pci_write_config_dword(dev, entry->msi_attrib.is_64, maskbits);
+		pci_write_config_dword(dev,
+			msi_mask_bits_reg(pos, entry->msi_attrib.is_64),
+			maskbits);
 		entry->msi_attrib.maskbits_mask = temp;
 	}
 	list_add_tail(&entry->list, &dev->msi_list);
-- 
1.5.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux