Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1659275 > unrolled thread

[PATCH 02/17] pcie-xilinx: add missing 5th legacy interrupt

Started byPalmer Dabbelt <palmer@dabbelt.com>
First post2017-06-07 01:10 +0200
Last post2017-06-07 21:10 +0200
Articles 4 — 4 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 02/17] pcie-xilinx: add missing 5th legacy interrupt Palmer Dabbelt <palmer@dabbelt.com> - 2017-06-07 01:10 +0200
    Re: [PATCH 02/17] pcie-xilinx: add missing 5th legacy interrupt Geert Uytterhoeven <geert@linux-m68k.org> - 2017-06-07 09:20 +0200
    Re: [PATCH 02/17] pcie-xilinx: add missing 5th legacy interrupt Marc Zyngier <marc.zyngier@arm.com> - 2017-06-07 11:30 +0200
      Re: [PATCH 02/17] pcie-xilinx: add missing 5th legacy interrupt Wesley Terpstra <wesley@sifive.com> - 2017-06-07 21:10 +0200

#1659275 — [PATCH 02/17] pcie-xilinx: add missing 5th legacy interrupt

FromPalmer Dabbelt <palmer@dabbelt.com>
Date2017-06-07 01:10 +0200
Subject[PATCH 02/17] pcie-xilinx: add missing 5th legacy interrupt
Message-ID<tPvLQ-6UA-21@gated-at.bofh.it>
From: "Wesley W. Terpstra" <wesley@sifive.com>

These are numbered from 1.

Signed-off-by: Palmer Dabbelt <palmer@dabbelt.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 2fe2df51f9f8..8804145d399a 100644
--- a/drivers/pci/host/pcie-xilinx.c
+++ b/drivers/pci/host/pcie-xilinx.c
@@ -443,7 +443,7 @@ static irqreturn_t xilinx_pcie_intr_handler(int irq, void *data)
 			val = ((val & XILINX_PCIE_RPIFR1_INTR_MASK) >>
 				XILINX_PCIE_RPIFR1_INTR_SHIFT) + 1;
 			generic_handle_irq(irq_find_mapping(port->leg_domain,
-							    val));
+							    val + 1));
 		}
 	}
 
@@ -524,7 +524,7 @@ static int xilinx_pcie_init_irq_domain(struct xilinx_pcie_port *port)
 		return -ENODEV;
 	}
 
-	port->leg_domain = irq_domain_add_linear(pcie_intc_node, 4,
+	port->leg_domain = irq_domain_add_linear(pcie_intc_node, 5,
 						 &intx_domain_ops,
 						 port);
 	if (!port->leg_domain) {
-- 
2.13.0

[toc] | [next] | [standalone]


#1659450

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2017-06-07 09:20 +0200
Message-ID<tPDq1-3rU-13@gated-at.bofh.it>
In reply to#1659275
CC pci folks

On Wed, Jun 7, 2017 at 12:59 AM, Palmer Dabbelt <palmer@dabbelt.com> wrote:
> From: "Wesley W. Terpstra" <wesley@sifive.com>
>
> These are numbered from 1.
>
> Signed-off-by: Palmer Dabbelt <palmer@dabbelt.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 2fe2df51f9f8..8804145d399a 100644
> --- a/drivers/pci/host/pcie-xilinx.c
> +++ b/drivers/pci/host/pcie-xilinx.c
> @@ -443,7 +443,7 @@ static irqreturn_t xilinx_pcie_intr_handler(int irq, void *data)
>                         val = ((val & XILINX_PCIE_RPIFR1_INTR_MASK) >>
>                                 XILINX_PCIE_RPIFR1_INTR_SHIFT) + 1;
>                         generic_handle_irq(irq_find_mapping(port->leg_domain,
> -                                                           val));
> +                                                           val + 1));
>                 }
>         }
>
> @@ -524,7 +524,7 @@ static int xilinx_pcie_init_irq_domain(struct xilinx_pcie_port *port)
>                 return -ENODEV;
>         }
>
> -       port->leg_domain = irq_domain_add_linear(pcie_intc_node, 4,
> +       port->leg_domain = irq_domain_add_linear(pcie_intc_node, 5,
>                                                  &intx_domain_ops,
>                                                  port);
>         if (!port->leg_domain) {
> --
> 2.13.0

[toc] | [prev] | [next] | [standalone]


#1659583

FromMarc Zyngier <marc.zyngier@arm.com>
Date2017-06-07 11:30 +0200
Message-ID<tPFrP-4M0-5@gated-at.bofh.it>
In reply to#1659275
+ Bjorn

On 06/06/17 23:59, Palmer Dabbelt wrote:
> From: "Wesley W. Terpstra" <wesley@sifive.com>
> 
> These are numbered from 1.
> 
> Signed-off-by: Palmer Dabbelt <palmer@dabbelt.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 2fe2df51f9f8..8804145d399a 100644
> --- a/drivers/pci/host/pcie-xilinx.c
> +++ b/drivers/pci/host/pcie-xilinx.c
> @@ -443,7 +443,7 @@ static irqreturn_t xilinx_pcie_intr_handler(int irq, void *data)
>  			val = ((val & XILINX_PCIE_RPIFR1_INTR_MASK) >>
>  				XILINX_PCIE_RPIFR1_INTR_SHIFT) + 1;
>  			generic_handle_irq(irq_find_mapping(port->leg_domain,
> -							    val));
> +							    val + 1));
>  		}
>  	}
>  
> @@ -524,7 +524,7 @@ static int xilinx_pcie_init_irq_domain(struct xilinx_pcie_port *port)
>  		return -ENODEV;
>  	}
>  
> -	port->leg_domain = irq_domain_add_linear(pcie_intc_node, 4,
> +	port->leg_domain = irq_domain_add_linear(pcie_intc_node, 5,
>  						 &intx_domain_ops,
>  						 port);
>  	if (!port->leg_domain) {
> 

This is a common problem with the current OF code that numbers INTx from
1 instead of zero (there is no 5th legacy interrupts in the PCI spec,
despite what $SUBJECT says). I'd be inclined to fix this at the core
level rather than papering over it in the various drivers...

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

[toc] | [prev] | [next] | [standalone]


#1660117

FromWesley Terpstra <wesley@sifive.com>
Date2017-06-07 21:10 +0200
Message-ID<tPOv7-2fF-9@gated-at.bofh.it>
In reply to#1659583
On Wed, Jun 7, 2017 at 2:24 AM, Marc Zyngier <marc.zyngier@arm.com> wrote:
> This is a common problem with the current OF code that numbers INTx from
> 1 instead of zero (there is no 5th legacy interrupts in the PCI spec,
> despite what $SUBJECT says). I'd be inclined to fix this at the core
> level rather than papering over it in the various drivers...

While I agree that it's a problem with OF, every other driver has
already been changed to paper over the issue. This patch just brings
this one remaining OF-PCIe driver to the same level as the others.
Without the patch, the driver doesn't work at all if there is a bridge
chip on the other end of the controller, so this is not just a
hypothetical concern for us.

Couldn't the eventual OF fix just refactor this driver along with all
of the others? Doing such a sweeping OF change is outside my current
comfort zone. I am not familiar enough with the code to understand all
the parts that would need to be touched.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web