Re: 2.6.27-rc5 doesn't boot on a Pavilion laptop

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Thomas Gleixner
Date: Wednesday, September 3, 2008 - 10:05 am

On Wed, 3 Sep 2008, Dmitry Nezhevenko wrote:

Yeah, noticed already. Sorry.

Find a debug patch below, which looks at the two functions which might
loop forver under certain conditions. Does one of the checks hit ?

Thanks,

	tglx
---
 kernel/time/tick-broadcast.c |   17 +++++++++++++++--
 kernel/time/tick-oneshot.c   |   13 +++++++++++++
 2 files changed, 28 insertions(+), 2 deletions(-)

Index: linux-2.6/kernel/time/tick-broadcast.c
===================================================================
--- linux-2.6.orig/kernel/time/tick-broadcast.c
+++ linux-2.6/kernel/time/tick-broadcast.c
@@ -373,14 +373,27 @@ static int tick_broadcast_set_event(ktim
 {
 	struct clock_event_device *bc = tick_broadcast_device.evtdev;
 	ktime_t now = ktime_get();
-	int res;
+	static int once = 0;
+	int res, i;
 
-	for(;;) {
+	for(i = 0; ; i++) {
 		res = clockevents_program_event(bc, expires, now);
 		if (!res || !force)
 			return res;
 		now = ktime_get();
 		expires = ktime_add(now, ktime_set(0, bc->min_delta_ns));
+		if (i++ > 4) {
+			if (!once) {
+				printk(KERN_WARNING
+				       "tick_broadcast_set_event is "
+				       "stuck %llx %llx\n",
+				       now.tv64, expires.tv64);
+				WARN_ON(1);
+			}
+			/* Enforce it */
+			now = ktime_get();
+			expires = ktime_add_ns(now, bc->min_delta_ns << i);
+		}
 	}
 }
 
Index: linux-2.6/kernel/time/tick-oneshot.c
===================================================================
--- linux-2.6.orig/kernel/time/tick-oneshot.c
+++ linux-2.6/kernel/time/tick-oneshot.c
@@ -29,6 +29,8 @@ static int __tick_program_event(struct c
 				ktime_t expires, int force)
 {
 	ktime_t now = ktime_get();
+	static int once = 0;
+	int i = 0;
 
 	while (1) {
 		int ret = clockevents_program_event(dev, expires, now);
@@ -37,6 +39,17 @@ static int __tick_program_event(struct c
 			return ret;
 		now = ktime_get();
 		expires = ktime_add(now, ktime_set(0, dev->min_delta_ns));
+		if (i++ > 4) {
+			if (!once) {
+				printk(KERN_WARNING "__tick_program_event is "
+				       "stuck %llx %llx\n",
+				       now.tv64, expires.tv64);
+				WARN_ON(1);
+			}
+			/* Enforce it */
+			now = ktime_get();
+			expires = ktime_add_ns(now, dev->min_delta_ns << i);
+		}
 	}
 }
 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
2.6.27-rc5 doesn't boot on a Pavilion laptop, Luiz Fernando N. Cap ..., (Tue Sep 2, 12:35 pm)
Re: 2.6.27-rc5 doesn't boot on a Pavilion laptop, Thomas Gleixner, (Tue Sep 2, 1:18 pm)
Re: 2.6.27-rc5 doesn't boot on a Pavilion laptop, Diego Woitasen, (Tue Sep 2, 1:40 pm)
Re: 2.6.27-rc5 doesn't boot on a Pavilion laptop, Luiz Fernando N. Cap ..., (Tue Sep 2, 1:55 pm)
Re: 2.6.27-rc5 doesn't boot on a Pavilion laptop, Thomas Gleixner, (Wed Sep 3, 3:04 am)
Re: 2.6.27-rc5 doesn't boot on a Pavilion laptop, Luiz Fernando N. Cap ..., (Wed Sep 3, 6:38 am)
Re: 2.6.27-rc5 doesn't boot on a Pavilion laptop, Luiz Fernando N. Cap ..., (Wed Sep 3, 6:41 am)
Re: 2.6.27-rc5 doesn't boot on a Pavilion laptop, Thomas Gleixner, (Wed Sep 3, 7:36 am)
Re: 2.6.27-rc5 doesn't boot on a Pavilion laptop, Thomas Gleixner, (Wed Sep 3, 8:15 am)
Re: 2.6.27-rc5 doesn't boot on a Pavilion laptop, Luiz Fernando N. Cap ..., (Wed Sep 3, 9:38 am)
Re: 2.6.27-rc5 doesn't boot on a Pavilion laptop, Luiz Fernando N. Cap ..., (Wed Sep 3, 9:40 am)
Re: 2.6.27-rc5 doesn't boot on a Pavilion laptop, Dmitry Nezhevenko, (Wed Sep 3, 9:44 am)
Re: 2.6.27-rc5 doesn't boot on a Pavilion laptop, Thomas Gleixner, (Wed Sep 3, 10:05 am)
Re: 2.6.27-rc5 doesn't boot on a Pavilion laptop, Luiz Fernando N. Cap ..., (Wed Sep 3, 10:36 am)
Re: 2.6.27-rc5 doesn't boot on a Pavilion laptop, Dmitry Nezhevenko, (Wed Sep 3, 10:54 am)
Re: 2.6.27-rc5 doesn't boot on a Pavilion laptop, Thomas Gleixner, (Wed Sep 3, 11:40 am)
Re: 2.6.27-rc5 doesn't boot on a Pavilion laptop, Thomas Gleixner, (Wed Sep 3, 11:58 am)
Re: 2.6.27-rc5 doesn't boot on a Pavilion laptop, Dmitry Nezhevenko, (Wed Sep 3, 12:01 pm)
Re: 2.6.27-rc5 doesn't boot on a Pavilion laptop, Luiz Fernando N. Cap ..., (Wed Sep 3, 12:07 pm)
Re: 2.6.27-rc5 doesn't boot on a Pavilion laptop, Thomas Gleixner, (Wed Sep 3, 12:08 pm)
Re: 2.6.27-rc5 doesn't boot on a Pavilion laptop, Thomas Gleixner, (Wed Sep 3, 12:10 pm)
Re: 2.6.27-rc5 doesn't boot on a Pavilion laptop, Dmitry Nezhevenko, (Wed Sep 3, 12:21 pm)
Re: 2.6.27-rc5 doesn't boot on a Pavilion laptop, Thomas Gleixner, (Wed Sep 3, 12:35 pm)
Re: 2.6.27-rc5 doesn't boot on a Pavilion laptop, Luiz Fernando N. Cap ..., (Wed Sep 3, 12:36 pm)