Subject: Bare tsleep in dev/ic/wdc.c
To: None <tech-kern@netbsd.org>
From: Constantine Sapuntzakis <csapuntz@stanford.edu>
List: tech-kern
Date: 07/17/1999 12:42:35
From wdc.c, around line 1021:

		if (wdc_c->flags & AT_WAIT) {
			tsleep(wdc_c, PRIBIO, "wdccmd", 0);
			ret = WDC_COMPLETE;
		} else {


Shouldn't that be:

		if (wdc_c->flags & AT_WAIT) {
			while (!(wdc_c->flags & AT_DONE)) {
				tsleep(wdc_c, PRIBIO, "wdccmd", 0); 
			}
			ret = WDC_COMPLETE;
		} else {
	
to prevent spurious wakeups from causing premature returns? I ran into
this problem on boot-up.

Cheers,
-Costa