From eu@grosbein.pp.ru  Tue Oct 10 15:41:57 2006
Return-Path: <eu@grosbein.pp.ru>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 46B5716A407;
	Tue, 10 Oct 2006 15:41:57 +0000 (UTC)
	(envelope-from eu@grosbein.pp.ru)
Received: from grosbein.pp.ru (grgw.svzserv.kemerovo.su [213.184.64.166])
	by mx1.FreeBSD.org (Postfix) with ESMTP id C360F43D4C;
	Tue, 10 Oct 2006 15:41:52 +0000 (GMT)
	(envelope-from eu@grosbein.pp.ru)
Received: from grosbein.pp.ru (localhost [127.0.0.1])
	by grosbein.pp.ru (8.13.8/8.13.8) with ESMTP id k9AFfjGm001685;
	Tue, 10 Oct 2006 23:41:45 +0800 (KRAST)
	(envelope-from eu@grosbein.pp.ru)
Received: (from root@localhost)
	by grosbein.pp.ru (8.13.8/8.13.8/Submit) id k9AFfiEO001684;
	Tue, 10 Oct 2006 23:41:44 +0800 (KRAST)
	(envelope-from eu)
Message-Id: <200610101541.k9AFfiEO001684@grosbein.pp.ru>
Date: Tue, 10 Oct 2006 23:41:44 +0800 (KRAST)
From: Eugene Grosbein <eugen@grosbein.pp.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc: sos@freebsd.org
Subject: [patch] [atapicd] burncd failure due to acd_get_progress() misbehavour (regression)
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         104270
>Category:       kern
>Synopsis:       [acd] [patch] burncd failure due to acd_get_progress() misbehavour (regression)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    sos
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 10 15:50:20 GMT 2006
>Closed-Date:    Thu Dec 06 09:00:05 UTC 2007
>Last-Modified:  Thu Dec  6 14:40:01 UTC 2007
>Originator:     Eugene Grosbein
>Release:        FreeBSD 6.2-PRERELEASE i386
>Organization:
Svyaz Service JSC
>Environment:
System: FreeBSD grosbein.pp.ru 6.2-PRERELEASE FreeBSD 6.2-PRERELEASE #0: Tue Oct 10 22:01:23 KRAST 2006 eu@grosbein.pp.ru:/mnt/home/obj/usr/local/src/sys/DADV i386
	acd0: DVDR <NEC DVD RW ND-3500AG/2.18>

>Description:
	I've dual boot machine with FreeBSD 4.11-STABLE and 6.2-PRERELEASE,
	later is built using today's sources.

	burncd blank for CD-RW works fine with 4.11, it shows progress status
	and finishes after 100%.

	In 6.2, it does not show percents and sleeps forever.

	It uses CDRIOCGETPROGRESS ioctl to get progress status from
	the kernel. This ioctl is processed with acd_get_progress()
	function that throws away progress status obtained
	from the drive unless request->u.atapi.sense.error contains
	highest bit set (0x80). For my drive, it equals to 0x70
	during blanking process and becomes zero after finishing
	so atapicd's logic failt to return correct data to userland.

>How-To-Repeat:
	Take NEC DVD RW ND-3500AG/2.18 and try to blank CD-RW with burncd.

>Fix:

	Preliminary patch that makes burncd work for me:

--- atapi-cd.c.orig	Fri Sep 29 21:05:26 2006
+++ atapi-cd.c	Tue Oct 10 23:27:23 2006
@@ -1234,7 +1234,7 @@
     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)
+    if (!request->error && request->u.atapi.sense.error)
 	*finished = ((request->u.atapi.sense.specific2 |
 		     (request->u.atapi.sense.specific1 << 8)) * 100) / 65535;
     else



	I've failed to find the reason for checking highest bit
	of u.atapi.sense.error, this check fails for me so I've removed it.

Eugene Grosbein
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->sos 
Responsible-Changed-By: ru 
Responsible-Changed-When: Wed Oct 11 09:58:34 UTC 2006 
Responsible-Changed-Why:  
I have similar issues, with different burners.  This is indeed 
annoying, but I'm sure Soren can quickly sort that out.  ;-) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=104270 

From: Eugene Grosbein <eugen@grosbein.pp.ru>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: kern/104270: [acd] [patch] burncd failure due to acd_get_progress() misbehavour (regression)
Date: Sat, 3 Nov 2007 03:48:13 +0700

 Hi!
 
 The problem was fixed for HEAD in src/sys/dev/ata/atapi-cd.c,v1.191
 before RELENG_7 was branched. But fix has not been MFC'd to RELENG_6
 nor to RELENG_5 yet. That's pretty simple patch, please MFC it.
 The regression has quite long history, it's here since RELENG_5.
 
 Eugene Grosbein
State-Changed-From-To: open->closed 
State-Changed-By: roberto 
State-Changed-When: Thu Dec 6 08:59:44 UTC 2007 
State-Changed-Why:  
Reportedly fixed in CURRENT before branching 7 and it has been merge into  
RELENG_6 as well. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=104270 

From: Eugene Grosbein <eugen@grosbein.pp.ru>
To: bug-followup@freebsd.org
Cc: roberto@freebsd.org, remko@freebsd.org
Subject: Re: kern/104270: [acd] [patch] burncd failure due to acd_get_progress() misbehavour (regression)
Date: Thu, 6 Dec 2007 21:14:49 +0700

 Hi!
 
 This PR should be closed now as resolved (see followups to
 http://www.freebsd.org/cgi/query-pr.cgi?pr=83702), as well as
 kern/109270 and others the latter PR refers to.
 
 Eugene Grosbein

From: Ollivier Robert <roberto@keltia.freenix.fr>
To: Eugene Grosbein <eugen@grosbein.pp.ru>
Cc: bug-followup@freebsd.org, remko@freebsd.org
Subject: Re: kern/104270: [acd] [patch] burncd failure due to
	acd_get_progress() misbehavour (regression)
Date: Thu, 6 Dec 2007 15:18:59 +0100

 According to Eugene Grosbein:
 > This PR should be closed now as resolved (see followups to
 > http://www.freebsd.org/cgi/query-pr.cgi?pr=83702), as well as
 > kern/109270 and others the latter PR refers to.
 
 I've closed both 83702 & 104270.  Can you confirm I can close 109270 as
 well?
 -- 
 Ollivier ROBERT -=- FreeBSD: The Power to Serve! -=- roberto@keltia.freenix.fr
 Darwin sidhe.keltia.net Version 8.10.1: Wed May 23 16:33:00 PDT 2007 i386
>Unformatted:
