提交 0db29af1 编写于 作者: H Hidetoshi Seto 提交者: Jesse Barnes

PCI/MSI: bugfix/utilize for msi_capability_init()

This patch fix a following bug and does a cleanup.

bug:
	commit 5993760f
	had a wrong change (since is_64 is boolean[0|1]):

-               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);

utilize:
	Unify separated if (entry->msi_attrib.maskbit) statements.
Signed-off-by: NHidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Acked-by: N"Jike Song" <albcamus@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
上级 b762666c
...@@ -398,21 +398,19 @@ static int msi_capability_init(struct pci_dev *dev) ...@@ -398,21 +398,19 @@ static int msi_capability_init(struct pci_dev *dev)
entry->msi_attrib.masked = 1; entry->msi_attrib.masked = 1;
entry->msi_attrib.default_irq = dev->irq; /* Save IOAPIC IRQ */ entry->msi_attrib.default_irq = dev->irq; /* Save IOAPIC IRQ */
entry->msi_attrib.pos = pos; entry->msi_attrib.pos = pos;
if (entry->msi_attrib.maskbit) {
entry->mask_base = (void __iomem *)(long)msi_mask_bits_reg(pos,
entry->msi_attrib.is_64);
}
entry->dev = dev; entry->dev = dev;
if (entry->msi_attrib.maskbit) { if (entry->msi_attrib.maskbit) {
unsigned int maskbits, temp; unsigned int base, maskbits, temp;
base = msi_mask_bits_reg(pos, entry->msi_attrib.is_64);
entry->mask_base = (void __iomem *)(long)base;
/* All MSIs are unmasked by default, Mask them all */ /* All MSIs are unmasked by default, Mask them all */
pci_read_config_dword(dev, pci_read_config_dword(dev, base, &maskbits);
msi_mask_bits_reg(pos, entry->msi_attrib.is_64),
&maskbits);
temp = (1 << multi_msi_capable(control)); temp = (1 << multi_msi_capable(control));
temp = ((temp - 1) & ~temp); temp = ((temp - 1) & ~temp);
maskbits |= temp; maskbits |= temp;
pci_write_config_dword(dev, entry->msi_attrib.is_64, maskbits); pci_write_config_dword(dev, base, maskbits);
entry->msi_attrib.maskbits_mask = temp; entry->msi_attrib.maskbits_mask = temp;
} }
list_add_tail(&entry->list, &dev->msi_list); list_add_tail(&entry->list, &dev->msi_list);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册