Skip to content

Commit 9599772

Browse files
elkabloLorenzo Pieralisi
authored andcommitted
PCI: aardvark: Read all 16-bits from PCIE_MSI_PAYLOAD_REG
The PCIE_MSI_PAYLOAD_REG contains 16-bit MSI number, not only lower 8 bits. Fix reading content of this register and add a comment describing the access to this register. Link: https://lore.kernel.org/r/20211028185659.20329-4-kabel@kernel.org Fixes: 8c39d71 ("PCI: aardvark: Add Aardvark PCI host controller driver") Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Marek Behún <kabel@kernel.org> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Cc: stable@vger.kernel.org
1 parent e4313be commit 9599772

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎drivers/pci/controller/pci-aardvark.c‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@
119119
#define PCIE_MSI_STATUS_REG (CONTROL_BASE_ADDR + 0x58)
120120
#define PCIE_MSI_MASK_REG (CONTROL_BASE_ADDR + 0x5C)
121121
#define PCIE_MSI_PAYLOAD_REG (CONTROL_BASE_ADDR + 0x9C)
122+
#define PCIE_MSI_DATA_MASK GENMASK(15, 0)
122123

123124
/* PCIe window configuration */
124125
#define OB_WIN_BASE_ADDR 0x4c00
@@ -1319,8 +1320,12 @@ static void advk_pcie_handle_msi(struct advk_pcie *pcie)
13191320
if (!(BIT(msi_idx) & msi_status))
13201321
continue;
13211322

1323+
/*
1324+
* msi_idx contains bits [4:0] of the msi_data and msi_data
1325+
* contains 16bit MSI interrupt number
1326+
*/
13221327
advk_writel(pcie, BIT(msi_idx), PCIE_MSI_STATUS_REG);
1323-
msi_data = advk_readl(pcie, PCIE_MSI_PAYLOAD_REG) & 0xFF;
1328+
msi_data = advk_readl(pcie, PCIE_MSI_PAYLOAD_REG) & PCIE_MSI_DATA_MASK;
13241329
generic_handle_irq(msi_data);
13251330
}
13261331

0 commit comments

Comments
 (0)