From owner-freebsd-current@FreeBSD.ORG Wed Dec 17 15:16:10 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBB74106567C for ; Wed, 17 Dec 2008 15:16:10 +0000 (UTC) (envelope-from jh@saunalahti.fi) Received: from emh01.mail.saunalahti.fi (emh01.mail.saunalahti.fi [62.142.5.107]) by mx1.freebsd.org (Postfix) with ESMTP id 4A7AB8FC1A for ; Wed, 17 Dec 2008 15:16:10 +0000 (UTC) (envelope-from jh@saunalahti.fi) Received: from saunalahti-vams (vs3-11.mail.saunalahti.fi [62.142.5.95]) by emh01-2.mail.saunalahti.fi (Postfix) with SMTP id 399351B1CB; Wed, 17 Dec 2008 17:00:27 +0200 (EET) Received: from emh04.mail.saunalahti.fi ([62.142.5.110]) by vs3-11.mail.saunalahti.fi ([62.142.5.95]) with SMTP (gateway) id A0281D36125; Wed, 17 Dec 2008 17:00:27 +0200 Received: from a91-153-125-115.elisa-laajakaista.fi (a91-153-125-115.elisa-laajakaista.fi [91.153.125.115]) by emh04.mail.saunalahti.fi (Postfix) with SMTP id 228C441BEE; Wed, 17 Dec 2008 17:00:25 +0200 (EET) Date: Wed, 17 Dec 2008 17:00:25 +0200 From: Jaakko Heinonen To: Alexander Best Message-ID: <20081217150024.GA3156@a91-153-125-115.elisa-laajakaista.fi> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-Antivirus: VAMS Cc: freebsd-current@freebsd.org Subject: Re: (timeout) error during cd fixation X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2008 15:16:10 -0000 Hi, On 2008-12-14, Alexander Best wrote: > as far as i remember this issue (ioctl(CDRIOCFIXATE): Input/output error) has > always been present in burncd (since RELENG4 oder RELENG5). > > i found a PR in feedback state dealing with this problem > (http://www.freebsd.org/cgi/query-pr.cgi?pr=95979&cat=bin). the PR includes a > patch which i applied. however that didn't solve the issue. > > the problem seems to be the timeout variable used in acd_fixate() in > sys/dev/ata/atapi-cd.c. it get's set to: > > int timeout = 5*60*2; > > changing timeout to a higher value doesn't make much of a difference though, > because it gets altered a bit further down in the src. It's divided by burning speed. It seems that the approximation doesn't work very well at higher burning speeds. > that's the reason the > patch didn't fix the issue for me. this is the code where timout gets altered > again: > > /* 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); > pause("acdfix", timeout * hz / 2); > return acd_test_ready(dev); > } > > it seems my drive doesn't return EBUSY, although it's still busy. that's why I think I've found the bug now. Looks like ata_atapicmd() can never really return EBUSY which is expected in acd_fixate(). When acd_test_ready() (ata_atapicmd()) reports correctly the busy state there's no need for use the expected wait time method. I will take a closer look when I have more time. In the mean time could you try this patch? %%% Index: sys/dev/ata/ata-queue.c =================================================================== --- sys/dev/ata/ata-queue.c (revision 186213) +++ sys/dev/ata/ata-queue.c (working copy) @@ -434,7 +434,8 @@ ata_completed(void *context, int dummy) printf("\n"); } - if ((request->u.atapi.sense.key & ATA_SENSE_KEY_MASK ? + if (!request->result && + (request->u.atapi.sense.key & ATA_SENSE_KEY_MASK ? request->u.atapi.sense.key & ATA_SENSE_KEY_MASK : request->error)) request->result = EIO; %%% > dd: /dev/acd0: Input/output error This is unrelated and AFAIK expected. -- Jaakko