From ian@suntzu.apdata.com.au  Wed Apr  8 23:14:12 1998
Received: from suntzu.apdata.com.au (slug.apdata.com.au [202.14.95.202])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA26911
          for <FreeBSD-gnats-submit@freebsd.org>; Wed, 8 Apr 1998 23:14:04 -0700 (PDT)
          (envelope-from ian@suntzu.apdata.com.au)
Received: (from root@localhost)
	by suntzu.apdata.com.au (8.8.8/8.8.7) id GAA00716;
	Thu, 9 Apr 1998 06:13:52 GMT
	(envelope-from ian)
Message-Id: <199804090613.GAA00716@suntzu.apdata.com.au>
Date: Thu, 9 Apr 1998 06:13:52 GMT
From: ian@apdata.com.au
Reply-To: ian@apdata.com.au
To: FreeBSD-gnats-submit@freebsd.org
Subject: ide cdrom hangs system when on same bus as ide zip drive
X-Send-Pr-Version: 3.2

>Number:         6252
>Category:       kern
>Synopsis:       ide cdrom hangs system when on same bus as ide zip drive
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    sos
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr  8 23:20:01 PDT 1998
>Closed-Date:    Tue Nov 14 00:35:13 PST 2000
>Last-Modified:  Tue Nov 14 00:36:25 PST 2000
>Originator:     Ian West
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
Applied Data Control
>Environment:
 Pentium II machine, 128M of memory, tested with a customised
 kernel, and with a standard kernel.
>Description:
 When ide cdrom (panasonic 24x) and ide zip drive (iomega) are on same
 ide bus, accessing the cdrom hangs the system completely. It is not
 possible to cleanly stop the system in this state. The zip drive appears
 to work OK. Both drives work fine under win-95 and win-nt. Both drives
 are correctly detected and identified during boot, including identifying
 that media is loaded in cdrom drive.
>How-To-Repeat:
 Problem is consistent, fails all the time when cdrom and zip drive are both
 present in the system.
>Fix:
 No known workaround.


>Release-Note:
>Audit-Trail:

From: Brian Feldman <green@feldman.dyn.ml.org>
To: freebsd-gnats-submit@freebsd.org, ian@apdata.com.au
Cc:  Subject: Re: kern/6252: ide cdrom hangs system when on same bus as ide zip drive
Date: Fri, 10 Apr 1998 16:11:09 -0400

 As a rule, this happens on my system quite a bit as well, only
 difference being cd-rom is on the same controller as one of the hard
 drives (being on a separate one seems not to make a difference).
 
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Brian Feldman						green@feldman.dyn.ml.org
 	fortune -o: "Nuke the gay, unborn, baby whales for Jesus."
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

