diff options
| author | bouyer <bouyer@NetBSD.org> | 1999-07-30 14:59:10 +0000 |
|---|---|---|
| committer | bouyer <bouyer@NetBSD.org> | 1999-07-30 14:59:10 +0000 |
| commit | 2917356cae7bf6b05dc0d5199edfdbca6a74974d (patch) | |
| tree | ac96fa6974e05ccfa7c62c48594377d59d2d661a /sys/dev | |
| parent | c1f203f8b5cda0b0e7e45cb0c3e6589850b42d34 (diff) | |
Guard tsleep() with a while (!(wdc_c->flags & AT_DONE)) {}, as suggested by
Constantine Sapuntzakis confirmed by Bill Sommerfeld. Although nothing is
supposed to call wakeup on this without setting AT_DONE, it's good practice to
do it this way (the process may be waken up by a setrunnable() call).
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/ic/wdc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/ic/wdc.c b/sys/dev/ic/wdc.c index 5983bfb4834..2dc11adc4f3 100644 --- a/sys/dev/ic/wdc.c +++ b/sys/dev/ic/wdc.c @@ -1,4 +1,4 @@ -/* $NetBSD: wdc.c,v 1.68 1999/06/23 19:00:17 bouyer Exp $ */ +/* $NetBSD: wdc.c,v 1.69 1999/07/30 14:59:10 bouyer Exp $ */ /* @@ -1019,7 +1019,9 @@ wdc_exec_command(drvp, wdc_c) ret = WDC_COMPLETE; } else { if (wdc_c->flags & AT_WAIT) { - tsleep(wdc_c, PRIBIO, "wdccmd", 0); + while ((wdc_c->flags & AT_DONE) == 0) { + tsleep(wdc_c, PRIBIO, "wdccmd", 0); + } ret = WDC_COMPLETE; } else { ret = WDC_QUEUED; |
