From af5bd99e9ae010bae45cd99c46e117bba4c1d4f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Schmidt?= Date: Mon, 1 May 2000 07:30:28 +0000 Subject: [PATCH] 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*. --- sys/dev/ata/atapi-cd.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c index 81c8ed4922ff..65b2ae50e0b3 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