From: Ian West <ian@damocles.apdata.com.au>
To: freebsd-gnats-submit@freebsd.org
Cc:  Subject: Re: kern/6252: ide cdrom hangs system when on same bus as ide zip drive
Date: Sat, 18 Apr 1998 14:13:37 +0930 (CST)

 I have isolated this problem, and have fixed it on my machine. It is
 due to only a single state variable being kept for the ide channel to
 determine the ability of the drive to do an interupt during the command
 phase of a transaction (intrcmd). If one of your devices can, and the
 other cannot, then the one that cannot will always hang the system when
 accessed. My solution to this, which may well not be the best one :-)
 is to keep an array of two variables, one for each drive. This has been
 running flawlessly for a week or so now, and may be of some use. The
 following patches are applied against 3.0 current, but as far as I can
 see, should work anywhere with a few changes. They are pretty simple.
 atapi.h and atapi.c need to be changed very slightly.
 
 ======================================================================
 *** atapi.h	Sun Mar  1 18:57:29 1998
 --- /root/atapi.h	Sat Apr 11 11:24:07 1998
 ***************
 *** 241,249 ****
   struct atapi {                          /* ATAPI controller data */
   	u_short          port;          /* i/o port base */
   	u_char           ctrlr;         /* physical controller number */
   	u_char           debug : 1;     /* trace enable flag */
   	u_char           cmd16 : 1;     /* 16-byte command flag */
 - 	u_char           intrcmd : 1;   /* interrupt before cmd flag */
   	u_char           slow : 1;      /* slow reaction device */
   	u_char           use_dsc : 1;	/* use DSC completition handeling */
   	u_char		 wait_for_dsc : 1;
 --- 241,249 ----
   struct atapi {                          /* ATAPI controller data */
   	u_short          port;          /* i/o port base */
   	u_char           ctrlr;         /* physical controller number */
 + 	u_char           intrcmd[2];	/* interrupt before cmd flag */
   	u_char           debug : 1;     /* trace enable flag */
   	u_char           cmd16 : 1;     /* 16-byte command flag */
   	u_char           slow : 1;      /* slow reaction device */
   	u_char           use_dsc : 1;	/* use DSC completition handeling */
   	u_char		 wait_for_dsc : 1;
 ======================================================================
 *** atapi.c	Sun Mar  1 18:57:27 1998
 --- /root/atapi.c	Sat Apr 11 11:24:07 1998
 ***************
 *** 218,229 ****
   	/* DRQ type */
   	switch (ap->drqtype) {
   	case AT_DRQT_MPROC: ata->slow = 1; break;
 ! 	case AT_DRQT_INTR:  printf (", intr"); ata->intrcmd = 1; break;
   	case AT_DRQT_ACCEL: printf (", accel"); break;
   	default:            printf (", drq%d", ap->drqtype);
   	}
   	if (ata->slow)
 ! 		ata->intrcmd = 0;
   
   	/* overlap operation supported */
   	if (ap->ovlapflag)
 --- 218,229 ----
   	/* DRQ type */
   	switch (ap->drqtype) {
   	case AT_DRQT_MPROC: ata->slow = 1; break;
 ! 	case AT_DRQT_INTR:  printf (", intr"); ata->intrcmd[unit] = 1; break;
   	case AT_DRQT_ACCEL: printf (", accel"); break;
   	default:            printf (", drq%d", ap->drqtype);
   	}
   	if (ata->slow)
 ! 		ata->intrcmd[unit] = 0;
   
   	/* overlap operation supported */
   	if (ap->ovlapflag)
 ***************
 *** 575,582 ****
   		atapi_done (ata);
   		goto again;
   	}
 ! 
 ! 	if (ata->intrcmd)
   		/* Wait for interrupt before sending packet command */
   		return (1);
   
 --- 575,581 ----
   		atapi_done (ata);
   		goto again;
   	}
 ! 	if (ata->intrcmd[ac->unit])
   		/* Wait for interrupt before sending packet command */
   		return (1);
   
 ***************
 *** 632,638 ****
   int atapi_wait_cmd (struct atapi *ata, struct atapicmd *ac)
   {
   	/* Wait for DRQ from 50 usec to 3 msec for slow devices */
 ! 	int cnt = ata->intrcmd ? 10000 : ata->slow ? 3000 : 50;
   	int ireason = 0, phase = 0;
   
   	/* Wait for command phase. */
 --- 631,637 ----
   int atapi_wait_cmd (struct atapi *ata, struct atapicmd *ac)
   {
   	/* Wait for DRQ from 50 usec to 3 msec for slow devices */
 ! 	int cnt = ata->intrcmd[ac->unit] ? 10000 : ata->slow ? 3000 : 50;
   	int ireason = 0, phase = 0;
   
   	/* Wait for command phase. */
 ======================================================================
State-Changed-From-To: open->feedback 
State-Changed-By: johan 
State-Changed-When: Mon Aug 21 06:08:20 PDT 2000 
State-Changed-Why:  
Is this still a problem with our new ATA driver? 
Please try with a newer release of FreeBSD 
for example 4.1-RELEASE and report back to 
'freebsd-gnats-submit@freebsd.org' with the same subject  
as this mail wheter it works now or not. 


Responsible-Changed-From-To: freebsd-bugs->sos 
Responsible-Changed-By: johan 
Responsible-Changed-When: Mon Aug 21 06:08:20 PDT 2000 
Responsible-Changed-Why:  
Over to ATA maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=6252 
State-Changed-From-To: feedback->closed 
State-Changed-By: sos 
State-Changed-When: Tue Nov 14 00:35:13 PST 2000 
State-Changed-Why:  
This is outdated, please upgreade your  system. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=6252 
>Unformatted:
