linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: lorenzo.pieralisi@arm.com (Lorenzo Pieralisi)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 6/9] irqchip / gic: Add stacked irqdomain support for ACPI based GICv2 init
Date: Tue, 23 Jun 2015 18:38:45 +0100	[thread overview]
Message-ID: <20150623173845.GC31466@red-moon> (raw)
In-Reply-To: <5589772A.8070708@linaro.org>

On Tue, Jun 23, 2015 at 04:11:38PM +0100, Hanjun Guo wrote:

[...]

> >> diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
> >> index 8fc67bc..d1b2131 100644
> >> --- a/drivers/irqchip/irq-gic.c
> >> +++ b/drivers/irqchip/irq-gic.c
> >> @@ -851,15 +851,22 @@ static struct notifier_block gic_cpu_notifier = {
> >>   static int gic_irq_domain_alloc(struct irq_domain *domain, unsigned int virq,
> >>   				unsigned int nr_irqs, void *arg)
> >>   {
> >> -	int i, ret;
> >> +	int i;
> >>   	irq_hw_number_t hwirq;
> >> -	unsigned int type = IRQ_TYPE_NONE;
> >> -	struct of_phandle_args *irq_data = arg;
> >>
> >> -	ret = gic_irq_domain_xlate(domain, irq_data->np, irq_data->args,
> >> -				   irq_data->args_count, &hwirq, &type);
> >> -	if (ret)
> >> -		return ret;
> >> +	if (domain->of_node) {	/* DT case */
> >> +		int ret;
> >> +		unsigned int type = IRQ_TYPE_NONE;
> >> +		struct of_phandle_args *irq_data = arg;
> >> +
> >> +		ret = gic_irq_domain_xlate(domain, irq_data->np,
> >> +					irq_data->args,
> >> +					irq_data->args_count, &hwirq, &type);
> >> +		if (ret)
> >> +			return ret;
> >> +	} else {	/* ACPI case */
> >> +		hwirq = (irq_hw_number_t)*(u32 *)arg;
> >> +	}
> >
> > If domain->of_node is NULL and system booted with DT the code above
> > does not fail (and if it fails almost certainly that won't be graceful)
> > but it should.
> 
> how about the following logic?
> 
> if (!domain->of_node && acpi_disabled)
> 	return -ENODEV;
> else if (domain->of_node)
> 	dt related code;
> else
> 	ACPI related code;

Code is not checking the node at present so:

if (acpi_disabled)
	dt code;
else
	ACPI code;

would do, but that's a nit.

> >>   	for (i = 0; i < nr_irqs; i++)
> >>   		gic_irq_domain_map(domain, virq + i, hwirq + i);
> >> @@ -945,11 +952,11 @@ void __init gic_init_bases(unsigned int gic_nr, int irq_start,
> >>   		gic_irqs = 1020;
> >>   	gic->gic_irqs = gic_irqs;
> >>
> >> -	if (node) {		/* DT case */
> >> +	if (node || !acpi_disabled) {		/* DT or ACPI case */
> >>   		gic->domain = irq_domain_add_linear(node, gic_irqs,
> >>   						    &gic_irq_domain_hierarchy_ops,
> >>   						    gic);

I think this is a bit more worrying, I mean passing a NULL node pointer to
the irqdomain layer which basically means you are booting out of ACPI
(for you, if that's true for the irq_domain_add_linear implementation
that's another story), the node pointer should be optional but you
need feedback from IRQ layer maintainers here.

Lorenzo

  reply	other threads:[~2015-06-23 17:38 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-19  8:46 [PATCH v2 0/9] Add self-probe infrastructure and stacked irqdomain support for ACPI based GICv2/3 init Hanjun Guo
2015-06-19  8:46 ` [PATCH v2 1/9] ACPICA: ACPI 6.0: Add changes for MADT table Hanjun Guo
2015-06-19  8:46 ` [PATCH v2 2/9] ACPICA: ACPI 6.0: Add values for MADT GIC version field Hanjun Guo
2015-06-19  8:46 ` [PATCH v2 3/9] irqchip / GIC: Add GIC version support in ACPI MADT Hanjun Guo
2015-06-22 16:45   ` Lorenzo Pieralisi
2015-06-23 11:18     ` Hanjun Guo
2015-06-27  6:07     ` Hanjun Guo
2015-06-19  8:46 ` [PATCH v2 4/9] ACPI / irqchip: Add self-probe infrastructure to initialize IRQ controller Hanjun Guo
2015-06-19  8:46 ` [PATCH v2 5/9] irqchip / GIC / ACPI: Use IRQCHIP_ACPI_DECLARE to simplify GICv2 init code Hanjun Guo
2015-06-19  8:46 ` [PATCH v2 6/9] irqchip / gic: Add stacked irqdomain support for ACPI based GICv2 init Hanjun Guo
2015-06-22 17:20   ` Lorenzo Pieralisi
2015-06-23 15:11     ` Hanjun Guo
2015-06-23 17:38       ` Lorenzo Pieralisi [this message]
2015-06-27  3:52         ` Hanjun Guo
2015-06-29  8:39           ` Marc Zyngier
2015-06-30 11:50             ` Hanjun Guo
2015-06-30 12:17               ` Marc Zyngier
2015-06-30 15:07                 ` Graeme Gregory
2015-07-03  8:47                   ` Hanjun Guo
2015-07-08  3:40                 ` Hanjun Guo
2015-07-10  9:41                   ` Marc Zyngier
2015-06-19  8:46 ` [PATCH v2 7/9] irqchip / GICv3: Refactor gic_of_init() for GICv3 driver Hanjun Guo
2015-06-19  8:46 ` [PATCH v2 8/9] irqchip / GICv3: Add ACPI support for GICv3+ initialization Hanjun Guo
2015-06-19  8:46 ` [PATCH v2 9/9] irqchip / GICv3: Add stacked irqdomain support for ACPI based init Hanjun Guo

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=20150623173845.GC31466@red-moon \
    --to=lorenzo.pieralisi@arm.com \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).