Skip to content

Commit 838ff44

Browse files
paliLorenzo Pieralisi
authored andcommitted
PCI: mvebu: Fix support for PCI_EXP_RTSTA on emulated bridge
PME Status bit in Root Status Register (PCIE_RC_RTSTA_OFF) is read-only and can be cleared only by writing 0b to the Interrupt Cause RW0C register (PCIE_INT_CAUSE_OFF). Link: https://lore.kernel.org/r/[email protected] Fixes: 1f08673 ("PCI: mvebu: Convert to PCI emulated bridge config space") Signed-off-by: Pali Rohár <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]>
1 parent ecae073 commit 838ff44

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

drivers/pci/controller/pci-mvebu.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
PCIE_CONF_FUNC(PCI_FUNC(devfn)) | PCIE_CONF_REG(where) | \
5252
PCIE_CONF_ADDR_EN)
5353
#define PCIE_CONF_DATA_OFF 0x18fc
54+
#define PCIE_INT_CAUSE_OFF 0x1900
55+
#define PCIE_INT_PM_PME BIT(28)
5456
#define PCIE_MASK_OFF 0x1910
5557
#define PCIE_MASK_ENABLE_INTS 0x0f000000
5658
#define PCIE_CTRL_OFF 0x1a00
@@ -661,7 +663,14 @@ mvebu_pci_bridge_emul_pcie_conf_write(struct pci_bridge_emul *bridge,
661663
break;
662664

663665
case PCI_EXP_RTSTA:
664-
mvebu_writel(port, new, PCIE_RC_RTSTA);
666+
/*
667+
* PME Status bit in Root Status Register (PCIE_RC_RTSTA)
668+
* is read-only and can be cleared only by writing 0b to the
669+
* Interrupt Cause RW0C register (PCIE_INT_CAUSE_OFF). So
670+
* clear PME via Interrupt Cause.
671+
*/
672+
if (new & PCI_EXP_RTSTA_PME)
673+
mvebu_writel(port, ~PCIE_INT_PM_PME, PCIE_INT_CAUSE_OFF);
665674
break;
666675
}
667676
}

0 commit comments

Comments
 (0)