summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>2000-05-01 07:30:28 +0000
committersos <sos@FreeBSD.org>2000-05-01 07:30:28 +0000
commit385be7ece3ac207e3d01c5e4a3ee1e450f023a80 (patch)
tree7da70b35fc1943cf96bf825726ba39f1faaf3422
parent845340c06253657162c0729aee193bbe0b64fbac (diff)
downloadFreeBSD-src-385be7ece3ac207e3d01c5e4a3ee1e450f023a80.zip
FreeBSD-src-385be7ece3ac207e3d01c5e4a3ee1e450f023a80.tar.gz
Fix for the HP burners (and possibly other broken drives to)
that fails to proberly close the disk. The problem seems to be that the HP burners sometimes return ready when they actually are not, the solution is to not use immediate mode on the closing commands. This is suboptimal for real burners, in that they now hog the ATA bus for possibly minutes, where its really not nessesary, *sigh*.
-rw-r--r--sys/dev/ata/atapi-cd.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c
index 81c8ed4..65b2ae5 100644
--- a/sys/dev/ata/atapi-cd.c
+++ b/sys/dev/ata/atapi-cd.c
@@ -1179,7 +1179,7 @@ acd_start(struct atapi_softc *atp)
devstat_start_transaction(cdp->stats);
atapi_queue_cmd(cdp->atp, ccb, bp->bio_data, count * cdp->block_size,
- (bp->bio_cmd == BIO_READ)?ATPR_F_READ : 0, 30, acd_done, bp);
+ bp->bio_cmd == BIO_READ ? ATPR_F_READ : 0, 30, acd_done,bp);
}
static int32_t
@@ -1358,14 +1358,10 @@ acd_select_slot(struct acd_softc *cdp)
static int32_t
acd_close_disk(struct acd_softc *cdp)
{
- int8_t ccb[16] = { ATAPI_CLOSE_TRACK, 0x01, 0x02, 0, 0, 0, 0, 0,
+ int8_t ccb[16] = { ATAPI_CLOSE_TRACK, 0, 0x02, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0 };
- int32_t error;
- error = atapi_queue_cmd(cdp->atp, ccb, NULL, 0, 0, 10, NULL, NULL);
- if (error)
- return error;
- return atapi_wait_ready(cdp->atp, 10*60);
+ return atapi_queue_cmd(cdp->atp, ccb, NULL, 0, 0, 5*60, NULL, NULL);
}
static int32_t
@@ -1451,14 +1447,10 @@ acd_open_track(struct acd_softc *cdp, struct cdr_track *track)
static int32_t
acd_close_track(struct acd_softc *cdp)
{
- int8_t ccb1[16] = { ATAPI_SYNCHRONIZE_CACHE, 0x02, 0, 0, 0, 0, 0, 0,
+ int8_t ccb[16] = { ATAPI_SYNCHRONIZE_CACHE, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0 };
- int32_t error;
- error = atapi_queue_cmd(cdp->atp, ccb1, NULL, 0, 0, 10, NULL, NULL);
- if (error)
- return error;
- return atapi_wait_ready(cdp->atp, 5*60);
+ return atapi_queue_cmd(cdp->atp, ccb, NULL, 0, 0, 60, NULL, NULL);
}
static int32_t
OpenPOWER on IntegriCloud