lkml.org 
[lkml]   [2016]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] clocksource/drivers/tango-xtal: Fix incorrect test
[ ... ]

> About the error handling... you advised against panic()
> because there might be other clock sources.
>
> Does it makes sense to give up registering sched_clock
> and delay_timer when the clocksource registration fails?

Actually, all the problem is coming from the CLOCKSOURCE_OF_DECLARE where
the init_func is a void (*init_func)(struct device_node *) signature, thus
not allowing to return a value.

Because of that, the init code path of the different drivers are somewhat
fuzzy when an error occurs.

If the function could return an error code, then the drivers would be
written in a way to catch and handle the errors gracefully. That implies the
clocksource-probe() routine will be able to detect when the init_func() is
failing, trace it and count if one clocksource/clockevent succeed at boot
time.

So because the latter, it would make sense to give up registering and leave
a clean place in the init function when something is going wrong.

-- Daniel

\
 
 \ /
  Last update: 2016-04-20 07:21    [W:0.059 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site