1 From 98feaf97bc64fc640a6c5b1394cd18fc7cd7dac8 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali@kernel.org>
3 Date: Sun, 28 Mar 2021 14:34:49 +0200
4 Subject: [PATCH] PCI: aardvark: Refactor unmasking summary MSI interrupt
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 Refactor the masking of ISR0/1 Sources and unmasking of summary MSI interrupt
10 so that it corresponds to the comments:
11 - first mask all ISR0/1
12 - then unmask all MSIs
13 - then unmask summary MSI interrupt
15 Signed-off-by: Pali Rohár <pali@kernel.org>
16 Signed-off-by: Marek Behún <kabel@kernel.org>
18 drivers/pci/controller/pci-aardvark.c | 10 ++++++----
19 1 file changed, 6 insertions(+), 4 deletions(-)
21 --- a/drivers/pci/controller/pci-aardvark.c
22 +++ b/drivers/pci/controller/pci-aardvark.c
23 @@ -578,15 +578,17 @@ static void advk_pcie_setup_hw(struct ad
24 advk_writel(pcie, PCIE_IRQ_ALL_MASK, HOST_CTRL_INT_STATUS_REG);
26 /* Disable All ISR0/1 Sources */
27 - reg = PCIE_ISR0_ALL_MASK;
28 - reg &= ~PCIE_ISR0_MSI_INT_PENDING;
29 - advk_writel(pcie, reg, PCIE_ISR0_MASK_REG);
31 + advk_writel(pcie, PCIE_ISR0_ALL_MASK, PCIE_ISR0_MASK_REG);
32 advk_writel(pcie, PCIE_ISR1_ALL_MASK, PCIE_ISR1_MASK_REG);
35 advk_writel(pcie, ~(u32)PCIE_MSI_ALL_MASK, PCIE_MSI_MASK_REG);
37 + /* Unmask summary MSI interrupt */
38 + reg = advk_readl(pcie, PCIE_ISR0_MASK_REG);
39 + reg &= ~PCIE_ISR0_MSI_INT_PENDING;
40 + advk_writel(pcie, reg, PCIE_ISR0_MASK_REG);
42 /* Enable summary interrupt for GIC SPI source */
43 reg = PCIE_IRQ_ALL_MASK & (~PCIE_IRQ_ENABLE_INTS_MASK);
44 advk_writel(pcie, reg, HOST_CTRL_INT_MASK_REG);