lkml.org 
[lkml]   [2004]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [2.6.0-mm2] PM timer still has problems
From
Date
On Tue, 2003-12-30 at 12:48, Karol Kozimor wrote:
> Hi,
> Booting with clock=pmtmr causes weird problems here (the system
> complains that clock override failed and the bogomips loop produces bogus
> values). Below is the dmesg output as well as /proc/cpuinfo.
> I have CONFIG_X86_LOCAL_APIC=y and CONFIG_X86_PM_TIMER=y.
>
> I don't really know whether this box (ASUS L3800C, more data at
> http://bugme.osdl.org/show_bug.cgi?id=1185) has a PM timer or not, but even
> if it doesn't, the code should account for that gracefully.
> I'll be happy to provide any additional info.

If the override boot option failed, its most likely your system doesn't
have an ACPI PM time source. Instead it seems your system is having
trouble using the PIT as a time source (which seems not all that
uncommon unfortunately).

I guess we can just re-call select_timer() without an override if the
override fails, that way you'll fall back to the default time source on
your system. Try the (compile tested) patch below and see if that helps.

Thanks for the feedback!
-john


diff -Nru a/arch/i386/kernel/timers/timer.c b/arch/i386/kernel/timers/timer.c
--- a/arch/i386/kernel/timers/timer.c Mon Jan 5 14:09:26 2004
+++ b/arch/i386/kernel/timers/timer.c Mon Jan 5 14:09:26 2004
@@ -43,21 +43,40 @@
cur_timer = &timer_pit;
}

-/* iterates through the list of timers, returning the first
- * one that initializes successfully.
+/* helper function to iterates through the list of timers,
+ * returning the first one that initializes successfully.
*/
-struct timer_opts* select_timer(void)
+static struct timer_opts* pick_timer(char* override)
{
int i = 0;

/* find most preferred working timer */
while (timers[i]) {
if (timers[i]->init)
- if (timers[i]->init(clock_override) == 0)
+ if (timers[i]->init(override) == 0)
return timers[i];
++i;
}
-
- panic("select_timer: Cannot find a suitable timer\n");
return NULL;
+}
+
+struct timer_opts* select_timer(void)
+{
+ struct timer_opts* ret;
+
+ /* pick the best time source*/
+ ret = pick_timer(clock_override);
+
+ /* if we didn't find anything, try without the override */
+ if (!ret && clock_override) {
+ printk("Warning: 'clock=%s' override failed.\n", clock_override);
+ ret = pick_timer(NULL);
+ }
+
+ /* if we still didn't find anything, we're ruined */
+ /* note that this won't happen, as the PIT always succeeds*/
+ if (!ret)
+ panic("select_timer: Cannot find a suitable timer\n");
+
+ return ret;
}
diff -Nru a/arch/i386/kernel/timers/timer_pit.c b/arch/i386/kernel/timers/timer_pit.c
--- a/arch/i386/kernel/timers/timer_pit.c Mon Jan 5 14:09:26 2004
+++ b/arch/i386/kernel/timers/timer_pit.c Mon Jan 5 14:09:26 2004
@@ -24,7 +24,7 @@
{
/* check clock override */
if (override[0] && strncmp(override,"pit",3))
- printk(KERN_ERR "Warning: clock= override failed. Defaulting to PIT\n");
+ return -ENODEV;

count_p = LATCH;
return 0;

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

\
 
 \ /
  Last update: 2005-03-22 13:59    [W:0.133 / U:0.696 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site