From owner-freebsd-stable@FreeBSD.ORG Mon Dec 25 16:47:45 2006 Return-Path: X-Original-To: stable@freebsd.org Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E10D316A40F for ; Mon, 25 Dec 2006 16:47:45 +0000 (UTC) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.freebsd.org (Postfix) with ESMTP id C485713C480 for ; Mon, 25 Dec 2006 16:47:45 +0000 (UTC) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.11/8.13.6) with ESMTP id kBPGl49A023980; Mon, 25 Dec 2006 08:47:04 -0800 (PST) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.11/8.12.3/Submit) id kBPGl42l023979; Mon, 25 Dec 2006 08:47:04 -0800 (PST) (envelope-from rizzo) Date: Mon, 25 Dec 2006 08:47:04 -0800 From: Luigi Rizzo To: Dmitry Pryanishnikov Message-ID: <20061225084704.A23448@xorpc.icir.org> References: <20061221092717.A6431@xorpc.icir.org> <20061222073857.GA10704@tmn.ru> <20061225165735.M22401@atlantis.atlantis.dp.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20061225165735.M22401@atlantis.atlantis.dp.ua>; from dmitry@atlantis.dp.ua on Mon, Dec 25, 2006 at 05:12:04PM +0200 Cc: stable@freebsd.org Subject: Re: burncd 'blank' not terminating ? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Dec 2006 16:47:46 -0000 On Mon, Dec 25, 2006 at 05:12:04PM +0200, Dmitry Pryanishnikov wrote: > > Hello! > > On Fri, 22 Dec 2006, Sergey N. Voronkov wrote: > >> just noticed, after upgrading to 6.2RC1, that > >> > >> luigi# burncd -f /dev/acd0 -v blank > >> blanking CD, please wait.. > >> > >> stays there forever. Eventually i gave up and ctrl-C and > >> the application terminates, and i was able to write to > >> the disk a valid image, which probably means that the > >> disk had been blanked. > > Yes, well known RELENG_4 -> 6 (maybe even 5) regression. Same here with > > acd0: CDRW at ata1-master UDMA33 > > Worked fine under RELENG_4, fails to wait for completion under RELENG_6. indeed, the two routines are different: in RELENG_4 static int acd_get_progress(struct acd_softc *cdp, int *finished) { int8_t ccb[16] = { ATAPI_READ_CAPACITY, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; struct atapi_reqsense *sense = cdp->device->result; char tmp[8]; if (atapi_test_ready(cdp->device) != EBUSY) { if (atapi_queue_cmd(cdp->device, ccb, tmp, sizeof(tmp), ATPR_F_READ, 30, NULL, NULL) != EBUSY) { *finished = 100; return 0; } } if (sense->sksv) *finished = ((sense->sk_specific2 | (sense->sk_specific1 << 8)) * 100) / 65535; else *finished = 0; return 0; } in RELENG_6 static int acd_get_progress(device_t dev, int *finished) { int8_t ccb[16] = { ATAPI_READ_CAPACITY, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; struct ata_request *request; int8_t dummy[8]; if (!(request = ata_alloc_request())) return ENOMEM; request->dev = dev; bcopy(ccb, request->u.atapi.ccb, 16); request->data = dummy; request->bytecount = sizeof(dummy); request->transfersize = min(request->bytecount, 65534); request->flags = ATA_R_ATAPI | ATA_R_READ; request->timeout = 30; ata_queue_request(request); if (!request->error && request->u.atapi.sense.error & ATA_SENSE_VALID) *finished = ((request->u.atapi.sense.specific2 | (request->u.atapi.sense.specific1 << 8)) * 100) / 65535; else *finished = 0; ata_free_request(request); return 0; } and the wait routine in usr.sbin/burncd/burncd.c is the following: in RELENG_4: while (1) { sleep(1); error = ioctl(fd, CDRIOCGETPROGRESS, &percent); if (percent > 0 && !quiet) fprintf(stderr, "%sing CD - %d %% done \r", blank == CDR_B_ALL ? "eras" : "blank", percent); if (error || percent == 100) break; } in RELENG_6: while (1) { sleep(1); if (ioctl(fd, CDRIOCGETPROGRESS, &pct) == -1) err(EX_IOERR,"ioctl(CDRIOGETPROGRESS)"); if (pct > 0 && !quiet) fprintf(stderr, "%sing CD - %d %% done \r", blank == CDR_B_ALL ? "eras" : "blank", pct); if (pct == 100 || (pct == 0 && last > 90)) break; last = pct; } i think you could try experimenting with the return values of your drive (with the patched atapi-cd.c) in order to find a good way to detect completion of the blank operation cheers luigi