[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAL1qeaG0EpxdbV+QxAsdYgAWc19yWf8eLW0mfVxevQaJDxER6w@mail.gmail.com>
Date: Tue, 4 Nov 2014 15:49:16 -0800
From: Andrew Bresticker <abrestic@...omium.org>
To: Mark Rutland <mark.rutland@....com>
Cc: Ralf Baechle <ralf@...ux-mips.org>,
Rob Herring <robh+dt@...nel.org>,
Pawel Moll <Pawel.Moll@....com>,
Ian Campbell <ijc+devicetree@...lion.org.uk>,
Kumar Gala <galak@...eaurora.org>,
Thomas Gleixner <tglx@...utronix.de>,
Jason Cooper <jason@...edaemon.net>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
John Crispin <blogic@...nwrt.org>,
David Daney <ddaney.cavm@...il.com>,
Qais Yousef <qais.yousef@...tec.com>,
"linux-mips@...ux-mips.org" <linux-mips@...ux-mips.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH V3 4/4] clocksource: mips-gic: Add device-tree support
Hi Mark,
>> +static void __init gic_clocksource_of_init(struct device_node *node)
>> +{
>> + if (of_property_read_u32(node, "clock-frequency", &gic_frequency)) {
>> + pr_err("GIC frequency not specified.\n");
>> + return;
>> + }
>> + gic_timer_irq = irq_of_parse_and_map(node, 0);
>> + if (!gic_timer_irq) {
>> + pr_err("GIC timer IRQ not specified.\n");
>> + return;
>> + }
>> +
>> + __gic_clocksource_init();
>> +}
>> +CLOCKSOURCE_OF_DECLARE(mips_gic_timer, "mti,interaptiv-gic-timer",
>> + gic_clocksource_of_init);
>
> Your binding document expected the timer node under the GIC node, and it
> looks like this relies on GIC internals. Hwoever, this allows for people
> to put the timer node anywhere (and it turns out people are _really_ bad
> at putting things together as the binding author expected).
>
> It might be better if the GIC driver detected the sub node and probed
> the clocksource driver (or registered a platform device that the
> clocksource driver gets registered from). that could prevent some
> horrible issues with probe ordering and/or bad dts.
Probing the clocksource during probe of the irqchip doesn't work
because time-keeping isn't set up at the time. Registering a platform
device for the timer pushes back GIC timer registration to later in
the boot process (assuming it now becomes a module_platform_driver)
and makes it rather non-parallel to how it's done in the non-DT case
(this could be changed, though IMO it's a lot of churn just to thwart
bad DT authors).
Probe ordering shouldn't be an issue because irqchips are probed
before clocksources. Perhaps checking for the presence of GIC
(there's the global gic_present) and node->parent (to enforce the
parent-child relationship) would be sufficient?
Thanks,
Andrew
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists