devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Boris BREZILLON <b.brezillon.dev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Boris BREZILLON
	<b.brezillon.dev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Jean-Christophe Plagniol-Villard
	<plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.org>,
	Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [RFC PATCH v2 07/10] irqchip: atmel-aic: document new dt properties and children nodes
Date: Sun, 30 Mar 2014 16:55:48 +0200	[thread overview]
Message-ID: <53383074.40808@gmail.com> (raw)
In-Reply-To: <20140329101903.65848c12@skate>



Hello Thomas,

Le 29/03/2014 10:19, Thomas Petazzoni a écrit :
> Dear Boris BREZILLON,
>
> On Fri, 28 Mar 2014 18:59:05 +0100, Boris BREZILLON wrote:
>
>> +Optional children nodes:
>> +- muxed irq entries:
>> +  Required properties:
>> +   * compatible: Shall be
>> +     "atmel,aic-mux-1reg-irq": irq enable/disable/retrieve-status is done by
>> +     setting/clearing/reading flags in a specific register
>> +     or
>> +     "atmel,aic-mux-3reg-irq": irq enable/disable/retrieve-status is done
>> +     by writing/reading flags in specific enable/disable/mask registers
>> +   * reg: encode the interrupt control register.
>> +     The first cell encode the irq line.
>> +     The second cell encode the offset register within its iomem range
>> +     The last cell encode the iomem region size (should always be set to 0x4).
>> +   * atmel,aic-mux-reg-mask: define the mask used to disable the interrupts
>> +     generated by the muxed entry.
> Can you describe in more details what are these muxed irqs? Are they
> interrupts raised to the AIC that may actually be related to several
> devices, like a shared interrupt?

Exactly, muxed irqs are shared irqs.

> If that's the case, then what you want is to implement separate
> interrupt controller drivers to handle those shared interrupts, and
> demux them into multiple separate interrupts.

It may work (I'll take a look), but we may have to modify several drivers (and 
it may break the DT ABI).

>
> Note that the way you use the "ranges" property seems wrong to me:
> you're using it as a "hack" to define the base address of some
> peripherals that are outside the AIC, while the ranges property is
> normally used to describe the address translations between a child bus
> and a parent bus. Which is not what you have here, as far as I can
> understand.

This is clearly not a real bus, but more a virtual/conceptual bus where each irq 
source is a bus device.

> So could you give more details about the design of the AIC and these
> muxed interrupts, to see if the DT binding you're proposing is actually
> the right way of representing the hardware?

The AIC controller muxes several peripheral irqs to one irq line.
If a given peripheral has a pending irq, and the driver requesting this irq is 
not loaded (either because it was not enabled or because it is not loaded yet) 
it may generate spurious interrupts (or even hang forever), waiting for someone 
clearing/reading the interrupt flag(s).

See this thread for an example of what can happen if we don't disable all muxed 
interrupts before enabling an IRQ line:

https://lkml.org/lkml/2013/3/8/176

In this series' implementation, I define all the muxed (or shared) interrupt 
entries (using the DT) and let the AIC driver disable all the interrupt sources 
when shutting down an interrupt line or before starting the AIC controller.

This provides a generic solution to avoid these spurious interrupt issues 
instead of adding several hooks in the machine specific code (one for each 
impacted peripheral).


Please tell me if you see a better solution (but keep in mind, this should be 
done during early init, because the at91 init timer is using a muxed irq line on 
almost all at91 SoCs).

Best Regards,

Boris
>
> Thomas

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2014-03-30 14:55 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-28 17:58 [RFC PATCH v2 00/10] ARM: at91: move aic driver to drivers/irqchips Boris BREZILLON
2014-03-28 17:58 ` [RFC PATCH v2 01/10] genirq: generic chip: export irq_map_generic_chip function Boris BREZILLON
2014-03-28 17:59 ` [RFC PATCH v2 02/10] irqchip: atmel-aic: add new atmel AIC driver Boris BREZILLON
2014-03-28 17:59 ` [RFC PATCH v2 03/10] ARM: at91: introduce OLD_IRQ_AT91 Kconfig option Boris BREZILLON
2014-03-29  9:06   ` Thomas Petazzoni
2014-03-29  9:12     ` Arnd Bergmann
2014-03-29  9:52       ` Boris BREZILLON
2014-03-28 17:59 ` [RFC PATCH v2 04/10] ARM: at91: enclose at91_aic_xx calls in IS_ENABLED(CONFIG_OLD_IRQ_AT91) blocks Boris BREZILLON
2014-03-28 17:59 ` [RFC PATCH v2 05/10] ARM: at91: make use of the new AIC driver for dt enabled boards Boris BREZILLON
2014-03-29  9:07   ` Thomas Petazzoni
2014-03-29 10:11     ` Boris BREZILLON
2014-03-28 17:59 ` [RFC PATCH v2 06/10] irqchip: atmel-aic: move binding doc to interrupt-controller directory Boris BREZILLON
2014-03-28 17:59 ` [RFC PATCH v2 07/10] irqchip: atmel-aic: document new dt properties and children nodes Boris BREZILLON
2014-03-29  9:19   ` Thomas Petazzoni
2014-03-30 13:27     ` Boris BREZILLON
2014-03-30 14:55     ` Boris BREZILLON [this message]
2014-03-28 17:59 ` [RFC PATCH v2 08/10] ARM: at91: remove old irq material Boris BREZILLON
2014-03-28 17:59 ` [RFC PATCH v2 09/10] ARM: at91/dt: add new AIC irq mux definitions for sam9x5 SoCs Boris BREZILLON
2014-03-28 17:59 ` [RFC PATCH v2 10/10] ARM: at91/dt: add new AIC irq mux definitions for sama5 SoCs Boris BREZILLON

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=53383074.40808@gmail.com \
    --to=b.brezillon.dev-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.org \
    --cc=tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.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).