Re: [PATCH] msleep() with hrtimers

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andrew Morton
Date: Wednesday, November 28, 2007 - 3:29 am

On Fri, 03 Aug 2007 12:37:12 -0600 Jonathan Corbet <corbet@lwn.net> wrote:


This patch (which appears to have got stranded in Thomas's git-hrt tree)
breaks hotplugging of the wireless mouse on my Vaio.

Kinda strange - sometimes things come up and work but more often the
machine simply fails to notice that the mouse was plugged in at all.

It could be a bug in USB...

<gets a sinking feeling>

<looks down-thread>

ah shit, I already reported this bug on August 9 and I just spent an hour
and a half re-finding it.  Thanks, guys.

Anyway, here's a fix which doesn't fix it:


- Don't return from msleep() in state TASK_[UN]INTERRUPTIBLE

- Someone seems to have fallen asleep on the enter key.  Fix.

--- a/kernel/timer.c~git-hrt-fix
+++ a/kernel/timer.c
@@ -1347,7 +1347,6 @@ static struct notifier_block __cpuinitda
 	.notifier_call	= timer_cpu_notify,
 };
 
-
 void __init init_timers(void)
 {
 	int err = timer_cpu_notify(&timers_nb, (unsigned long)CPU_UP_PREPARE,
@@ -1360,9 +1359,6 @@ void __init init_timers(void)
 	open_softirq(TIMER_SOFTIRQ, run_timer_softirq, NULL);
 }
 
-
-
-
 static void do_msleep(unsigned int msecs, struct hrtimer_sleeper *sleeper,
 	int sigs)
 {
@@ -1385,6 +1381,7 @@ static void do_msleep(unsigned int msecs
 		hrtimer_cancel(&sleeper->timer);
 		mode = HRTIMER_MODE_ABS;
 	} while (sleeper->task && !(sigs && signal_pending(current)));
+	set_current_state(TASK_RUNNING);
 }
 
 /**
_


I'll revert it.

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] msleep() with hrtimers, Jonathan Corbet, (Fri Aug 3, 11:37 am)
Re: [PATCH] msleep() with hrtimers, Ingo Molnar, (Fri Aug 3, 11:54 am)
Re: [PATCH] msleep() with hrtimers, Roman Zippel, (Fri Aug 3, 12:19 pm)
Re: [PATCH] msleep() with hrtimers, Arjan van de Ven, (Fri Aug 3, 12:46 pm)
Re: [PATCH] msleep() with hrtimers, Roman Zippel, (Fri Aug 3, 12:58 pm)
Re: [PATCH] msleep() with hrtimers, Arjan van de Ven, (Fri Aug 3, 4:53 pm)
Re: [PATCH] msleep() with hrtimers, Roman Zippel, (Fri Aug 3, 8:00 pm)
Re: [PATCH] msleep() with hrtimers, Arjan van de Ven, (Sat Aug 4, 12:19 pm)
Re: [PATCH] msleep() with hrtimers, Roman Zippel, (Sun Aug 5, 5:09 pm)
Re: [PATCH] msleep() with hrtimers, Arjan van de Ven, (Sun Aug 5, 5:43 pm)
Re: [PATCH] msleep() with hrtimers, Roman Zippel, (Sun Aug 5, 6:03 pm)
Re: [PATCH] msleep() with hrtimers, Arjan van de Ven, (Sun Aug 5, 10:39 pm)
Re: [PATCH] msleep() with hrtimers, Roman Zippel, (Mon Aug 6, 3:03 am)
Re: [PATCH] msleep() with hrtimers, Manu Abraham, (Mon Aug 6, 3:20 am)
Re: [PATCH] msleep() with hrtimers, Arjan van de Ven, (Mon Aug 6, 8:53 am)
Re: [PATCH] msleep() with hrtimers, Manu Abraham, (Tue Aug 7, 3:40 am)
Re: [PATCH] msleep() with hrtimers, Roman Zippel, (Tue Aug 7, 5:45 am)
Re: [PATCH] msleep() with hrtimers, Andrew Morton, (Tue Aug 7, 12:40 pm)
Re: [PATCH] msleep() with hrtimers, Roman Zippel, (Tue Aug 7, 4:16 pm)
Re: [PATCH] msleep() with hrtimers, Andrew Morton, (Tue Aug 7, 4:29 pm)
Re: [PATCH] msleep() with hrtimers, Roman Zippel, (Tue Aug 7, 8:47 pm)
Re: [PATCH] msleep() with hrtimers, Andrew Morton, (Tue Aug 7, 9:14 pm)
Re: [PATCH] msleep() with hrtimers, Arjan van de Ven, (Tue Aug 7, 9:15 pm)
Re: [PATCH] msleep() with hrtimers, Manu Abraham, (Wed Aug 8, 4:09 am)
Re: [PATCH] msleep() with hrtimers, Andi Kleen, (Wed Aug 8, 4:52 am)
Re: [PATCH] msleep() with hrtimers, Andi Kleen, (Wed Aug 8, 4:55 am)
Re: [PATCH] msleep() with hrtimers, Manu Abraham, (Wed Aug 8, 4:59 am)
Re: [PATCH] msleep() with hrtimers, Andrew Morton, (Thu Aug 9, 12:16 am)
Re: [PATCH] msleep() with hrtimers, Denis Vlasenko, (Thu Aug 9, 12:31 pm)
Re: [PATCH] msleep() with hrtimers, Denis Vlasenko, (Thu Aug 9, 1:01 pm)
Re: [PATCH] msleep() with hrtimers, Roman Zippel, (Thu Aug 9, 3:31 pm)
Re: [PATCH] msleep() with hrtimers, Andrew Morton, (Wed Nov 28, 3:29 am)