PCI MSI: Don't disable MSIs if the mask bit isn't supported

David Vrabel has a device which generates an interrupt storm on the INTx
pin if we disable MSI interrupts altogether. Masking interrupts is only
a performance optimisation, so we can ignore the request to mask the
interrupt.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>

authored by

Matthew Wilcox and committed by
Jesse Barnes
ce6fce42 29111f57

+12 -3
+12 -3
drivers/pci/msi.c
··· 126 126 } 127 127 } 128 128 129 - static void msi_set_mask_bits(unsigned int irq, u32 mask, u32 flag) 129 + /* 130 + * PCI 2.3 does not specify mask bits for each MSI interrupt. Attempting to 131 + * mask all MSI interrupts by clearing the MSI enable bit does not work 132 + * reliably as devices without an INTx disable bit will then generate a 133 + * level IRQ which will never be cleared. 134 + * 135 + * Returns 1 if it succeeded in masking the interrupt and 0 if the device 136 + * doesn't support MSI masking. 137 + */ 138 + static int msi_set_mask_bits(unsigned int irq, u32 mask, u32 flag) 130 139 { 131 140 struct msi_desc *entry; 132 141 ··· 153 144 mask_bits |= flag & mask; 154 145 pci_write_config_dword(entry->dev, pos, mask_bits); 155 146 } else { 156 - __msi_set_enable(entry->dev, entry->msi_attrib.pos, 157 - !flag); 147 + return 0; 158 148 } 159 149 break; 160 150 case PCI_CAP_ID_MSIX: ··· 169 161 break; 170 162 } 171 163 entry->msi_attrib.masked = !!flag; 164 + return 1; 172 165 } 173 166 174 167 void read_msi_msg(unsigned int irq, struct msi_msg *msg)