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


Groups > linux.kernel > #1206898

Re: [PATCH v2 2/5] irqchip, gicv3: Add HW revision detection and configuration

From Marc Zyngier <marc.zyngier@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 2/5] irqchip, gicv3: Add HW revision detection and configuration
Date 2015-08-13 17:10 +0200
Message-ID <pX2iK-6SM-29@gated-at.bofh.it> (permalink)
References <pX1Zo-6gD-13@gated-at.bofh.it> <pX1Zo-6gD-31@gated-at.bofh.it>
Organization ARM Ltd

Show all headers | View raw


On 13/08/15 15:47, Robert Richter wrote:
> From: Robert Richter <rrichter@cavium.com>
> 
> Some GIC revisions require an individual configuration to esp. add
> workarounds for HW bugs. This patch implements generic code to parse
> the hw revision provided by an IIDR register value and runs specific
> code if hw matches. There are functions that read the IIDR registers
> for GICV3 and ITS (GICD_IIDR/GITS_IIDR) and then go through a list of
> init functions to be called for specific versions.
> 
> A MIDR register value may also be used, this is especially useful for
> hw detection from a guest.
> 
> The patch is needed to implement workarounds for HW errata in Cavium's
> ThunderX GICV3.
> 
> V2:
>  * adding MIDR check
> 
> Signed-off-by: Robert Richter <rrichter@cavium.com>
> ---
>  drivers/irqchip/irq-gic-common.c | 13 +++++++++++++
>  drivers/irqchip/irq-gic-common.h | 11 +++++++++++
>  drivers/irqchip/irq-gic-v3-its.c | 15 +++++++++++++++
>  drivers/irqchip/irq-gic-v3.c     | 14 ++++++++++++++
>  4 files changed, 53 insertions(+)
> 
> diff --git a/drivers/irqchip/irq-gic-common.c b/drivers/irqchip/irq-gic-common.c
> index 9448e391cb71..886c09e645bf 100644
> --- a/drivers/irqchip/irq-gic-common.c
> +++ b/drivers/irqchip/irq-gic-common.c
> @@ -21,6 +21,19 @@
>  
>  #include "irq-gic-common.h"
>  
> +void gic_check_capabilities(u32 iidr, const struct gic_capabilities *cap,
> +			void *data)
> +{
> +	for (; cap->desc; cap++) {
> +		if (cap->midr != (cap->midr_mask & read_cpuid_id()))
> +			continue;
> +		if (cap->iidr != (cap->iidr_mask & iidr))
> +			continue;
> +		cap->init(data);
> +		pr_info("%s\n", cap->desc);
> +	}
> +}
> +
>  int gic_configure_irq(unsigned int irq, unsigned int type,
>  		       void __iomem *base, void (*sync_access)(void))
>  {
> diff --git a/drivers/irqchip/irq-gic-common.h b/drivers/irqchip/irq-gic-common.h
> index 35a9884778bd..e9a3e2800005 100644
> --- a/drivers/irqchip/irq-gic-common.h
> +++ b/drivers/irqchip/irq-gic-common.h
> @@ -20,10 +20,21 @@
>  #include <linux/of.h>
>  #include <linux/irqdomain.h>
>  
> +struct gic_capabilities {
> +	const char *desc;
> +	void (*init)(void *data);
> +	u32 iidr;
> +	u32 iidr_mask;
> +	u32 midr;
> +	u32 midr_mask;
> +};

Sorry to ask the obvious, but why should we implement another MIDR check
that is private to the GIC driver, while we already have an
infrastructure that deals with that kind of things?

Also, the GIC CPU interface is very much part of the CPU, not part the
GIC itself. I'd rather see a CPU erratum being handler at the same
location as all the other errata.

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...
--
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 0/5] irqchip, gicv3: Updates and Cavium ThunderX errata workarounds Robert Richter <rric@kernel.org> - 2015-08-13 16:50 +0200
  [PATCH v2 5/5] irqchip, gicv3-its: Workaround for Cavium ThunderX errata 22375, 24313 Robert Richter <rric@kernel.org> - 2015-08-13 16:50 +0200
  [PATCH v2 2/5] irqchip, gicv3: Add HW revision detection and configuration Robert Richter <rric@kernel.org> - 2015-08-13 16:50 +0200
    Re: [PATCH v2 2/5] irqchip, gicv3: Add HW revision detection and  configuration Marc Zyngier <marc.zyngier@arm.com> - 2015-08-13 17:10 +0200
  [PATCH v2 1/5] arm64: gicv3: its: Add range check for number of allocated pages Robert Richter <rric@kernel.org> - 2015-08-13 16:50 +0200
  [PATCH v2 4/5] irqchip, gicv3-its: Read typer register outside the loop Robert Richter <rric@kernel.org> - 2015-08-13 17:00 +0200
  [PATCH v2 3/5] irqchip, gicv3: Workaround for Cavium ThunderX erratum 23154 Robert Richter <rric@kernel.org> - 2015-08-13 17:00 +0200
    Re: [PATCH v2 3/5] irqchip, gicv3: Workaround for Cavium ThunderX  erratum 23154 Marc Zyngier <marc.zyngier@arm.com> - 2015-08-13 17:20 +0200
      Re: [PATCH v2 3/5] irqchip, gicv3: Workaround for Cavium ThunderX  erratum 23154 Robert Richter <robert.richter@caviumnetworks.com> - 2015-08-13 18:20 +0200
        Re: [PATCH v2 3/5] irqchip, gicv3: Workaround for Cavium ThunderX  erratum 23154 Marc Zyngier <marc.zyngier@arm.com> - 2015-08-13 19:00 +0200
          Re: [PATCH v2 3/5] irqchip, gicv3: Workaround for Cavium ThunderX  erratum 23154 Robert Richter <robert.richter@caviumnetworks.com> - 2015-08-13 19:20 +0200
            Re: [PATCH v2 3/5] irqchip, gicv3: Workaround for Cavium ThunderX  erratum 23154 Marc Zyngier <marc.zyngier@arm.com> - 2015-08-14 10:30 +0200
              Re: [PATCH v2 3/5] irqchip, gicv3: Workaround for Cavium ThunderX  erratum 23154 Robert Richter <robert.richter@caviumnetworks.com> - 2015-08-14 14:10 +0200

csiph-web