From luoqi@luoqi.watermarkgroup.com  Tue Nov 26 14:29:31 1996
Received: from who.cdrom.com (who.cdrom.com [204.216.27.3])
          by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id OAA02028
          for <FreeBSD-gnats-submit@FreeBSD.org>; Tue, 26 Nov 1996 14:29:30 -0800 (PST)
Received: from mail.crl.com (mail.crl.com [165.113.1.22])
          by who.cdrom.com (8.7.5/8.6.11) with SMTP id MAA13354
          for <FreeBSD-gnats-submit@freebsd.org>; Tue, 26 Nov 1996 12:47:11 -0800 (PST)
Received: from luoqi.watermarkgroup.com (ppp-3.ts-1.ptn.idt.net) by mail.crl.com with SMTP id AA05992
  (5.65c/IDA-1.5 for <FreeBSD-gnats-submit@freebsd.org>); Tue, 26 Nov 1996 12:46:43 -0800
Received: (from luoqi@localhost) by luoqi.watermarkgroup.com (8.7.5/8.6.12) id PAA14041; Tue, 26 Nov 1996 15:43:23 -0500 (EST)
Message-Id: <199611262043.PAA14041@luoqi.watermarkgroup.com>
Date: Tue, 26 Nov 1996 15:43:23 -0500 (EST)
From: luoqi@watermarkgroup.com
Reply-To: luoqi@watermarkgroup.com
To: FreeBSD-gnats-submit@FreeBSD.org
Subject: Bug fix: wcd driver may hang under certain condition
X-Send-Pr-Version: 3.2

>Number:         2108
>Category:       i386
>Synopsis:       [ATAPI] wcd driver may hang under certain condition
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    luoqi
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov 26 14:30:08 PST 1996
>Closed-Date:    Mon Apr 19 11:44:39 PDT 1999
>Last-Modified:  Mon Apr 19 11:45:28 PDT 1999
>Originator:     Luoqi Chen
>Release:        FreeBSD 2.1-STABLE i386
>Organization:
>Environment:

	

>Description:

	
	In isa/atapi.c, function atapi_request_wait may sleep
	indefinitely if the request fails immediately (e.g.
	timeout waiting for command phase while a CD is inserted
	into the drive).

>How-To-Repeat:

	
	Start xcdplayer (available from ports/audio) with CD in drive,
	eject the CD, insert a new one. Xcdplayer process will hang
	99% of the time.

>Fix:
	
	
	Apply the following patch to isa/atapi.c:

*** atapi.c.orig	Fri Oct 25 00:28:58 1996
--- atapi.c	Fri Oct 25 01:55:03 1996
***************
*** 788,794 ****
  			ac->cmd[13], ac->cmd[14], ac->cmd[15], count);
  	atapi_enqueue (ata, ac);
  	wdstart (ata->ctrlr);
! 	tsleep ((caddr_t)ac, PRIBIO, "atareq", 0);
  
  	result = ac->result;
  	atapi_free (ata, ac);
--- 788,795 ----
  			ac->cmd[13], ac->cmd[14], ac->cmd[15], count);
  	atapi_enqueue (ata, ac);
  	wdstart (ata->ctrlr);
! 	if (ac == ata->queue)
! 		tsleep ((caddr_t)ac, PRIBIO, "atareq", 0);
  
  	result = ac->result;
  	atapi_free (ata, ac);

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->sos 
Responsible-Changed-By: mpp 
Responsible-Changed-When: Tue Feb 25 22:12:50 PST 1997 
Responsible-Changed-Why:  
Atapi problem. 
State-Changed-From-To: open->closed 
State-Changed-By: sheldonh 
State-Changed-When: Mon Mar 29 17:03:12 PST 1999 
State-Changed-Why:  
Originator is now a committer. 
State-Changed-From-To: closed->open 
State-Changed-By: sheldonh 
State-Changed-When: Mon Mar 29 17:03:50 PST 1999 
State-Changed-Why:  
Sorry, closed in error. 


Responsible-Changed-From-To: sos->luoqi 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Mon Mar 29 17:03:50 PST 1999 
Responsible-Changed-Why:  
Originator is now a committer. :-) 
State-Changed-From-To: open->closed 
State-Changed-By: luoqi 
State-Changed-When: Mon Apr 19 11:44:39 PDT 1999 
State-Changed-Why:  
Fix committed. 
>Unformatted:
