All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <marc.zyngier@arm.com>
To: Noam Camus <noamc@ezchip.com>,
	"linux-snps-arc@lists.infradead.org" 
	<linux-snps-arc@lists.infradead.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Chris Metcalf <cmetcalf@ezchip.com>,
	"daniel.lezcano@linaro.org" <daniel.lezcano@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Jason Cooper <jason@lakedaemon.net>
Subject: Re: [PATCH v4 05/19] irqchip: add nps Internal and external irqchips
Date: Fri, 18 Dec 2015 11:21:17 +0000	[thread overview]
Message-ID: <5673EC2D.5040307@arm.com> (raw)
In-Reply-To: <DB5PR02MB1141324364E0253DAA030DF1D6E10@DB5PR02MB1141.eurprd02.prod.outlook.com>

On 18/12/15 10:37, Noam Camus wrote:
> From: Marc Zyngier [mailto:marc.zyngier@arm.com] 
> Sent: Wednesday, December 16, 2015 11:31 AM
> 
>>> +static int __init nps400_of_init(struct device_node *node,
>>> +				 struct device_node *parent)
>>> +{
>>> +	if (parent)
>>> +		panic("DeviceTree incore ic not a root irq controller\n");
>>> +
>>> +	nps400_root_domain = irq_domain_add_linear(node, NR_CPU_IRQS,
>>> +						   &nps400_irq_ops, NULL);
>>> +
>>> +	if (!nps400_root_domain)
>>> +		panic("nps400 root irq domain not avail\n");
>>> +
>>> +	/* with this we don't need to export nps400_root_domain */
>>> +	irq_set_default_host(nps400_root_domain);
> 
>> Why do you need this? Devices should have their interrupt-parent pointing to this node, and irq_find_host should sort it >out. I must be missing some information (only being CC'd on this single patch).
> Sorry, I will CC you by my next version, in the meantime please refer to:
> https://lkml.org/lkml/2015/12/15/864
> 
> I need this for my per CPU irqs such timer and IPI which do not come
> from some external device but from CPUs. For these IRQs I am calling
> to irq_create_mapping() from my platform at arch/arc and at that
> point I got no irqdomain and using irq_find_host() is not good since
> I got no device_node (at most I can have DT root).

That's a problem. You should never do that for your timer (doing a
request_irq will do the right thing, and that's what your timer driver
already does).

As for initializing your IPIs, they are usually outside of the IRQ
space, so you should handle them separately (and get your irqchip to
initialize them).

> Is there device_node for DT root? 
> Please advise what to do?
> 
>>> +
>>> +	return 0;
>>> +}
>>> +IRQCHIP_DECLARE(ezchip_nps400_ic, "ezchip,nps400-ic", 
>>> +nps400_of_init);
>>>
> 
>> Another thing I'm not seeing here is where is the interrupt actually taken. This code only contains the EOI part, but not the ACK side, as well as the reverse lookup hwirq -> irq). Where is that code?
> 
> ACK is an optional handler and is not needed by my platform.
> I will add comment that since my IRQs are EOI based I do not need an ACK.

What I'm talking about is not the irq_ack method that the irqchip can
provide, but the action your perform on your interrupt controller to
extract the hwirq number and find out what corresponding Linux interrupt
has fired.

> 
> I do not understand reverse lookup remark, where is it missing?
> Could you point me to an example for such reverse lookup? 

See for example:

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/irqchip/irq-sun4i.c#n136

This is the function (sun4i_handle_irq) that is executed almost
immediately after the IRQ is asserted. The CPU reads the hwirq from the
interrupt controller, and use handle_domain_irq() to call the
corresponding handler (by doing a lookup in the domain).

I couldn't find out in your platform code where you are doing that.

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

WARNING: multiple messages have this Message-ID (diff)
From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-snps-arc@lists.infradead.org
Subject: [PATCH v4 05/19] irqchip: add nps Internal and external irqchips
Date: Fri, 18 Dec 2015 11:21:17 +0000	[thread overview]
Message-ID: <5673EC2D.5040307@arm.com> (raw)
In-Reply-To: <DB5PR02MB1141324364E0253DAA030DF1D6E10@DB5PR02MB1141.eurprd02.prod.outlook.com>

