The HyperNews Linux KHG Discussion Pages

Does anybody know why kernel wakes my driver up without apparant reasons?

Forum: Device Drivers
Keywords: wake_up interrupt time_out
Date: Wed, 26 Feb 1997 17:02:31 GMT
From: David van Leeuwen <david@tm.tno.nl>

Hi, i've written a device driver for a cdrom device. It's old. I know. But i keep getting compaints that it doesn't work reliably.

It used to work OK in the old 1.3.fourties. Since more modern kernel version, it tended to break more often. Read errors...

I spent days tracking down the bug, it appeared that the driver was woken without an interrupt occurring, or my own time-out causing the wake-up. I was stymied.

Now i posted a message similar to this to the kernel list half a year ago. But i wasn't capable of reading the list (sorry) because i use my e-mail address at work. Apparently, there was some short reaction that my go_to_sleep routine should do something like

	while(!my_interrupt_woke_me)
		sleep_on(&wait)

Why is this? Why does the kernel wake me up if i didn't ask for it (i.e., no interrupt occured and no time-out occurred)

I found out that the sleep_on() could immediately wakeup (i.e., not go to sleep) for many times in a row. I had to hack around by trying to go to sleep up to 100 times, but i am not charmed by the hack.

Does it have to do with the (new?) macros DEVICE_TIMEOUT and TIMEOUT_VALUE that i've _not_ defined (because i wrote it in the KHG 0.5 days...).

Thanks,

---david (david@tm.tno.nl)