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


Groups > linux.kernel > #1277540

Re: [PATCH v2 19/19] irqchip/mips-gic: Add new DT property to reserve IPIs

From Rob Herring <robh@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH v2 19/19] irqchip/mips-gic: Add new DT property to reserve IPIs
Date 2015-11-25 17:10 +0100
Message-ID <qyKNS-9k-67@gated-at.bofh.it> (permalink)
References <qyH3z-67h-9@gated-at.bofh.it> <qyH3B-67h-45@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Nov 25, 2015 at 12:06:57PM +0000, Qais Yousef wrote:
> The new property will allow to specify the range of GIC hwirqs to use for IPIs.
> 
> This is an optinal property. We preserve the previous behaviour of allocating
> the last 2 * gic_vpes if it's not specified or DT is not supported.
> 
> Signed-off-by: Qais Yousef <qais.yousef@imgtec.com>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Pawel Moll <pawel.moll@arm.com>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
> Cc: Kumar Gala <galak@codeaurora.org>
> Cc: devicetree@vger.kernel.org

Acked-by: Rob Herring <robh@kernel.org>

> 
> ---
>  .../devicetree/bindings/interrupt-controller/mips-gic.txt    |  7 +++++++
>  drivers/irqchip/irq-mips-gic.c                               | 12 ++++++++++--
>  2 files changed, 17 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/interrupt-controller/mips-gic.txt b/Documentation/devicetree/bindings/interrupt-controller/mips-gic.txt
> index aae4c384ee1f..173595305e26 100644
> --- a/Documentation/devicetree/bindings/interrupt-controller/mips-gic.txt
> +++ b/Documentation/devicetree/bindings/interrupt-controller/mips-gic.txt
> @@ -23,6 +23,12 @@ Optional properties:
>  - mti,reserved-cpu-vectors : Specifies the list of CPU interrupt vectors
>    to which the GIC may not route interrupts.  Valid values are 2 - 7.
>    This property is ignored if the CPU is started in EIC mode.
> +- mti,reserved-ipi-vectors : Specifies the range of GIC interrupts that are
> +  reserved for IPIs.
> +  It accepts 2 values, the 1st is the starting interrupt and the 2nd is the size
> +  of the reserved range.
> +  If not specified, the driver will allocate the last 2 * number of VPEs in the
> +  system.
>  
>  Required properties for timer sub-node:
>  - compatible : Should be "mti,gic-timer".
> @@ -44,6 +50,7 @@ Example:
>  		#interrupt-cells = <3>;
>  
>  		mti,reserved-cpu-vectors = <7>;
> +		mti,reserved-ipi-vectors = <40 8>;
>  
>  		timer {
>  			compatible = "mti,gic-timer";
> diff --git a/drivers/irqchip/irq-mips-gic.c b/drivers/irqchip/irq-mips-gic.c
> index c7043a15253b..659fe734d1b7 100644
> --- a/drivers/irqchip/irq-mips-gic.c
> +++ b/drivers/irqchip/irq-mips-gic.c
> @@ -945,6 +945,7 @@ static void __init __gic_init(unsigned long gic_base_addr,
>  			      struct device_node *node)
>  {
>  	unsigned int gicconfig;
> +	unsigned int v[2];
>  
>  	gic_base = ioremap_nocache(gic_base_addr, gic_addrspace_size);
>  
> @@ -1013,8 +1014,15 @@ static void __init __gic_init(unsigned long gic_base_addr,
>  
>  	gic_ipi_domain->bus_token = DOMAIN_BUS_IPI;
>  
> -	/* Make the last 2 * NR_CPUS available for IPIs */
> -	bitmap_set(ipi_resrv, gic_shared_intrs - 2 * gic_vpes, 2 * gic_vpes);
> +	if (node &&
> +	    !of_property_read_u32_array(node, "mti,reserved-ipi-vectors", &v, 2)) {
> +		bitmap_set(ipi_resrv, v[0], v[1]);
> +	} else {
> +		/* Make the last 2 * gic_vpes available for IPIs */
> +		bitmap_set(ipi_resrv,
> +			   gic_shared_intrs - 2 * gic_vpes,
> +			   2 * gic_vpes);
> +	}
>  
>  	gic_basic_init();
>  }
> -- 
> 2.1.0
> 
--
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/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 00/19] Implement generic IPI support mechanism Qais Yousef <qais.yousef@imgtec.com> - 2015-11-25 13:10 +0100
  [PATCH v2 04/19] genirq: Add new struct ipi_mask and helper functions Qais Yousef <qais.yousef@imgtec.com> - 2015-11-25 13:10 +0100
    Re: [PATCH v2 04/19] genirq: Add new struct ipi_mask and helper  functions Thomas Gleixner <tglx@linutronix.de> - 2015-11-30 12:30 +0100
      Re: [PATCH v2 04/19] genirq: Add new struct ipi_mask and helper  functions Qais Yousef <qais.yousef@imgtec.com> - 2015-11-30 12:50 +0100
        Re: [PATCH v2 04/19] genirq: Add new struct ipi_mask and helper  functions Thomas Gleixner <tglx@linutronix.de> - 2015-11-30 14:20 +0100
          Re: [PATCH v2 04/19] genirq: Add new struct ipi_mask and helper  functions Qais Yousef <qais.yousef@imgtec.com> - 2015-11-30 15:00 +0100
  [PATCH v2 16/19] MIPS: Add generic SMP IPI support Qais Yousef <qais.yousef@imgtec.com> - 2015-11-25 13:10 +0100
  [PATCH v2 01/19] genirq: Add new IRQ_DOMAIN_FLAGS_IPI Qais Yousef <qais.yousef@imgtec.com> - 2015-11-25 13:10 +0100
  [PATCH v2 03/19] genirq: Add GENERIC_IRQ_IPI Kconfig symbol Qais Yousef <qais.yousef@imgtec.com> - 2015-11-25 13:10 +0100
  [PATCH v2 19/19] irqchip/mips-gic: Add new DT property to reserve IPIs Qais Yousef <qais.yousef@imgtec.com> - 2015-11-25 13:10 +0100
    Re: [PATCH v2 19/19] irqchip/mips-gic: Add new DT property to  reserve IPIs Rob Herring <robh@kernel.org> - 2015-11-25 17:10 +0100
  [PATCH v2 14/19] irqchip/mips-gic: Use gic_vpes instead of NR_CPUS Qais Yousef <qais.yousef@imgtec.com> - 2015-11-25 13:10 +0100
  [PATCH v2 09/19] genirq: Add a new function to get IPI reverse mapping Qais Yousef <qais.yousef@imgtec.com> - 2015-11-25 13:10 +0100
    Re: [PATCH v2 09/19] genirq: Add a new function to get IPI reverse  mapping Qais Yousef <qais.yousef@imgtec.com> - 2015-11-27 12:50 +0100
      Re: [PATCH v2 09/19] genirq: Add a new function to get IPI reverse  mapping Thomas Gleixner <tglx@linutronix.de> - 2015-11-30 11:50 +0100
        Re: [PATCH v2 09/19] genirq: Add a new function to get IPI reverse  mapping Qais Yousef <qais.yousef@imgtec.com> - 2015-11-30 12:00 +0100
          Re: [PATCH v2 09/19] genirq: Add a new function to get IPI reverse  mapping Thomas Gleixner <tglx@linutronix.de> - 2015-11-30 12:30 +0100
            Re: [PATCH v2 09/19] genirq: Add a new function to get IPI reverse  mapping Qais Yousef <qais.yousef@imgtec.com> - 2015-11-30 13:00 +0100
  [PATCH v2 02/19] genirq: Add DOMAIN_BUS_IPI Qais Yousef <qais.yousef@imgtec.com> - 2015-11-25 13:10 +0100
  [PATCH v2 11/19] genirq: Implement ipi_send_{mask, single}() Qais Yousef <qais.yousef@imgtec.com> - 2015-11-25 13:10 +0100
  [PATCH v2 15/19] irqchip/mips-gic: Clear percpu_masks correctly when mapping Qais Yousef <qais.yousef@imgtec.com> - 2015-11-25 13:20 +0100
  [PATCH v2 17/19] MIPS: Make smp CMP, CPS and MT use the new generic IPI functions Qais Yousef <qais.yousef@imgtec.com> - 2015-11-25 13:20 +0100
  [PATCH v2 12/19] irqchip/mips-gic: Add a IPI hierarchy domain Qais Yousef <qais.yousef@imgtec.com> - 2015-11-25 13:20 +0100
  [PATCH v2 08/19] genirq: Add a new generic IPI reservation code to irq core Qais Yousef <qais.yousef@imgtec.com> - 2015-11-25 13:20 +0100
  [PATCH v2 07/19] genirq: Make irq_domain_alloc_descs() non static Qais Yousef <qais.yousef@imgtec.com> - 2015-11-25 13:20 +0100
  [PATCH v2 10/19] genirq: Add a new irq_send_ipi() to irq_chip Qais Yousef <qais.yousef@imgtec.com> - 2015-11-25 13:20 +0100
  [PATCH v2 06/19] genirq: Add struct ipi_mapping and its helper functions Qais Yousef <qais.yousef@imgtec.com> - 2015-11-25 13:20 +0100
  [PATCH v2 05/19] genirq: Add struct ipi_mask to irq_data Qais Yousef <qais.yousef@imgtec.com> - 2015-11-25 13:20 +0100
  [PATCH v2 13/19] irqchip/mips-gic: Add device hierarchy domain Qais Yousef <qais.yousef@imgtec.com> - 2015-11-25 13:20 +0100

csiph-web