Skip to content

Commit d00ea94

Browse files
paliLorenzo Pieralisi
authored andcommitted
PCI: mvebu: Fix macro names and comments about legacy interrupts
Register 0x1910 unmasks interrupts and legacy INTx interrupts are unmasked because driver does not support individual masking yet. Link: https://lore.kernel.org/r/20220222155030.988-11-pali@kernel.org Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
1 parent 0124989 commit d00ea94

1 file changed

Lines changed: 18 additions & 8 deletions

File tree

drivers/pci/controller/pci-mvebu.c

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,10 @@
5454
PCIE_CONF_ADDR_EN)
5555
#define PCIE_CONF_DATA_OFF 0x18fc
5656
#define PCIE_INT_CAUSE_OFF 0x1900
57+
#define PCIE_INT_UNMASK_OFF 0x1910
58+
#define PCIE_INT_INTX(i) BIT(24+i)
5759
#define PCIE_INT_PM_PME BIT(28)
58-
#define PCIE_MASK_OFF 0x1910
59-
#define PCIE_MASK_ENABLE_INTS 0x0f000000
60+
#define PCIE_INT_ALL_MASK GENMASK(31, 0)
6061
#define PCIE_CTRL_OFF 0x1a00
6162
#define PCIE_CTRL_X1_MODE 0x0001
6263
#define PCIE_CTRL_RC_MODE BIT(1)
@@ -235,7 +236,7 @@ static void mvebu_pcie_setup_wins(struct mvebu_pcie_port *port)
235236

236237
static void mvebu_pcie_setup_hw(struct mvebu_pcie_port *port)
237238
{
238-
u32 ctrl, lnkcap, cmd, dev_rev, mask;
239+
u32 ctrl, lnkcap, cmd, dev_rev, unmask;
239240

240241
/* Setup PCIe controller to Root Complex mode. */
241242
ctrl = mvebu_readl(port, PCIE_CTRL_OFF);
@@ -288,10 +289,19 @@ static void mvebu_pcie_setup_hw(struct mvebu_pcie_port *port)
288289
/* Point PCIe unit MBUS decode windows to DRAM space. */
289290
mvebu_pcie_setup_wins(port);
290291

291-
/* Enable interrupt lines A-D. */
292-
mask = mvebu_readl(port, PCIE_MASK_OFF);
293-
mask |= PCIE_MASK_ENABLE_INTS;
294-
mvebu_writel(port, mask, PCIE_MASK_OFF);
292+
/*
293+
* Unmask all legacy INTx interrupts as driver does not provide a way
294+
* for masking and unmasking of individual legacy INTx interrupts.
295+
* Legacy INTx are reported via one shared GIC source and therefore
296+
* kernel cannot distinguish which individual legacy INTx was triggered.
297+
* These interrupts are shared, so it should not cause any issue. Just
298+
* performance penalty as every PCIe interrupt handler needs to be
299+
* called when some interrupt is triggered.
300+
*/
301+
unmask = mvebu_readl(port, PCIE_INT_UNMASK_OFF);
302+
unmask |= PCIE_INT_INTX(0) | PCIE_INT_INTX(1) |
303+
PCIE_INT_INTX(2) | PCIE_INT_INTX(3);
304+
mvebu_writel(port, unmask, PCIE_INT_UNMASK_OFF);
295305
}
296306

297307
static struct mvebu_pcie_port *mvebu_pcie_find_port(struct mvebu_pcie *pcie,
@@ -1450,7 +1460,7 @@ static int mvebu_pcie_remove(struct platform_device *pdev)
14501460
mvebu_writel(port, cmd, PCIE_CMD_OFF);
14511461

14521462
/* Mask all interrupt sources. */
1453-
mvebu_writel(port, 0, PCIE_MASK_OFF);
1463+
mvebu_writel(port, ~PCIE_INT_ALL_MASK, PCIE_INT_UNMASK_OFF);
14541464

14551465
/* Free config space for emulated root bridge. */
14561466
pci_bridge_emul_cleanup(&port->bridge);

0 commit comments

Comments
 (0)