linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vignesh R <vigneshr@ti.com>
To: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Jingoo Han <jingoohan1@gmail.com>,
	Joao Pinto <Joao.Pinto@synopsys.com>
Cc: Kishon Vijay Abraham I <kishon@ti.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Niklas Cassel <niklas.cassel@axis.com>,
	<linux-omap@vger.kernel.org>, <linux-pci@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, Vignesh R <vigneshr@ti.com>
Subject: [PATCH 3/3] PCI: dwc: pci-dra7xx: Handle legacy and MSI IRQs together
Date: Fri, 9 Feb 2018 17:34:15 +0530	[thread overview]
Message-ID: <20180209120415.17590-4-vigneshr@ti.com> (raw)
In-Reply-To: <20180209120415.17590-1-vigneshr@ti.com>

Currently, pci-dra7xx driver handles MSI and Legacy IRQs exclusive of
each other. This is not true, as there maybe both legacy and MSI IRQs
raised at the same time. Fix this by making sure that driver handles
both MSI and legacy IRQs in the IRQ handler.

Signed-off-by: Vignesh R <vigneshr@ti.com>
---
 drivers/pci/dwc/pci-dra7xx.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/pci/dwc/pci-dra7xx.c b/drivers/pci/dwc/pci-dra7xx.c
index 3420cbf7b60a..1ddb62620acc 100644
--- a/drivers/pci/dwc/pci-dra7xx.c
+++ b/drivers/pci/dwc/pci-dra7xx.c
@@ -261,8 +261,7 @@ static irqreturn_t dra7xx_pcie_msi_irq_handler(int irq, void *arg)
 	reg = dra7xx_pcie_readl(dra7xx, PCIECTRL_DRA7XX_CONF_IRQSTATUS_MSI);
 	dra7xx_pcie_writel(dra7xx, PCIECTRL_DRA7XX_CONF_IRQSTATUS_MSI, reg);
 
-	switch (reg) {
-	case MSI:
+	if (reg & MSI) {
 		/*
 		 * Need to make sure no MSI IRQs are pending before
 		 * exiting handler, else the wrapper will not catch new
@@ -279,17 +278,13 @@ static irqreturn_t dra7xx_pcie_msi_irq_handler(int irq, void *arg)
 					   reg);
 			return IRQ_HANDLED;
 		}
-		break;
-	case INTA:
-	case INTB:
-	case INTC:
-	case INTD:
+	}
+	if (reg & LEG_EP_INTERRUPTS) {
 		for_each_set_bit(bit, &reg, PCI_NUM_INTX) {
 			virq = irq_find_mapping(dra7xx->irq_domain, bit);
 			if (virq)
 				generic_handle_irq(virq);
 		}
-		break;
 	}
 
 	return IRQ_HANDLED;
-- 
2.16.1

      parent reply	other threads:[~2018-02-09 12:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-09 12:04 [PATCH 0/3] dra7xx: PCIe IRQ handling rework Vignesh R
2018-02-09 12:04 ` [PATCH 1/3] Revert "PCI: dwc: Clear MSI interrupt status after it is handled, not before" Vignesh R
2018-02-09 13:46   ` Niklas Cassel
2018-02-09 12:04 ` [PATCH 2/3] PCI: dwc: pci-dra7xx: Improve MSI IRQ handling Vignesh R
2018-02-12 17:58   ` Lorenzo Pieralisi
2018-02-15  4:29     ` Vignesh R
2018-03-01 15:31       ` Vignesh R
2018-03-01 18:18         ` Lorenzo Pieralisi
2018-03-06 15:12       ` Lorenzo Pieralisi
2018-03-09  4:23         ` Vignesh R
2018-03-15 18:10           ` Lorenzo Pieralisi
2018-02-09 12:04 ` Vignesh R [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180209120415.17590-4-vigneshr@ti.com \
    --to=vigneshr@ti.com \
    --cc=Joao.Pinto@synopsys.com \
    --cc=bhelgaas@google.com \
    --cc=jingoohan1@gmail.com \
    --cc=kishon@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=niklas.cassel@axis.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).