lkml.org 
[lkml]   [2013]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3] clocksource: fix can not set tsc as clocksource bug
On 07/04/2013 09:04 PM, Thomas Gleixner wrote:
>>> > > static int clocksource_watchdog_kthread(void *data)
>>> > > {
>>> > > struct clocksource *cs, *tmp;
>>> > > @@ -412,11 +415,14 @@ static int clocksource_watchdog_kthread(void *data)
>>> > >
>>> > > mutex_lock(&clocksource_mutex);
>>> > > spin_lock_irqsave(&watchdog_lock, flags);
>>> > > - list_for_each_entry_safe(cs, tmp, &watchdog_list, wd_list)
>>> > > + list_for_each_entry_safe(cs, tmp, &watchdog_list, wd_list) {
>>> > > if (cs->flags & CLOCK_SOURCE_UNSTABLE) {
>>> > > list_del_init(&cs->wd_list);
>>> > > list_add(&cs->wd_list, &unstable);
>>> > > }
>>> > > + if (cs->flags & CLOCK_SOURCE_VALID_FOR_HRES)
>>> > > + clocksource_select();
>> >
>> > Unlikely, but if we have 3 watched clocksources which have the HRES
>> > bit set, you'd call 3 times clocksource_select().
> Also the reselect must be called outside the watchdog_lock region.

Sorry for stupid, the watchdog_lock used protect watchdog related
resource. but clocksource_select doesn't touch them. So, I know it isn't
necessary to put reselect under this lock. Just don't know why the
reselect *must* be called outside of it?

--
Thanks
Alex


\
 
 \ /
  Last update: 2013-07-05 05:01    [W:0.137 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site