[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <49238cda-d12c-7d3f-9333-296527d94f12@linaro.org>
Date: Tue, 2 Oct 2018 09:59:42 +0200
From: Daniel Lezcano <daniel.lezcano@...aro.org>
To: Guo Ren <ren_guo@...ky.com>
Cc: tglx@...utronix.de, jason@...edaemon.net, marc.zyngier@....com,
robh+dt@...nel.org, mark.rutland@....com, anurup.m@...wei.com,
Jonathan.Cameron@...wei.com, will.deacon@....com,
zhangshaokun@...ilicon.com, jhogan@...nel.org,
paul.burton@...s.com, peterz@...radead.org, f.fainelli@...il.com,
arnd@...db.de, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org
Subject: Re: [PATCH V9 3/8] clocksource: add C-SKY SMP timer
On 02/10/2018 07:40, Guo Ren wrote:
[ ... ]
>>
>> irq = irq_of_parse_and_map(np, 0);
>> if (irq <= 0)
>> return -EINVAL;
> panic();
> I want a panic here. Return will make debug confused and directly tell
> the people where is wrong. It's root-timer for us and it must bootup.
>
> If it's a co-timer, I also think return is good.
We don't need a panic in case of failure. If the board as an alternate
timer it should be able to boot, that is the general rule of thumb for
these drivers in this directory.
The init timer functions will be called via the timer_probe() which
browse the timer_of_table (the one with all entries for the
TIMER_OF_DECLARE macros).
You can see in the code below (from timer_probe.c), there is an error
message emitted if the driver fails to initialize and another one much
stronger if no timer was initialize.
This is enough trace IMO.
void __init timer_probe(void)
{
struct device_node *np;
const struct of_device_id *match;
of_init_fn_1_ret init_func_ret;
unsigned timers = 0;
int ret;
for_each_matching_node_and_match(np, __timer_of_table, &match) {
if (!of_device_is_available(np))
continue;
init_func_ret = match->data;
ret = init_func_ret(np);
if (ret) {
pr_err("Failed to initialize '%pOF': %d\n", np,
ret);
continue;
}
timers++;
}
timers += acpi_probe_device_table(timer);
if (!timers)
pr_crit("%s: no matching timers found\n", __func__);
}
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
Powered by blists - more mailing lists