diff options
author | John Baldwin <jhb@FreeBSD.org> | 2007-02-23 16:25:08 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2007-02-23 16:25:08 +0000 |
commit | a96255b62d488d4d2f532e64a74cc99571aacbd8 (patch) | |
tree | e93bd90cb35a83882bef6ca2e41bbf03c4c5a077 /sys/dev/ata | |
parent | 37e80fcac22c6734bcdb79e160bc1eac56740c4c (diff) |
Use 'pause' in several places rather than trying to tsleep() on NULL (which
triggers a KASSERT) or local variables. In the case of kern_ndis, the
tsleep() actually used a common sleep address (curproc) making it
susceptible to a premature wakeup.
Notes
Notes:
svn path=/head/; revision=166909
Diffstat (limited to 'sys/dev/ata')
-rw-r--r-- | sys/dev/ata/ata-all.c | 6 | ||||
-rw-r--r-- | sys/dev/ata/atapi-cd.c | 6 | ||||
-rw-r--r-- | sys/dev/ata/atapi-tape.c | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c index 39c1dd6ec723..0818f9b8c822 100644 --- a/sys/dev/ata/ata-all.c +++ b/sys/dev/ata/ata-all.c @@ -122,7 +122,7 @@ ata_attach(device_t dev) /* reset the controller HW, the channel and device(s) */ while (ATA_LOCKING(dev, ATA_LF_LOCK) != ch->unit) - tsleep(&error, PRIBIO, "ataatch", 1); + pause("ataatch", 1); ATA_RESET(dev); ATA_LOCKING(dev, ATA_LF_UNLOCK); @@ -196,7 +196,7 @@ ata_reinit(device_t dev) /* poll for locking the channel */ while (ATA_LOCKING(dev, ATA_LF_LOCK) != ch->unit) - tsleep(&dev, PRIBIO, "atarini", 1); + pause("atarini", 1); /* catch eventual request in ch->running */ mtx_lock(&ch->state_mtx); @@ -824,7 +824,7 @@ ata_udelay(int interval) if (1 || interval < (1000000/hz) || ata_delayed_attach) DELAY(interval); else - tsleep(&interval, PRIBIO, "ataslp", interval/(1000000/hz)); + pause("ataslp", interval/(1000000/hz)); } char * diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c index 0dd7cd8e9bf9..beb7667a9324 100644 --- a/sys/dev/ata/atapi-cd.c +++ b/sys/dev/ata/atapi-cd.c @@ -710,7 +710,7 @@ acd_geom_access(struct g_provider *pp, int dr, int dw, int de) request->u.atapi.sense.key == 7) && request->u.atapi.sense.asc == 4 && request->u.atapi.sense.ascq == 1) - tsleep(&timeout, PRIBIO, "acdld", hz / 2); + pause("acdld", hz / 2); else break; } @@ -1095,7 +1095,7 @@ acd_fixate(device_t dev, int multisession) /* some drives just return ready, wait for the expected fixate time */ if ((error = acd_test_ready(dev)) != EBUSY) { timeout = timeout / (cdp->cap.cur_write_speed / 177); - tsleep(&error, PRIBIO, "acdfix", timeout * hz / 2); + pause("acdfix", timeout * hz / 2); return acd_test_ready(dev); } @@ -1104,7 +1104,7 @@ acd_fixate(device_t dev, int multisession) return error; if ((error = acd_test_ready(dev)) != EBUSY) return error; - tsleep(&error, PRIBIO, "acdcld", hz / 2); + pause("acdcld", hz / 2); } return EIO; } diff --git a/sys/dev/ata/atapi-tape.c b/sys/dev/ata/atapi-tape.c index 12a9ce10b4ee..360e0068886b 100644 --- a/sys/dev/ata/atapi-tape.c +++ b/sys/dev/ata/atapi-tape.c @@ -612,7 +612,7 @@ ast_load_unload(device_t dev, u_int8_t function) error = ata_atapicmd(dev, ccb, NULL, 0, 0, 10); if (error) return error; - tsleep((caddr_t)&error, PRIBIO, "astlu", 1 * hz); + pause("astlu", 1 * hz); if (function == ATAPI_SS_EJECT) return 0; return ast_wait_dsc(dev, 60*60); @@ -665,7 +665,7 @@ ast_wait_dsc(device_t dev, int timeout) error = ata_atapicmd(dev, ccb, NULL, 0, 0, 0); if (error != EBUSY) break; - tsleep(&error, PRIBIO, "atpwt", hz / 2); + pause("atpwt", hz / 2); timeout -= (hz / 2); } return error; |