All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hanjun Guo <hanjun.guo@linaro.org>
To: Marc Zyngier <marc.zyngier@arm.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Jiang Liu <jiang.liu@linux.intel.com>,
	Jason Cooper <jason@lakedaemon.net>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Tomasz Nowicki <tomasz.nowicki@linaro.org>,
	Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>,
	Graeme Gregory <graeme@xora.org.uk>,
	Jake Oshins <jakeo@microsoft.com>
Subject: Re: [PATCH 05/16] irqchip: Convert all alloc/xlate users from of_node to fwnode
Date: Mon, 12 Oct 2015 14:44:24 +0800	[thread overview]
Message-ID: <561B56C8.7090403@linaro.org> (raw)
In-Reply-To: <1444152989-31726-6-git-send-email-marc.zyngier@arm.com>

On 10/07/2015 01:36 AM, Marc Zyngier wrote:
> Since we now have a generic data structure to express an
> interrupt specifier, convert all hierarchical irqchips that
> are OF based to use a fwnode_handle as part of their alloc
> and xlate (which becomes translate) callbacks.
>
> As most of these drivers have dependencies (they exchange IRQ
> specifiers), change them all in a single, massive patch...
>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> ---
>   arch/arm/mach-exynos/suspend.c       | 55 ++++++++++++++++---------------
>   arch/arm/mach-imx/gpc.c              | 55 ++++++++++++++++---------------
>   arch/arm/mach-omap2/omap-wakeupgen.c | 55 ++++++++++++++++---------------
>   drivers/irqchip/irq-crossbar.c       | 62 ++++++++++++++++++----------------
>   drivers/irqchip/irq-gic-v2m.c        | 18 ++++++----
>   drivers/irqchip/irq-gic-v3-its.c     | 20 ++++++-----
>   drivers/irqchip/irq-gic-v3.c         | 49 +++++++++++++--------------
>   drivers/irqchip/irq-gic.c            | 33 ++++++++++++++++---
>   drivers/irqchip/irq-imx-gpcv2.c      | 64 ++++++++++++++++--------------------
>   drivers/irqchip/irq-mtk-sysirq.c     | 49 ++++++++++++++-------------
>   drivers/irqchip/irq-nvic.c           | 18 +++++++---
>   drivers/irqchip/irq-tegra.c          | 55 ++++++++++++++++---------------
>   drivers/irqchip/irq-vf610-mscm-ir.c  | 42 +++++++++++++++--------
>   13 files changed, 323 insertions(+), 252 deletions(-)
>
> diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c
> index e00eb39..5a7e47c 100644
> --- a/arch/arm/mach-exynos/suspend.c
> +++ b/arch/arm/mach-exynos/suspend.c
> @@ -177,54 +177,57 @@ static struct irq_chip exynos_pmu_chip = {
>   #endif
>   };
>
> -static int exynos_pmu_domain_xlate(struct irq_domain *domain,
> -				   struct device_node *controller,
> -				   const u32 *intspec,
> -				   unsigned int intsize,
> -				   unsigned long *out_hwirq,
> -				   unsigned int *out_type)
> +static int exynos_pmu_domain_translate(struct irq_domain *d,
> +				       struct irq_fwspec *fwspec,
> +				       unsigned long *hwirq,
> +				       unsigned int *type)
>   {
> -	if (domain->of_node != controller)
> -		return -EINVAL;	/* Shouldn't happen, really... */
> -	if (intsize != 3)
> -		return -EINVAL;	/* Not GIC compliant */
> -	if (intspec[0] != 0)
> -		return -EINVAL;	/* No PPI should point to this domain */
> +	if (is_of_node(fwspec->fwnode)) {
> +		if (fwspec->param_count != 3)
> +			return -EINVAL;
>
> -	*out_hwirq = intspec[1];
> -	*out_type = intspec[2];
> -	return 0;
> +		/* No PPI should point to this domain */
> +		if (fwspec->param[0] != 0)
> +			return -EINVAL;
> +
> +		*hwirq = fwspec->param[1];
> +		*type = fwspec->param[2];
> +		return 0;
> +	}
> +
> +	return -EINVAL;
>   }
>
>   static int exynos_pmu_domain_alloc(struct irq_domain *domain,
>   				   unsigned int virq,
>   				   unsigned int nr_irqs, void *data)
>   {
> -	struct of_phandle_args *args = data;
> -	struct of_phandle_args parent_args;
> +	struct irq_fwspec *fwspec = data;
> +	struct irq_fwspec parent_fwspec;
>   	irq_hw_number_t hwirq;
>   	int i;
>
> -	if (args->args_count != 3)
> +	if (fwspec->param_count != 3)
>   		return -EINVAL;	/* Not GIC compliant */
> -	if (args->args[0] != 0)
> +	if (fwspec->param[0] != 0)
>   		return -EINVAL;	/* No PPI should point to this domain */
>
> -	hwirq = args->args[1];
> +	hwirq = fwspec->param[1];
>
>   	for (i = 0; i < nr_irqs; i++)
>   		irq_domain_set_hwirq_and_chip(domain, virq + i, hwirq + i,
>   					      &exynos_pmu_chip, NULL);
>
> -	parent_args = *args;
> -	parent_args.np = domain->parent->of_node;

Hmm, here removes the of_node, but I think we still
need to convert it in the first patch, or will break
the git bisect.

Thanks
Hanjun

WARNING: multiple messages have this Message-ID (diff)
From: hanjun.guo@linaro.org (Hanjun Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 05/16] irqchip: Convert all alloc/xlate users from of_node to fwnode
Date: Mon, 12 Oct 2015 14:44:24 +0800	[thread overview]
Message-ID: <561B56C8.7090403@linaro.org> (raw)
In-Reply-To: <1444152989-31726-6-git-send-email-marc.zyngier@arm.com>

On 10/07/2015 01:36 AM, Marc Zyngier wrote:
> Since we now have a generic data structure to express an
> interrupt specifier, convert all hierarchical irqchips that
> are OF based to use a fwnode_handle as part of their alloc
> and xlate (which becomes translate) callbacks.
>
> As most of these drivers have dependencies (they exchange IRQ
> specifiers), change them all in a single, massive patch...
>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> ---
>   arch/arm/mach-exynos/suspend.c       | 55 ++++++++++++++++---------------
>   arch/arm/mach-imx/gpc.c              | 55 ++++++++++++++++---------------
>   arch/arm/mach-omap2/omap-wakeupgen.c | 55 ++++++++++++++++---------------
>   drivers/irqchip/irq-crossbar.c       | 62 ++++++++++++++++++----------------
>   drivers/irqchip/irq-gic-v2m.c        | 18 ++++++----
>   drivers/irqchip/irq-gic-v3-its.c     | 20 ++++++-----
>   drivers/irqchip/irq-gic-v3.c         | 49 +++++++++++++--------------
>   drivers/irqchip/irq-gic.c            | 33 ++++++++++++++++---
>   drivers/irqchip/irq-imx-gpcv2.c      | 64 ++++++++++++++++--------------------
>   drivers/irqchip/irq-mtk-sysirq.c     | 49 ++++++++++++++-------------
>   drivers/irqchip/irq-nvic.c           | 18 +++++++---
>   drivers/irqchip/irq-tegra.c          | 55 ++++++++++++++++---------------
>   drivers/irqchip/irq-vf610-mscm-ir.c  | 42 +++++++++++++++--------
>   13 files changed, 323 insertions(+), 252 deletions(-)
>
> diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c
> index e00eb39..5a7e47c 100644
> --- a/arch/arm/mach-exynos/suspend.c
> +++ b/arch/arm/mach-exynos/suspend.c
> @@ -177,54 +177,57 @@ static struct irq_chip exynos_pmu_chip = {
>   #endif
>   };
>
> -static int exynos_pmu_domain_xlate(struct irq_domain *domain,
> -				   struct device_node *controller,
> -				   const u32 *intspec,
> -				   unsigned int intsize,
> -				   unsigned long *out_hwirq,
> -				   unsigned int *out_type)
> +static int exynos_pmu_domain_translate(struct irq_domain *d,
> +				       struct irq_fwspec *fwspec,
> +				       unsigned long *hwirq,
> +				       unsigned int *type)
>   {
> -	if (domain->of_node != controller)
> -		return -EINVAL;	/* Shouldn't happen, really... */
> -	if (intsize != 3)
> -		return -EINVAL;	/* Not GIC compliant */
> -	if (intspec[0] != 0)
> -		return -EINVAL;	/* No PPI should point to this domain */
> +	if (is_of_node(fwspec->fwnode)) {
> +		if (fwspec->param_count != 3)
> +			return -EINVAL;
>
> -	*out_hwirq = intspec[1];
> -	*out_type = intspec[2];
> -	return 0;
> +		/* No PPI should point to this domain */
> +		if (fwspec->param[0] != 0)
> +			return -EINVAL;
> +
> +		*hwirq = fwspec->param[1];
> +		*type = fwspec->param[2];
> +		return 0;
> +	}
> +
> +	return -EINVAL;
>   }
>
>   static int exynos_pmu_domain_alloc(struct irq_domain *domain,
>   				   unsigned int virq,
>   				   unsigned int nr_irqs, void *data)
>   {
> -	struct of_phandle_args *args = data;
> -	struct of_phandle_args parent_args;
> +	struct irq_fwspec *fwspec = data;
> +	struct irq_fwspec parent_fwspec;
>   	irq_hw_number_t hwirq;
>   	int i;
>
> -	if (args->args_count != 3)
> +	if (fwspec->param_count != 3)
>   		return -EINVAL;	/* Not GIC compliant */
> -	if (args->args[0] != 0)
> +	if (fwspec->param[0] != 0)
>   		return -EINVAL;	/* No PPI should point to this domain */
>
> -	hwirq = args->args[1];
> +	hwirq = fwspec->param[1];
>
>   	for (i = 0; i < nr_irqs; i++)
>   		irq_domain_set_hwirq_and_chip(domain, virq + i, hwirq + i,
>   					      &exynos_pmu_chip, NULL);
>
> -	parent_args = *args;
> -	parent_args.np = domain->parent->of_node;

Hmm, here removes the of_node, but I think we still
need to convert it in the first patch, or will break
the git bisect.

Thanks
Hanjun

  reply	other threads:[~2015-10-12  6:44 UTC|newest]

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-06 17:36 [PATCH 00/16] Divorcing irqdomain and device_node Marc Zyngier
2015-10-06 17:36 ` Marc Zyngier
2015-10-06 17:36 ` Marc Zyngier
2015-10-06 17:36 ` [PATCH 01/16] irqdomain: Use an accessor for the of_node field Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-09 14:24   ` Thomas Gleixner
2015-10-09 14:24     ` Thomas Gleixner
2015-10-09 14:31     ` Marc Zyngier
2015-10-09 14:31       ` Marc Zyngier
2015-10-12  6:04   ` Hanjun Guo
2015-10-12  6:04     ` Hanjun Guo
2015-10-12  9:30     ` Marc Zyngier
2015-10-12  9:30       ` Marc Zyngier
2015-10-06 17:36 ` [PATCH 02/16] irqdomain: Convert irqdomain->of_node to fwnode Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36 ` [PATCH 03/16] irqdomain: Allow irq domain lookup by fwnode Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-12 18:31   ` Suravee Suthikulpanit
2015-10-12 18:31     ` Suravee Suthikulpanit
2015-10-12 18:31     ` Suravee Suthikulpanit
2015-10-13  7:35     ` Marc Zyngier
2015-10-13  7:35       ` Marc Zyngier
2015-10-13  7:35       ` Marc Zyngier
2015-10-06 17:36 ` [PATCH 04/16] irqdomain: Introduce a firmware-specific IRQ specifier structure Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36 ` [PATCH 05/16] irqchip: Convert all alloc/xlate users from of_node to fwnode Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-12  6:44   ` Hanjun Guo [this message]
2015-10-12  6:44     ` Hanjun Guo
2015-10-06 17:36 ` [PATCH 06/16] irqdomain: Introduce irq_create_fwspec_mapping Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36 ` [PATCH 07/16] irqdomain: Introduce irq_domain_create_{linear,tree} Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36 ` [PATCH 08/16] irqdomain: Add a fwnode_handle allocator Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-12 20:32   ` Rafael J. Wysocki
2015-10-12 20:32     ` Rafael J. Wysocki
2015-10-06 17:36 ` [PATCH 09/16] acpi/gsi: Always perform an irq domain lookup Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-12 20:34   ` Rafael J. Wysocki
2015-10-12 20:34     ` Rafael J. Wysocki
2015-10-06 17:36 ` [PATCH 10/16] acpi/gsi: Add acpi_set_irq_model to initialize the GSI layer Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-12 20:36   ` Rafael J. Wysocki
2015-10-12 20:36     ` Rafael J. Wysocki
2015-10-06 17:36 ` [PATCH 11/16] irqchip/gic: Get rid of gic_init_bases() Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36 ` [PATCH 12/16] irqchip/gic: Switch ACPI support to stacked domains Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36 ` [PATCH 13/16] irqchip/gic: Kill the xlate method Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36 ` [PATCH 14/16] acpi/gsi: Cleanup acpi_register_gsi Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-12 20:37   ` Rafael J. Wysocki
2015-10-12 20:37     ` Rafael J. Wysocki
2015-10-06 17:36 ` [PATCH 15/16] irqdomain: Introduce irq_domain_create_hierarchy Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36 ` [PATCH 16/16] irqdomain/msi: Use fwnode instead of of_node Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-11 21:01 ` [PATCH 00/16] Divorcing irqdomain and device_node Thomas Gleixner
2015-10-11 21:01   ` Thomas Gleixner
2015-10-12  2:40   ` Hanjun Guo
2015-10-12  2:40     ` Hanjun Guo
2015-10-12  7:09     ` Hanjun Guo
2015-10-12  7:09       ` Hanjun Guo
2015-10-12 10:31   ` Marc Zyngier
2015-10-12 10:31     ` Marc Zyngier
2015-10-12 20:38   ` Rafael J. Wysocki
2015-10-12 20:38     ` Rafael J. Wysocki
2015-10-13  8:24     ` Marc Zyngier
2015-10-13  8:24       ` Marc Zyngier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=561B56C8.7090403@linaro.org \
    --to=hanjun.guo@linaro.org \
    --cc=Suravee.Suthikulpanit@amd.com \
    --cc=graeme@xora.org.uk \
    --cc=jakeo@microsoft.com \
    --cc=jason@lakedaemon.net \
    --cc=jiang.liu@linux.intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=marc.zyngier@arm.com \
    --cc=rjw@rjwysocki.net \
    --cc=tglx@linutronix.de \
    --cc=tomasz.nowicki@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.