On 18/12/15 10:37, Noam Camus wrote:
> From: Marc Zyngier [mailto:marc.zyngier at arm.com] 
> Sent: Wednesday, December 16, 2015 11:31 AM
> 
>>> +static int __init nps400_of_init(struct device_node *node,
>>> +				 struct device_node *parent)
>>> +{
>>> +	if (parent)
>>> +		panic("DeviceTree incore ic not a root irq controller\n");
>>> +
>>> +	nps400_root_domain = irq_domain_add_linear(node, NR_CPU_IRQS,
>>> +						   &nps400_irq_ops, NULL);
>>> +
>>> +	if (!nps400_root_domain)
>>> +		panic("nps400 root irq domain not avail\n");
>>> +
>>> +	/* with this we don't need to export nps400_root_domain */
>>> +	irq_set_default_host(nps400_root_domain);
> 
>> Why do you need this? Devices should have their interrupt-parent pointing to this node, and irq_find_host should sort it >out. I must be missing some information (only being CC'd on this single patch).
> Sorry, I will CC you by my next version, in the meantime please refer to:
> https://lkml.org/lkml/2015/12/15/864
> 
> I need this for my per CPU irqs such timer and IPI which do not come
> from some external device but from CPUs. For these IRQs I am calling
> to irq_create_mapping() from my platform at arch/arc and at that
> point I got no irqdomain and using irq_find_host() is not good since
> I got no device_node (at most I can have DT root).

That's a problem. You should never do that for your timer (doing a
request_irq will do the right thing, and that's what your timer driver
already does).

As for initializing your IPIs, they are usually outside of the IRQ
space, so you should handle them separately (and get your irqchip to
initialize them).

> Is there device_node for DT root? 
> Please advise what to do?
> 
>>> +
>>> +	return 0;
>>> +}
>>> +IRQCHIP_DECLARE(ezchip_nps400_ic, "ezchip,nps400-ic", 
>>> +nps400_of_init);
>>>
> 
>> Another thing I'm not seeing here is where is the interrupt actually taken. This code only contains the EOI part, but not the ACK side, as well as the reverse lookup hwirq -> irq). Where is that code?
> 
> ACK is an optional handler and is not needed by my platform.
> I will add comment that since my IRQs are EOI based I do not need an ACK.

What I'm talking about is not the irq_ack method that the irqchip can
provide, but the action your perform on your interrupt controller to
extract the hwirq number and find out what corresponding Linux interrupt
has fired.

> 
> I do not understand reverse lookup remark, where is it missing?
> Could you point me to an example for such reverse lookup? 

See for example:

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/irqchip/irq-sun4i.c#n136

This is the function (sun4i_handle_irq) that is executed almost
immediately after the IRQ is asserted. The CPU reads the hwirq from the
interrupt controller, and use handle_domain_irq() to call the
corresponding handler (by doing a lookup in the domain).

