Skip to content

Commit 145eec9

Browse files
committed
Merge branch 'pci/controller/loongson'
* pci/controller/loongson: PCI: loongson: Enable MSI in LS7A Root Complex
2 parents 9965133 + a4bbcac commit 145eec9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

drivers/pci/controller/pci-loongson.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,19 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_LOONGSON,
163163
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_LOONGSON,
164164
DEV_LS7A_HDMI, loongson_pci_pin_quirk);
165165

166+
static void loongson_pci_msi_quirk(struct pci_dev *dev)
167+
{
168+
u16 val, class = dev->class >> 8;
169+
170+
if (class != PCI_CLASS_BRIDGE_HOST)
171+
return;
172+
173+
pci_read_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, &val);
174+
val |= PCI_MSI_FLAGS_ENABLE;
175+
pci_write_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, val);
176+
}
177+
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_LOONGSON, DEV_LS7A_PCIE_PORT5, loongson_pci_msi_quirk);
178+
166179
static struct loongson_pci *pci_bus_to_loongson_pci(struct pci_bus *bus)
167180
{
168181
struct pci_config_window *cfg;

0 commit comments

Comments
 (0)