Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Mar 1999 16:02:20 +0200 (EET)
From:      "Jukka A. Ukkonen" <jau@jau.tmt.tele.fi>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/10728: WCD driver does not recognize a recovered atapi/ide error
Message-ID:  <199903221402.QAA01971@jau.tmt.tele.fi>

next in thread | raw e-mail | index | archive | help

>Number:         10728
>Category:       kern
>Synopsis:       WCD driver does not recognize a recovered atapi/ide error
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 22 06:10:00 PST 1999
>Closed-Date:
>Last-Modified:
>Originator:     Jukka A. Ukkonen
>Release:        FreeBSD 2.2.8-RELEASE i386
>Organization:
Sonera Ltd. / Internet Services
>Environment:

	FreeBSD 2.2.8-RELEASE based AMD/i486 with an ATAPI/IDE CD drive.

>Description:

	Occasionally the CD drives report a recovered error when the
	requested data is delayed. The driver code failed to recognize
	this situation and returned EIO in vain. By checking `dmesg'
	output the driver generated quite often log entries like these...

		wcd0: i/o error, status=51<ready,opdone,check>, error=30
		wcd0: i/o error, status=51<ready,opdone,check>, error=30
		wcd0: i/o error, status=51<ready,opdone,check>, error=30

	This tended to make e.g. workman sometimes fail to probe the CD
	status, and which time workman assumes there is no longer a CD
	in the drive. When the next status probe succeeded, workman then
	automatically started playing a disc with `automatically play this
	disc' set even though the disc had been previously manually stopped.

>How-To-Repeat:

	Simply start workman on a atapi/ide cd-drive like Mitsumi-FX400
	which occasionally report delayed completion of requested operations,
	insert a CD with `automatically play this disc' set, manually stop
	the disc, and let the disc stay in the drive.
	Sometimes it takes hours for this to happen, sometimes it happens
	in a matter of minutes. Anyhow when the problem occurs, there will
	be a new log entry for a recovered error, and workman will start
	playing the disc all by itself.

>Fix:

	This is a tentative patch, but at least workman no longer re-starts
	playing a stopped disc all by itself.
	I simply made the assumption that a delayed but recovered response
	from the drive is quite as much all right as any normal successful
	response.


--- /sys/i386/isa/wcd.c.old	Sun Mar 14 22:24:49 1999
+++ /sys/i386/isa/wcd.c	Sun Mar 14 22:55:12 1999
@@ -620,7 +620,8 @@
 	result = atapi_request_wait (t->ata, t->unit, cmd,
 		a1, a2, a3, a4, a5, a6, a7, a8, a9, 0, 0, 0, 0, 0, 0,
 		addr, count);
-	if (result.code) {
+	if (result.code
+	    && ((result.error & AER_SKEY) != AER_SK_RECOVERED_ERROR)) {
 		wcd_error (t, result);
 		return (EIO);
 	}
@@ -962,7 +963,8 @@
 			ATAPI_TEST_UNIT_READY, 0, 0, 0, 0, 0, 0, 0, 0,
 			0, 0, 0, 0, 0, 0, 0, 0, 0);
 	}
-	if (result.code) {
+	if (result.code
+	    && ((result.error & AER_SKEY) != AER_SK_RECOVERED_ERROR)) {
 		wcd_error (t, result);
 		return (EIO);
 	}
@@ -1084,7 +1086,8 @@
 		return (0);
 	}
 
-	if (result.code) {
+	if (result.code
+	    && ((result.error & AER_SKEY) != AER_SK_RECOVERED_ERROR)) {
 		wcd_error (t, result);
 		return (EIO);
 	}

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199903221402.QAA01971>