I couldn't find out in your platform code where you are doing that.

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

  reply	other threads:[~2015-12-18 11:21 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-16  1:10 [PATCH v4 00/19] Adding plat-eznps to ARC Noam Camus
2015-12-16  1:10 ` Noam Camus
2015-12-16  1:10 ` [PATCH v4 01/19] Documentation: Add EZchip vendor to binding list Noam Camus
2015-12-16  1:10   ` Noam Camus
2015-12-16  1:10 ` [PATCH v4 02/19] soc: Support for EZchip SoC Noam Camus
2015-12-16  1:10   ` Noam Camus
2015-12-16  1:10 ` [PATCH v4 03/19] ARC: [plat-eznps] define IPI_IRQ Noam Camus
2015-12-16  1:10   ` Noam Camus
2015-12-16  1:10 ` [PATCH v4 04/19] clocksource: Add NPS400 timers driver Noam Camus
2015-12-16  1:10   ` Noam Camus
2015-12-17 13:12   ` Daniel Lezcano
2015-12-17 13:12     ` Daniel Lezcano
2015-12-16  1:10 ` [PATCH v4 05/19] irqchip: add nps Internal and external irqchips Noam Camus
2015-12-16  1:10   ` Noam Camus
2015-12-16  9:30   ` Marc Zyngier
2015-12-16  9:30     ` Marc Zyngier
2015-12-18 10:37     ` Noam Camus
2015-12-18 10:37       ` Noam Camus
2015-12-18 11:21       ` Marc Zyngier [this message]
2015-12-18 11:21         ` Marc Zyngier
2015-12-18 14:29         ` Noam Camus
2015-12-18 14:29           ` Noam Camus
2015-12-18 16:31           ` Marc Zyngier
2015-12-18 16:31             ` Marc Zyngier
2015-12-19  9:30             ` Noam Camus
2015-12-19  9:30               ` Noam Camus
2015-12-30 11:35             ` Vineet Gupta
2015-12-30 11:35               ` Vineet Gupta
2016-01-12  7:00               ` Vineet Gupta
2016-01-12  7:00                 ` Vineet Gupta
2016-01-12  8:48                 ` Marc Zyngier
2016-01-12  8:48                   ` Marc Zyngier
2016-01-12  9:12                   ` Vineet Gupta
2016-01-12  9:12                     ` Vineet Gupta
2016-01-12  9:28                     ` Marc Zyngier
2016-01-12  9:28                       ` Marc Zyngier
2016-01-25 13:08             ` Vineet Gupta
2016-01-25 13:08               ` Vineet Gupta
2016-01-29 16:37               ` Noam Camus
2016-01-29 16:37                 ` Noam Camus
2015-12-16  1:10 ` [PATCH v4 06/19] ARC: Set vmalloc size from configuration Noam Camus
2015-12-16  1:10   ` Noam Camus
2015-12-16  1:10 ` [PATCH v4 07/19] ARC: rwlock: disable interrupts in !LLSC variant Noam Camus
2015-12-16  1:10   ` Noam Camus
2015-12-16  1:10 ` [PATCH v4 08/19] ARC: rename smp operation init_irq_cpu() to init_per_cpu() Noam Camus
2015-12-16  1:10   ` Noam Camus
2015-12-16  1:10 ` [PATCH v4 09/19] ARC: Mark secondary cpu online only after all HW setup is done Noam Camus
2015-12-16  1:10   ` Noam Camus
2015-12-16  1:10 ` [PATCH v4 10/19] ARC: Add clock from device tree to time_init() Noam Camus
2015-12-16  1:10   ` Noam Camus
2015-12-16  1:10 ` [PATCH v4 11/19] ARC: [plat-eznps] Add eznps board defconfig and dts Noam Camus
2015-12-16  1:10   ` Noam Camus
2015-12-16  1:10 ` [PATCH v4 12/19] ARC: [plat-eznps] Add eznps platform Noam Camus
2015-12-16  1:10   ` Noam Camus
2015-12-16  1:10 ` [PATCH v4 13/19] ARC: [plat-eznps] Use dedicated user stack top Noam Camus
2015-12-16  1:10   ` Noam Camus
2015-12-16  1:10 ` [PATCH v4 14/19] ARC: [plat-eznps] Use dedicated atomic/bitops/cmpxchg Noam Camus
2015-12-16  1:10   ` Noam Camus
2015-12-16  1:10 ` [PATCH v4 15/19] ARC: [plat-eznps] Use dedicated SMP barriers Noam Camus
2015-12-16  1:10   ` Noam Camus
2015-12-16  1:10 ` [PATCH v4 16/19] ARC: [plat-eznps] Use dedicated identity auxiliary register Noam Camus
2015-12-16  1:10   ` Noam Camus
2015-12-16  1:10 ` [PATCH v4 17/19] ARC: [plat-eznps] Use dedicated cpu_relax() Noam Camus
2015-12-16  1:10   ` Noam Camus
2015-12-16  1:10 ` [PATCH v4 18/19] ARC: [plat-eznps] Use dedicated COMMAND_LINE_SIZE Noam Camus
2015-12-16  1:10   ` Noam Camus
2015-12-16  1:10 ` [PATCH v4 19/19] ARC: Add eznps platform to Kconfig and Makefile Noam Camus
2015-12-16  1:10   ` Noam Camus

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=5673EC2D.5040307@arm.com \
    --to=marc.zyngier@arm.com \
    --cc=cmetcalf@ezchip.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=jason@lakedaemon.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=noamc@ezchip.com \
    --cc=tglx@linutronix.de \
    /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.