From Cy.Schubert@uumail.gov.bc.ca  Sun Aug 13 03:57:37 2000
Return-Path: <Cy.Schubert@uumail.gov.bc.ca>
Received: from point.osg.gov.bc.ca (point.osg.gov.bc.ca [142.32.102.44])
	by hub.freebsd.org (Postfix) with ESMTP id 4093F37B75C
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 13 Aug 2000 03:57:36 -0700 (PDT)
	(envelope-from Cy.Schubert@uumail.gov.bc.ca)
Received: (from daemon@localhost)
	by point.osg.gov.bc.ca (8.8.7/8.8.8) id DAA28275
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 13 Aug 2000 03:57:35 -0700
Received: from passer.osg.gov.bc.ca(142.32.110.29)
 via SMTP by point.osg.gov.bc.ca, id smtpda28273; Sun Aug 13 03:57:32 2000
Received: (from uucp@localhost)
	by passer.osg.gov.bc.ca (8.9.3/8.9.1) id DAA23808
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 13 Aug 2000 03:57:31 -0700 (PDT)
Received: from cwsys9.cwsent.com(10.2.2.1), claiming to be "cwsys.cwsent.com"
 via SMTP by passer9.cwsent.com, id smtpdZ23806; Sun Aug 13 03:56:51 2000
Received: (from cy@localhost)
	by cwsys.cwsent.com (8.11.0/8.9.1) id e7DAup100906;
	Sun, 13 Aug 2000 03:56:51 -0700 (PDT)
Message-Id: <200008131056.e7DAup100906@cwsys.cwsent.com>
Date: Sun, 13 Aug 2000 03:56:51 -0700 (PDT)
From: Cy.Schubert@uumail.gov.bc.ca
Reply-To: Cy.Schubert@uumail.gov.bc.ca
To: FreeBSD-gnats-submit@freebsd.org
Subject: ATA MFC Breaks -STABLE
X-Send-Pr-Version: 3.2

>Number:         20573
>Category:       kern
>Synopsis:       ATA MFC Breaks -STABL
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    sos
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug 13 04:00:01 PDT 2000
>Closed-Date:    Tue Nov 14 00:29:16 PST 2000
>Last-Modified:  Tue Nov 14 00:29:50 PST 2000
>Originator:     Cy Schubert
>Release:        FreeBSD 4.1-RELEASE i386
>Organization:
ITSD Province of BC
>Environment:

FreeBSD cwsys 4.1-RELEASE FreeBSD 4.1-RELEASE #3: Sun Aug 13 03:36:06 PDT 2000     root@cwsys:/usr/opt/cvs-410r/src/sys/compile/CWSYS  i386

... and -stable fetched on June 20.

>Description:

Controller is locked after the following messages:

Aug  8 10:38:41 cwsys /kernel: ata1-master: timeout waiting to give command=c8 s
=d0 e=00
Aug  8 10:38:41 cwsys /kernel: ad2: error executing command

The original error is probably due to a marginal drive, which needs to
be replaced, however -stable prior to June 20 (MFC done on June 11)
resets the controller and controller is not hung.

>How-To-Repeat:

Occurs randomly.

>Fix:

After backing out MFC the following error messages are produced:

Aug 13 03:40:57 cwsys /kernel: ata1-master: timeout waiting to give command=c8 s
=d0 e=00
Aug 13 03:40:57 cwsys /kernel: ad2: error executing command
Aug 13 03:41:02 cwsys /kernel: ad2: READ command timeout - resetting
Aug 13 03:41:02 cwsys /kernel: ata1: resetting devices .. done

Controller is not hung.

MFC backed out is:

sos         2000/06/11 10:02:46 PDT

  Modified files:        (Branch: RELENG_4)
    sys/dev/ata          ata-all.c ata-all.h ata-disk.c ata-dma.c
                         atapi-cd.h
  Log:
  MFC:
  
  Update with latest fixes from -current, brings -stable functionality
  up to and including following -current revisions:
  
  ata-all.c  $FreeBSD: src/sys/dev/ata/ata-all.c,v 1.57 2000/05/28 07:51:23
  ata-all.h  $FreeBSD: src/sys/dev/ata/ata-all.h,v 1.27 2000/04/09 15:08:26
  ata-disk.c $FreeBSD: src/sys/dev/ata/ata-disk.c,v 1.69 2000/05/23 19:05:56
  ata-dma.c  $FreeBSD: src/sys/dev/ata/ata-dma.c,v 1.38 2000/05/23 19:05:56
  atapi-cd.h $FreeBSD: src/sys/dev/ata/atapi-cd.h,v 1.18 2000/05/28 07:50:19
    
  Revision  Changes    Path
  1.50.2.4  +5 -5      src/sys/dev/ata/ata-all.c
  1.26.2.1  +4 -1      src/sys/dev/ata/ata-all.h
  1.60.2.3  +36 -24    src/sys/dev/ata/ata-disk.c
  1.35.2.2  +9 -5      src/sys/dev/ata/ata-dma.c
  1.15.2.2  +2 -2      src/sys/dev/ata/atapi-cd.h

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: sos 
State-Changed-When: Sun Aug 13 04:29:57 PDT 2000 
State-Changed-Why:  

I'm the ATA guy :) 

Please try the following patch it should help: 

Index: ata-disk.c 
=================================================================== 
RCS file: /home/ncvs/src/sys/dev/ata/ata-disk.c,v 
retrieving revision 1.73 
diff -u -r1.73 ata-disk.c 
--- ata-disk.c	2000/08/06 18:01:47	1.73 
+++ ata-disk.c	2000/08/13 11:25:21 
@@ -391,7 +391,7 @@ 

if (ata_command(adp->controller, adp->unit, cmd,  
cylinder, head, sector, count, 0, ATA_IMMEDIATE)) { 
-	    printf("ad%d: error executing commandn", adp->lun); 
+	    printf("ad%d: error executing command", adp->lun); 
goto transfer_failed; 
} 

@@ -429,12 +429,21 @@ 

transfer_failed: 
untimeout((timeout_t *)ad_timeout, request, request->timeout_handle); 
-    request->bp->bio_error = EIO; 
-    request->bp->bio_flags |= BIO_ERROR; 
-    request->bp->bio_resid = request->bytecount; 
-    devstat_end_transaction_bio(&adp->stats, request->bp); 
-    biodone(request->bp); 
-    free(request, M_AD); 
+    printf(" - resettingn"); 
+ 
+    /* if retries still permit, reinject this request */ 
+    if (request->retries++ < AD_MAX_RETRIES) 
+	TAILQ_INSERT_HEAD(&adp->controller->ata_queue, request, chain); 
+    else { 
+	/* retries all used up, return error */ 
+	request->bp->bio_error = EIO; 
+	request->bp->bio_flags |= BIO_ERROR; 
+	request->bp->bio_resid = request->bytecount; 
+	devstat_end_transaction_bio(&adp->stats, request->bp); 
+	biodone(request->bp); 
+	free(request, M_AD); 
+    } 
+    ata_reinit(adp->controller); 
} 

int32_t 



Responsible-Changed-From-To: freebsd-bugs->sos 
Responsible-Changed-By: sos 
Responsible-Changed-When: Sun Aug 13 04:29:57 PDT 2000 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=20573 
State-Changed-From-To: analyzed->closed 
State-Changed-By: sos 
State-Changed-When: Tue Nov 14 00:29:16 PST 2000 
State-Changed-Why:  
fixed in 4.2. 


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