All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pcie-xilinx: OF-PCIe numbers legacy interrupts from 1
@ 2017-06-23 21:57 Palmer Dabbelt
  2017-07-12 22:58 ` Bjorn Helgaas
  0 siblings, 1 reply; 2+ messages in thread
From: Palmer Dabbelt @ 2017-06-23 21:57 UTC (permalink / raw)
  To: bhelgaas, michal.simek, soren.brinkmann, bharat.kumar.gogada,
	po.liu, christophe.jaillet, paul.gortmaker, linux-pci,
	linux-kernel
  Cc: Wesley W. Terpstra, Palmer Dabbelt

From: "Wesley W. Terpstra" <wesley@sifive.com>

Without this patch we can't use the 4th legacy PCIe interrupt.  This
is a workaround: there are only 4 legacy interrupts, but since they're
numbered starting from 1 instead of 0 this just adds a 5th interrupt.

Signed-off-by: Palmer Dabbelt <palmer@dabbelt.com>
Signed-off-by: Wesley W. Terpstra <wesley@sifive.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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] pcie-xilinx: OF-PCIe numbers legacy interrupts from 1
  2017-06-23 21:57 [PATCH] pcie-xilinx: OF-PCIe numbers legacy interrupts from 1 Palmer Dabbelt
@ 2017-07-12 22:58 ` Bjorn Helgaas
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Helgaas @ 2017-07-12 22:58 UTC (permalink / raw)
  To: Palmer Dabbelt
  Cc: bhelgaas, michal.simek, soren.brinkmann, bharat.kumar.gogada,
	po.liu, christophe.jaillet, paul.gortmaker, linux-pci,
	linux-kernel, Wesley W. Terpstra, Paul Burton

[+cc Paul]

On Fri, Jun 23, 2017 at 02:57:20PM -0700, Palmer Dabbelt wrote:
> From: "Wesley W. Terpstra" <wesley@sifive.com>
> 
> Without this patch we can't use the 4th legacy PCIe interrupt.  This
> is a workaround: there are only 4 legacy interrupts, but since they're
> numbered starting from 1 instead of 0 this just adds a 5th interrupt.
> 
> Signed-off-by: Palmer Dabbelt <palmer@dabbelt.com>
> Signed-off-by: Wesley W. Terpstra <wesley@sifive.com>

This is a duplicate of Paul Burton's patch, which we're still puzzling
over here:

http://lkml.kernel.org/r/20170712221455.GJ14614@bhelgaas-glaptop.roam.corp.google.com

If you have comments, please chime in on that discussion so it's not
fragmented between two threads.

> ---
>  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
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-07-12 22:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-23 21:57 [PATCH] pcie-xilinx: OF-PCIe numbers legacy interrupts from 1 Palmer Dabbelt
2017-07-12 22:58 ` Bjorn Helgaas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.