* [PATCH 05/28] PCI: xilinx: keep references to both IRQ domains
[not found] <1448900513-20856-1-git-send-email-paul.burton@imgtec.com>
@ 2015-11-30 16:21 ` Paul Burton
2015-12-04 18:17 ` Bjorn Helgaas
2015-11-30 16:21 ` [PATCH 06/28] PCI: xilinx: unify INTx & MSI interrupt FIFO decode Paul Burton
` (4 subsequent siblings)
5 siblings, 1 reply; 8+ messages in thread
From: Paul Burton @ 2015-11-30 16:21 UTC (permalink / raw)
To: linux-mips
Cc: Paul Burton, Sören Brinkmann, Michal Simek, Jiang Liu,
Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas, linux-pci,
Russell Joyce, Arnd Bergmann, linux-kernel, Jingoo Han,
linux-arm-kernel
pcie-xilinx creates 2 IRQ domains when built with MSI support: one for
MSI interrupts & one for legacy INTx interrupts. However, it only kept a
reference to the MSI IRQ domain. This means that any INTx interrupts
that may occur would be mapped using the wrong domain, and that only the
MSI IRQ domain would be removed along with the driver. Track both IRQ
domains & clean up both as appropriate.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
---
drivers/pci/host/pcie-xilinx.c | 58 ++++++++++++++++++++----------------------
1 file changed, 28 insertions(+), 30 deletions(-)
diff --git a/drivers/pci/host/pcie-xilinx.c b/drivers/pci/host/pcie-xilinx.c
index 3c7a0d5..c412a37 100644
--- a/drivers/pci/host/pcie-xilinx.c
+++ b/drivers/pci/host/pcie-xilinx.c
@@ -105,6 +105,7 @@
* @root_busno: Root Bus number
* @dev: Device pointer
* @irq_domain: IRQ domain pointer
+ * @msi_irq_domain: MSI IRQ domain pointer
* @bus_range: Bus range
* @resources: Bus Resources
*/
@@ -115,6 +116,7 @@ struct xilinx_pcie_port {
u8 root_busno;
struct device *dev;
struct irq_domain *irq_domain;
+ struct irq_domain *msi_irq_domain;
struct resource bus_range;
struct list_head resources;
};
@@ -291,7 +293,7 @@ static int xilinx_pcie_msi_setup_irq(struct msi_controller *chip,
if (hwirq < 0)
return hwirq;
- irq = irq_create_mapping(port->irq_domain, hwirq);
+ irq = irq_create_mapping(port->msi_irq_domain, hwirq);
if (!irq)
return -EINVAL;
@@ -517,31 +519,21 @@ static irqreturn_t xilinx_pcie_intr_handler(int irq, void *data)
/**
* xilinx_pcie_free_irq_domain - Free IRQ domain
- * @port: PCIe port information
+ * @domain: the IRQ domain to free
+ * @nr: the number of IRQs in the domain
*/
-static void xilinx_pcie_free_irq_domain(struct xilinx_pcie_port *port)
+static void xilinx_pcie_free_irq_domain(struct irq_domain *domain, int nr)
{
int i;
- u32 irq, num_irqs;
-
- /* Free IRQ Domain */
- if (IS_ENABLED(CONFIG_PCI_MSI)) {
-
- free_pages(port->msi_pages, 0);
-
- num_irqs = XILINX_NUM_MSI_IRQS;
- } else {
- /* INTx */
- num_irqs = 4;
- }
+ u32 irq;
- for (i = 0; i < num_irqs; i++) {
- irq = irq_find_mapping(port->irq_domain, i);
+ for (i = 0; i < nr; i++) {
+ irq = irq_find_mapping(domain, i);
if (irq > 0)
irq_dispose_mapping(irq);
}
- irq_domain_remove(port->irq_domain);
+ irq_domain_remove(domain);
}
/**
@@ -571,20 +563,20 @@ static int xilinx_pcie_init_irq_domain(struct xilinx_pcie_port *port)
return PTR_ERR(port->irq_domain);
}
- /* Setup MSI */
- if (IS_ENABLED(CONFIG_PCI_MSI)) {
- port->irq_domain = irq_domain_add_linear(node,
- XILINX_NUM_MSI_IRQS,
- &msi_domain_ops,
- &xilinx_pcie_msi_chip);
- if (!port->irq_domain) {
- dev_err(dev, "Failed to get a MSI IRQ domain\n");
- return PTR_ERR(port->irq_domain);
- }
+ if (!IS_ENABLED(CONFIG_PCI_MSI))
+ return 0;
- xilinx_pcie_enable_msi(port);
+ /* Setup MSI */
+ port->msi_irq_domain = irq_domain_add_linear(node,
+ XILINX_NUM_MSI_IRQS,
+ &msi_domain_ops,
+ &xilinx_pcie_msi_chip);
+ if (!port->msi_irq_domain) {
+ dev_err(dev, "Failed to get a MSI IRQ domain\n");
+ return PTR_ERR(port->msi_irq_domain);
}
+ xilinx_pcie_enable_msi(port);
return 0;
}
@@ -868,7 +860,13 @@ static int xilinx_pcie_remove(struct platform_device *pdev)
{
struct xilinx_pcie_port *port = platform_get_drvdata(pdev);
- xilinx_pcie_free_irq_domain(port);
+ xilinx_pcie_free_irq_domain(port->irq_domain, 4);
+
+ if (config_enabled(CONFIG_MSI)) {
+ free_pages(port->msi_pages, 0);
+ xilinx_pcie_free_irq_domain(port->msi_irq_domain,
+ XILINX_NUM_MSI_IRQS);
+ }
return 0;
}
--
2.6.2
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH 05/28] PCI: xilinx: keep references to both IRQ domains
2015-11-30 16:21 ` [PATCH 05/28] PCI: xilinx: keep references to both IRQ domains Paul Burton
@ 2015-12-04 18:17 ` Bjorn Helgaas
0 siblings, 0 replies; 8+ messages in thread
From: Bjorn Helgaas @ 2015-12-04 18:17 UTC (permalink / raw)
To: Paul Burton
Cc: linux-mips, Sören Brinkmann, Michal Simek, Jiang Liu,
Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas, linux-pci,
Russell Joyce, Arnd Bergmann, linux-kernel, Jingoo Han,
linux-arm-kernel
Hi Paul,
Please capitalize the first word of your PCI changelog subjects.
On Mon, Nov 30, 2015 at 04:21:30PM +0000, Paul Burton wrote:
> pcie-xilinx creates 2 IRQ domains when built with MSI support: one for
> MSI interrupts & one for legacy INTx interrupts. However, it only kept a
> reference to the MSI IRQ domain. This means that any INTx interrupts
> that may occur would be mapped using the wrong domain, and that only the
> MSI IRQ domain would be removed along with the driver. Track both IRQ
> domains & clean up both as appropriate.
It looks like this fixes a problem in the original commit 8961def56845
("PCI: xilinx: Add Xilinx AXI PCIe Host Bridge IP driver"), which
appeared in v3.18. Does this need a stable backport tag?
It sounds like any device using INTx just won't work? From later
patches, I surmise that this series might be related to using Xilinx
in a new MIPS Boston board. If that's the case, and pre-v4.5 kernels
don't support that board anyway, a stable backport might not be
needed. It *does* fix a leak even if you don't need INTx, but that
seems minor and probably not worth a stable backport all by itself.
I probably *would* add a 'Fixes: 8961def56845 ("PCI: xilinx: Add
Xilinx AXI PCIe Host Bridge IP driver")' line to leave breadcrumbs for
people backporting things.
This seems to be part of a larger series -- can these PCI patches go
through my tree, or do they all need to go together because of
dependencies on the rest of the series?
They all need acks from Michal, of course.
> Signed-off-by: Paul Burton <paul.burton@imgtec.com>
> ---
>
> drivers/pci/host/pcie-xilinx.c | 58 ++++++++++++++++++++----------------------
> 1 file changed, 28 insertions(+), 30 deletions(-)
>
> diff --git a/drivers/pci/host/pcie-xilinx.c b/drivers/pci/host/pcie-xilinx.c
> index 3c7a0d5..c412a37 100644
> --- a/drivers/pci/host/pcie-xilinx.c
> +++ b/drivers/pci/host/pcie-xilinx.c
> @@ -105,6 +105,7 @@
> * @root_busno: Root Bus number
> * @dev: Device pointer
> * @irq_domain: IRQ domain pointer
> + * @msi_irq_domain: MSI IRQ domain pointer
> * @bus_range: Bus range
> * @resources: Bus Resources
> */
> @@ -115,6 +116,7 @@ struct xilinx_pcie_port {
> u8 root_busno;
> struct device *dev;
> struct irq_domain *irq_domain;
> + struct irq_domain *msi_irq_domain;
> struct resource bus_range;
> struct list_head resources;
> };
> @@ -291,7 +293,7 @@ static int xilinx_pcie_msi_setup_irq(struct msi_controller *chip,
> if (hwirq < 0)
> return hwirq;
>
> - irq = irq_create_mapping(port->irq_domain, hwirq);
> + irq = irq_create_mapping(port->msi_irq_domain, hwirq);
> if (!irq)
> return -EINVAL;
>
> @@ -517,31 +519,21 @@ static irqreturn_t xilinx_pcie_intr_handler(int irq, void *data)
>
> /**
> * xilinx_pcie_free_irq_domain - Free IRQ domain
> - * @port: PCIe port information
> + * @domain: the IRQ domain to free
> + * @nr: the number of IRQs in the domain
> */
> -static void xilinx_pcie_free_irq_domain(struct xilinx_pcie_port *port)
> +static void xilinx_pcie_free_irq_domain(struct irq_domain *domain, int nr)
> {
> int i;
> - u32 irq, num_irqs;
> -
> - /* Free IRQ Domain */
> - if (IS_ENABLED(CONFIG_PCI_MSI)) {
> -
> - free_pages(port->msi_pages, 0);
> -
> - num_irqs = XILINX_NUM_MSI_IRQS;
> - } else {
> - /* INTx */
> - num_irqs = 4;
> - }
> + u32 irq;
>
> - for (i = 0; i < num_irqs; i++) {
> - irq = irq_find_mapping(port->irq_domain, i);
> + for (i = 0; i < nr; i++) {
> + irq = irq_find_mapping(domain, i);
> if (irq > 0)
> irq_dispose_mapping(irq);
> }
>
> - irq_domain_remove(port->irq_domain);
> + irq_domain_remove(domain);
> }
>
> /**
> @@ -571,20 +563,20 @@ static int xilinx_pcie_init_irq_domain(struct xilinx_pcie_port *port)
> return PTR_ERR(port->irq_domain);
> }
>
> - /* Setup MSI */
> - if (IS_ENABLED(CONFIG_PCI_MSI)) {
> - port->irq_domain = irq_domain_add_linear(node,
> - XILINX_NUM_MSI_IRQS,
> - &msi_domain_ops,
> - &xilinx_pcie_msi_chip);
> - if (!port->irq_domain) {
> - dev_err(dev, "Failed to get a MSI IRQ domain\n");
> - return PTR_ERR(port->irq_domain);
> - }
> + if (!IS_ENABLED(CONFIG_PCI_MSI))
> + return 0;
>
> - xilinx_pcie_enable_msi(port);
> + /* Setup MSI */
> + port->msi_irq_domain = irq_domain_add_linear(node,
> + XILINX_NUM_MSI_IRQS,
> + &msi_domain_ops,
> + &xilinx_pcie_msi_chip);
> + if (!port->msi_irq_domain) {
> + dev_err(dev, "Failed to get a MSI IRQ domain\n");
> + return PTR_ERR(port->msi_irq_domain);
> }
>
> + xilinx_pcie_enable_msi(port);
> return 0;
> }
>
> @@ -868,7 +860,13 @@ static int xilinx_pcie_remove(struct platform_device *pdev)
> {
> struct xilinx_pcie_port *port = platform_get_drvdata(pdev);
>
> - xilinx_pcie_free_irq_domain(port);
> + xilinx_pcie_free_irq_domain(port->irq_domain, 4);
> +
> + if (config_enabled(CONFIG_MSI)) {
> + free_pages(port->msi_pages, 0);
> + xilinx_pcie_free_irq_domain(port->msi_irq_domain,
> + XILINX_NUM_MSI_IRQS);
> + }
>
> return 0;
> }
> --
> 2.6.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 06/28] PCI: xilinx: unify INTx & MSI interrupt FIFO decode
[not found] <1448900513-20856-1-git-send-email-paul.burton@imgtec.com>
2015-11-30 16:21 ` [PATCH 05/28] PCI: xilinx: keep references to both IRQ domains Paul Burton
@ 2015-11-30 16:21 ` Paul Burton
2015-11-30 16:21 ` [PATCH 07/28] PCI: xilinx: always clear interrupt decode register Paul Burton
` (3 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Paul Burton @ 2015-11-30 16:21 UTC (permalink / raw)
To: linux-mips
Cc: Paul Burton, Sören Brinkmann, Michal Simek, Jiang Liu,
Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas, linux-pci,
Russell Joyce, Arnd Bergmann, linux-kernel, Thomas Gleixner,
Jingoo Han, linux-arm-kernel
When decoding either an INTx or MSI interrupt, the driver has no way to
know which it will pull out of the interrupt FIFO. If both were pending
then this would lead to either the interrupt being handled incorrectly
(MSI interrupt treated as INTx) or not at all (INTx interrupt dropped by
MSI path). Unify the reading of the interrupt FIFO & act according to
the type of interrupt actually read.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
---
drivers/pci/host/pcie-xilinx.c | 45 +++++++++++-------------------------------
1 file changed, 12 insertions(+), 33 deletions(-)
diff --git a/drivers/pci/host/pcie-xilinx.c b/drivers/pci/host/pcie-xilinx.c
index c412a37..c6fe273 100644
--- a/drivers/pci/host/pcie-xilinx.c
+++ b/drivers/pci/host/pcie-xilinx.c
@@ -397,7 +397,7 @@ static const struct irq_domain_ops intx_domain_ops = {
static irqreturn_t xilinx_pcie_intr_handler(int irq, void *data)
{
struct xilinx_pcie_port *port = (struct xilinx_pcie_port *)data;
- u32 val, mask, status, msi_data;
+ u32 val, mask, status;
/* Read interrupt decode and mask registers */
val = pcie_read(port, XILINX_PCIE_REG_IDR);
@@ -437,8 +437,8 @@ static irqreturn_t xilinx_pcie_intr_handler(int irq, void *data)
xilinx_pcie_clear_err_interrupts(port);
}
- if (status & XILINX_PCIE_INTR_INTX) {
- /* INTx interrupt received */
+ if (status & (XILINX_PCIE_INTR_INTX | XILINX_PCIE_INTR_MSI)) {
+ /* Interrupt received */
val = pcie_read(port, XILINX_PCIE_REG_RPIFR1);
/* Check whether interrupt valid */
@@ -447,41 +447,20 @@ static irqreturn_t xilinx_pcie_intr_handler(int irq, void *data)
return IRQ_HANDLED;
}
- if (!(val & XILINX_PCIE_RPIFR1_MSI_INTR)) {
- /* Clear interrupt FIFO register 1 */
- pcie_write(port, XILINX_PCIE_RPIFR1_ALL_MASK,
- XILINX_PCIE_REG_RPIFR1);
-
- /* Handle INTx Interrupt */
+ if (val & XILINX_PCIE_RPIFR1_MSI_INTR) {
+ irq = pcie_read(port, XILINX_PCIE_REG_RPIFR2) &
+ XILINX_PCIE_RPIFR2_MSG_DATA;
+ } else {
val = ((val & XILINX_PCIE_RPIFR1_INTR_MASK) >>
XILINX_PCIE_RPIFR1_INTR_SHIFT) + 1;
- generic_handle_irq(irq_find_mapping(port->irq_domain,
- val));
+ irq = irq_find_mapping(port->irq_domain, val);
}
- }
- if (status & XILINX_PCIE_INTR_MSI) {
- /* MSI Interrupt */
- val = pcie_read(port, XILINX_PCIE_REG_RPIFR1);
+ /* Clear interrupt FIFO register 1 */
+ pcie_write(port, XILINX_PCIE_RPIFR1_ALL_MASK,
+ XILINX_PCIE_REG_RPIFR1);
- if (!(val & XILINX_PCIE_RPIFR1_INTR_VALID)) {
- dev_warn(port->dev, "RP Intr FIFO1 read error\n");
- return IRQ_HANDLED;
- }
-
- if (val & XILINX_PCIE_RPIFR1_MSI_INTR) {
- msi_data = pcie_read(port, XILINX_PCIE_REG_RPIFR2) &
- XILINX_PCIE_RPIFR2_MSG_DATA;
-
- /* Clear interrupt FIFO register 1 */
- pcie_write(port, XILINX_PCIE_RPIFR1_ALL_MASK,
- XILINX_PCIE_REG_RPIFR1);
-
- if (IS_ENABLED(CONFIG_PCI_MSI)) {
- /* Handle MSI Interrupt */
- generic_handle_irq(msi_data);
- }
- }
+ generic_handle_irq(irq);
}
if (status & XILINX_PCIE_INTR_SLV_UNSUPP)
--
2.6.2
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 07/28] PCI: xilinx: always clear interrupt decode register
[not found] <1448900513-20856-1-git-send-email-paul.burton@imgtec.com>
2015-11-30 16:21 ` [PATCH 05/28] PCI: xilinx: keep references to both IRQ domains Paul Burton
2015-11-30 16:21 ` [PATCH 06/28] PCI: xilinx: unify INTx & MSI interrupt FIFO decode Paul Burton
@ 2015-11-30 16:21 ` Paul Burton
2015-11-30 16:21 ` [PATCH 08/28] PCI: xilinx: fix INTX irq dispatch Paul Burton
` (2 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Paul Burton @ 2015-11-30 16:21 UTC (permalink / raw)
To: linux-mips
Cc: Paul Burton, Sören Brinkmann, Michal Simek, Jiang Liu,
Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas, linux-pci,
Russell Joyce, linux-kernel, Thomas Gleixner, Arnd Bergmann,
linux-arm-kernel
If an MSI or INTx interrupt is incorrectly triggered with an empty FIFO
then xilinx_pcie_intr_handler will print a warning & skip further
processing. However it did not clear the interrupt in the decode
register, so the same INTX or MSI interrupt would trigger again
immediately even though the FIFO is still empty. Clear the interrupt in
the decode register to avoid that situation.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
---
drivers/pci/host/pcie-xilinx.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/host/pcie-xilinx.c b/drivers/pci/host/pcie-xilinx.c
index c6fe273..3058a57 100644
--- a/drivers/pci/host/pcie-xilinx.c
+++ b/drivers/pci/host/pcie-xilinx.c
@@ -444,7 +444,7 @@ static irqreturn_t xilinx_pcie_intr_handler(int irq, void *data)
/* Check whether interrupt valid */
if (!(val & XILINX_PCIE_RPIFR1_INTR_VALID)) {
dev_warn(port->dev, "RP Intr FIFO1 read error\n");
- return IRQ_HANDLED;
+ goto out;
}
if (val & XILINX_PCIE_RPIFR1_MSI_INTR) {
@@ -490,6 +490,7 @@ static irqreturn_t xilinx_pcie_intr_handler(int irq, void *data)
if (status & XILINX_PCIE_INTR_MST_ERRP)
dev_warn(port->dev, "Master error poison\n");
+out:
/* Clear the Interrupt Decode register */
pcie_write(port, status, XILINX_PCIE_REG_IDR);
--
2.6.2
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 08/28] PCI: xilinx: fix INTX irq dispatch
[not found] <1448900513-20856-1-git-send-email-paul.burton@imgtec.com>
` (2 preceding siblings ...)
2015-11-30 16:21 ` [PATCH 07/28] PCI: xilinx: always clear interrupt decode register Paul Burton
@ 2015-11-30 16:21 ` Paul Burton
2015-11-30 16:21 ` [PATCH 09/28] PCI: xilinx: allow build on MIPS platforms Paul Burton
2015-11-30 16:21 ` [PATCH 20/28] net: pch_gbe: clear interrupt FIFO during probe Paul Burton
5 siblings, 0 replies; 8+ messages in thread
From: Paul Burton @ 2015-11-30 16:21 UTC (permalink / raw)
To: linux-mips
Cc: Paul Burton, Sören Brinkmann, Michal Simek, Jiang Liu,
Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas, linux-pci,
Russell Joyce, linux-kernel, Jingoo Han, linux-arm-kernel
The IRQ domain for INTX interrupts has 4 entries, numbered 0 to 3. This
matches what the hardware reports from the interrupt FIFO exactly, but
xilinx_pcie_intr_handler was adding 1 to that value to convert to the
range 1 to 4. Stop adding 1, such that all of INTA through to INTD fall
within the range of the IRQ domain.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
---
drivers/pci/host/pcie-xilinx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/host/pcie-xilinx.c b/drivers/pci/host/pcie-xilinx.c
index 3058a57..ac9da72 100644
--- a/drivers/pci/host/pcie-xilinx.c
+++ b/drivers/pci/host/pcie-xilinx.c
@@ -451,8 +451,8 @@ static irqreturn_t xilinx_pcie_intr_handler(int irq, void *data)
irq = pcie_read(port, XILINX_PCIE_REG_RPIFR2) &
XILINX_PCIE_RPIFR2_MSG_DATA;
} else {
- val = ((val & XILINX_PCIE_RPIFR1_INTR_MASK) >>
- XILINX_PCIE_RPIFR1_INTR_SHIFT) + 1;
+ val = (val & XILINX_PCIE_RPIFR1_INTR_MASK) >>
+ XILINX_PCIE_RPIFR1_INTR_SHIFT;
irq = irq_find_mapping(port->irq_domain, val);
}
--
2.6.2
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 09/28] PCI: xilinx: allow build on MIPS platforms
[not found] <1448900513-20856-1-git-send-email-paul.burton@imgtec.com>
` (3 preceding siblings ...)
2015-11-30 16:21 ` [PATCH 08/28] PCI: xilinx: fix INTX irq dispatch Paul Burton
@ 2015-11-30 16:21 ` Paul Burton
2015-11-30 16:21 ` [PATCH 20/28] net: pch_gbe: clear interrupt FIFO during probe Paul Burton
5 siblings, 0 replies; 8+ messages in thread
From: Paul Burton @ 2015-11-30 16:21 UTC (permalink / raw)
To: linux-mips
Cc: Paul Burton, Ley Foon Tan, Jayachandran C, Rob Herring,
Bjorn Helgaas, linux-pci, linux-kernel, Zhou Wang, Duc Dang,
Marc Zyngier, Minghuan Lian, Geert Uytterhoeven, Ray Jui,
Hauke Mehrtens
Allow the xilinx-pcie driver to be built on MIPS platforms. This will be
used on the MIPS Boston board.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
---
drivers/pci/host/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci/host/Kconfig b/drivers/pci/host/Kconfig
index f131ba9..a22e6c7 100644
--- a/drivers/pci/host/Kconfig
+++ b/drivers/pci/host/Kconfig
@@ -81,7 +81,7 @@ config PCI_KEYSTONE
config PCIE_XILINX
bool "Xilinx AXI PCIe host bridge support"
- depends on ARCH_ZYNQ
+ depends on ARCH_ZYNQ || MIPS
help
Say 'Y' here if you want kernel to support the Xilinx AXI PCIe
Host Bridge driver.
--
2.6.2
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 20/28] net: pch_gbe: clear interrupt FIFO during probe
[not found] <1448900513-20856-1-git-send-email-paul.burton@imgtec.com>
` (4 preceding siblings ...)
2015-11-30 16:21 ` [PATCH 09/28] PCI: xilinx: allow build on MIPS platforms Paul Burton
@ 2015-11-30 16:21 ` Paul Burton
2015-12-01 1:48 ` Florian Fainelli
5 siblings, 1 reply; 8+ messages in thread
From: Paul Burton @ 2015-11-30 16:21 UTC (permalink / raw)
To: linux-mips
Cc: Paul Burton, Sören Brinkmann, Michal Simek, Jiang Liu,
Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas, linux-pci,
Russell Joyce, Arnd Bergmann, linux-kernel, Thomas Gleixner,
Jingoo Han, linux-arm-kernel
xilinx_pcie_init_port clears the pending interrupts in the interrupt
decode register, but does not clear the interrupt FIFO. This would lead
to spurious interrupts if any were present in the FIFO at probe time.
Clear the interrupt FIFO prior to the interrupt decode register in order
to start with a clean slate as expected.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
---
drivers/pci/host/pcie-xilinx.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/pci/host/pcie-xilinx.c b/drivers/pci/host/pcie-xilinx.c
index ac9da72..0edb612 100644
--- a/drivers/pci/host/pcie-xilinx.c
+++ b/drivers/pci/host/pcie-xilinx.c
@@ -566,6 +566,8 @@ static int xilinx_pcie_init_irq_domain(struct xilinx_pcie_port *port)
*/
static void xilinx_pcie_init_port(struct xilinx_pcie_port *port)
{
+ u32 val;
+
if (xilinx_pcie_link_is_up(port))
dev_info(port->dev, "PCIe Link is UP\n");
else
@@ -575,6 +577,17 @@ static void xilinx_pcie_init_port(struct xilinx_pcie_port *port)
pcie_write(port, ~XILINX_PCIE_IDR_ALL_MASK,
XILINX_PCIE_REG_IMR);
+ /* Clear interrupt FIFO */
+ while (1) {
+ val = pcie_read(port, XILINX_PCIE_REG_RPIFR1);
+
+ if (!(val & XILINX_PCIE_RPIFR1_INTR_VALID))
+ break;
+
+ pcie_write(port, XILINX_PCIE_RPIFR1_ALL_MASK,
+ XILINX_PCIE_REG_RPIFR1);
+ }
+
/* Clear pending interrupts */
pcie_write(port, pcie_read(port, XILINX_PCIE_REG_IDR) &
XILINX_PCIE_IMR_ALL_MASK,
--
2.6.2
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH 20/28] net: pch_gbe: clear interrupt FIFO during probe
2015-11-30 16:21 ` [PATCH 20/28] net: pch_gbe: clear interrupt FIFO during probe Paul Burton
@ 2015-12-01 1:48 ` Florian Fainelli
0 siblings, 0 replies; 8+ messages in thread
From: Florian Fainelli @ 2015-12-01 1:48 UTC (permalink / raw)
To: Paul Burton, linux-mips
Cc: Sören Brinkmann, Michal Simek, Jiang Liu, Lorenzo Pieralisi,
Rob Herring, Bjorn Helgaas, linux-pci, Russell Joyce,
Arnd Bergmann, linux-kernel, Thomas Gleixner, Jingoo Han,
linux-arm-kernel
On 30/11/15 08:21, Paul Burton wrote:
> xilinx_pcie_init_port clears the pending interrupts in the interrupt
> decode register, but does not clear the interrupt FIFO. This would lead
> to spurious interrupts if any were present in the FIFO at probe time.
> Clear the interrupt FIFO prior to the interrupt decode register in order
> to start with a clean slate as expected.
>
> Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Seems like the subject should be "PCI: xilinx: ..." to be consistent
with the changes you are making to this driver earlier in the series?
--
Florian
^ permalink raw reply [flat|nested] 8+ messages in thread