public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* floppy driver assumes INITIAL_JIFFIES == 0
@ 2010-06-03 17:15 Stephen Hemminger
  2010-06-03 17:28 ` Linus Torvalds
  0 siblings, 1 reply; 16+ messages in thread
From: Stephen Hemminger @ 2010-06-03 17:15 UTC (permalink / raw)
  To: Andrew Morton, Alan Cox, Linus Torvalds; +Cc: linux-kernel

The ancient and crufty floppy driver has some serious problems if
used during the boot process. It will miss data, and cause OOPS
because of callback routines called in unexpected contexts.
All this goes away if INITIAL_JIFFIES is 0 as it was when this
driver was written.

The root cause of all this is lots of places that assume the initial
jiffies value is 0.  Examples:

floppy_open:
    if (!(mode & FMODE_NDELAY)) {
		if (mode & (FMODE_READ|FMODE_WRITE)) {
			UDRS->last_checked = 0;

start_motor:
	if (!(raw_cmd->flags & FD_RAW_NO_MOTOR)) {
		if (!(FDCS->dor & (0x10 << UNIT(current_drive)))) {
			set_debugt();
			/* no read since this drive is running */
			DRS->first_read_date = 0;

and the relationship between select_date and select_delay.

The driver is a complex mess of spaghetti state. Does one of the original
authors have more background to fix this?

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2010-06-09  5:32 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-03 17:15 floppy driver assumes INITIAL_JIFFIES == 0 Stephen Hemminger
2010-06-03 17:28 ` Linus Torvalds
2010-06-03 19:03   ` Stephen Hemminger
2010-06-03 19:56     ` Linus Torvalds
2010-06-03 20:59       ` Linus Torvalds
2010-06-03 21:49         ` Stephen Hemminger
2010-06-03 21:58           ` Linus Torvalds
2010-06-03 22:33             ` Linus Torvalds
2010-06-03 22:54               ` Stephen Hemminger
2010-06-03 23:09                 ` Linus Torvalds
2010-06-03 23:15               ` Stephen Hemminger
2010-06-03 23:21                 ` Linus Torvalds
2010-06-09  5:32                   ` Stephen Hemminger
2010-06-03 22:32   ` Andreas Mohr
2010-06-03 22:40     ` Linus Torvalds
2010-06-04 15:12       ` Nick Bowler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox