Re: early init dt for earlyprintk (was Re: [RFC PATCH v1 25/31] ARC:[plat-arcfpga] Hooking up platform to ARC UART)

From: Vineet Gupta
Date: Mon Jan 14 2013 - 05:09:32 EST


On Monday 14 January 2013 03:18 PM, James Hogan wrote:
> Hi Vineet
>
> On 14/01/13 07:35, Vineet Gupta wrote:
>> 2. We really need a Documentation/dt-for-new-linux-arches.txt, as the existing
>> refs - while very helpful - fail to mention subtleties such as you absolutely need
>> a intc instance and a default irq domain ..... before the driver can start using
>> the DT.
>
> Sounds like a good idea. I'm curious about what you say about default
> IRQ domains though. Do you mean irq_set_default_host? In what way is
> that required to use DT?
>
> Cheers
> James
>

Nope, the fact that we need a irq_domain_add_*( ) call corresponding to atleast
one interrupt-controller node in the DT. In absence of that, the following
callstack returns - with RESOURCE_IRQ unpopulated - causing driver to eventually
fail the probe.

of_platform_populate
...
of_irq_to_resource
irq_of_parse_and_map
irq_create_of_mapping -> Needs "some" irq domain.

Prior to introducing DT in ARC Port, I didn't have any of CONFIG_IRQ_DOMAIN and
still it used to work fine. Enabling CONFIG_OF forced me to enable
CONFIG_IRQ_DOMAIN (merely to resolve link errors) but I had no clue (call me
stupid if you will) that I needed an actual domain setup.

The irq_set_default_host( ) is a nice design pattern though which avoids exporting
the root domain outside of the specific compilation unit.

-Vineet
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/