From 1ecdbacc9d562f9c3a291283e3d513dd3bce102a Mon Sep 17 00:00:00 2001 From: Abhishek Shah Date: Tue, 20 Oct 2020 23:40:58 +0530 Subject: [PATCH] drivers: pcie_ep: iproc: clear pvm interrupts before handling We should clear the pvm interrupts (snoop and pcie pmon lite interrupt) at source before handling them. This will make sure that we do not lose any interrupts that may have been asserted to interrupt controller during the handling routine. Signed-off-by: Abhishek Shah --- drivers/pcie/endpoint/pcie_ep_iproc_msi.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/pcie/endpoint/pcie_ep_iproc_msi.c b/drivers/pcie/endpoint/pcie_ep_iproc_msi.c index 836c3c63037..c56b8585b8c 100644 --- a/drivers/pcie/endpoint/pcie_ep_iproc_msi.c +++ b/drivers/pcie/endpoint/pcie_ep_iproc_msi.c @@ -181,11 +181,13 @@ void iproc_pcie_func_mask_isr(void *arg) LOG_DBG("%s: %x\n", __func__, data); - if ((data & SNOOP_VALID_INTR) && !is_pcie_function_mask(dev)) { - generate_all_pending_msix(dev); + if (data & SNOOP_VALID_INTR) { + pcie_write32(SNOOP_VALID_INTR, + &cfg->base->paxb_pcie_cfg_intr_clear); + if (!is_pcie_function_mask(dev)) { + generate_all_pending_msix(dev); + } } - - pcie_write32(SNOOP_VALID_INTR, &cfg->base->paxb_pcie_cfg_intr_clear); } void iproc_pcie_vector_mask_isr(void *arg) @@ -198,9 +200,9 @@ void iproc_pcie_vector_mask_isr(void *arg) sys_read32(PMON_LITE_PCIE_INTERRUPT_STATUS)); if (msix_table_update) { - generate_all_pending_msix(dev); sys_write32(BIT(WR_ADDR_CHK_INTR_EN), PMON_LITE_PCIE_INTERRUPT_CLEAR); + generate_all_pending_msix(dev); } } #endif