From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752231AbeADGJq (ORCPT + 1 other); Thu, 4 Jan 2018 01:09:46 -0500 Received: from fllnx210.ext.ti.com ([198.47.19.17]:41451 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750789AbeADGJo (ORCPT ); Thu, 4 Jan 2018 01:09:44 -0500 Subject: Re: [PATCH v2 2/2] PCI: dra7xx: Iterate over INTx status bits To: Vignesh R , Lorenzo Pieralisi References: <20171229114131.22296-1-vigneshr@ti.com> <20171229114131.22296-3-vigneshr@ti.com> CC: Bjorn Helgaas , , , From: Kishon Vijay Abraham I Message-ID: <7b62e14f-9571-82a2-76eb-8cad44103fde@ti.com> Date: Thu, 4 Jan 2018 11:39:36 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <20171229114131.22296-3-vigneshr@ti.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Friday 29 December 2017 05:11 PM, Vignesh R wrote: > It is possible that more than one legacy IRQ may be set at the same > time, therefore iterate and handle all the pending INTx interrupts > before clearing the status and exiting the IRQ handler. Otherwise, some > interrupts would be lost. > > Signed-off-by: Vignesh R Acked-by: Kishon Vijay Abraham I > --- > drivers/pci/dwc/pci-dra7xx.c | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/drivers/pci/dwc/pci-dra7xx.c b/drivers/pci/dwc/pci-dra7xx.c > index 892f93910012..48c6ae535847 100644 > --- a/drivers/pci/dwc/pci-dra7xx.c > +++ b/drivers/pci/dwc/pci-dra7xx.c > @@ -257,7 +257,8 @@ static irqreturn_t dra7xx_pcie_msi_irq_handler(int irq, void *arg) > struct dra7xx_pcie *dra7xx = arg; > struct dw_pcie *pci = dra7xx->pci; > struct pcie_port *pp = &pci->pp; > - u32 reg; > + unsigned long reg; > + u32 virq, bit; > > reg = dra7xx_pcie_readl(dra7xx, PCIECTRL_DRA7XX_CONF_IRQSTATUS_MSI); > > @@ -269,8 +270,11 @@ static irqreturn_t dra7xx_pcie_msi_irq_handler(int irq, void *arg) > case INTB: > case INTC: > case INTD: > - generic_handle_irq(irq_find_mapping(dra7xx->irq_domain, > - ffs(reg) - 1)); > + for_each_set_bit(bit, ®, PCI_NUM_INTX) { > + virq = irq_find_mapping(dra7xx->irq_domain, bit); > + if (virq) > + generic_handle_irq(virq); > + } > break; > } > >