From owner-freebsd-stable Thu Jul 25 14: 6:49 2002 Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0CF6237B401; Thu, 25 Jul 2002 14:06:45 -0700 (PDT) Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by mx1.FreeBSD.org (Postfix) with SMTP id 61A3B43E67; Thu, 25 Jul 2002 14:06:43 -0700 (PDT) (envelope-from iedowse@maths.tcd.ie) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 25 Jul 2002 22:06:42 +0100 (BST) To: Hans Ottevanger Cc: John Baldwin , stable@FreeBSD.org, Mark Hartley , Jesse Gross , John Prince Subject: Re: READ_BIG problems In-Reply-To: Your message of "Thu, 25 Jul 2002 22:44:09 +0200." <3D406319.1136A6EA@iae.nl> Date: Thu, 25 Jul 2002 22:06:38 +0100 From: Ian Dowse Message-ID: <200207252206.aa43155@salmon.maths.tcd.ie> Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message <3D406319.1136A6EA@iae.nl>, Hans Ottevanger writes: >acd0: READ_BIG command timeout - resetting >ata1: resetting devices .. done >acd0: READ_BIG command timeout - resetting >ata1: resetting devices .. done Could people seeing this and other ATA problems try the patch below? This should fix some unlikely races that could potentially be responsible for these problems, though I suspect it will not make any difference. The second part of the patch is a workaround for the "atprq" hangs on ATAPI tape drives. Ian Index: ata-all.c =================================================================== RCS file: /home/iedowse/CVS/src/sys/dev/ata/ata-all.c,v retrieving revision 1.50.2.37 diff -u -r1.50.2.37 ata-all.c --- ata-all.c 19 Jun 2002 08:30:48 -0000 1.50.2.37 +++ ata-all.c 18 Jul 2002 17:00:27 -0000 @@ -228,10 +228,10 @@ !ch->r_io || !ch->r_altio || !ch->r_irq) return ENXIO; + s = splbio(); /* make sure channel is not busy */ ATA_SLEEPLOCK_CH(ch, ATA_CONTROL); - s = splbio(); #if NATADISK > 0 if (ch->devices & ATA_ATA_MASTER && ch->device[MASTER].driver) ad_detach(&ch->device[MASTER], 1); @@ -669,10 +669,12 @@ #endif int s; - if (!ATA_LOCK_CH(ch, ATA_ACTIVE)) + s = splbio(); + if (!ATA_LOCK_CH(ch, ATA_ACTIVE)) { + splx(s); return; + } - s = splbio(); #if NATADISK > 0 /* find & call the responsible driver if anything on the ATA queue */ if (TAILQ_EMPTY(&ch->ata_queue)) { Index: atapi-all.c =================================================================== RCS file: /home/iedowse/CVS/src/sys/dev/ata/atapi-all.c,v retrieving revision 1.46.2.14 diff -u -r1.46.2.14 atapi-all.c --- atapi-all.c 14 Jul 2002 12:35:28 -0000 1.46.2.14 +++ atapi-all.c 14 Jul 2002 23:39:00 -0000 @@ -186,6 +186,7 @@ request->flags = flags; request->timeout = timeout * hz; request->ccbsize = atadev->param->packet_size ? 16 : 12; + request->error = EINPROGRESS; bcopy(ccb, request->ccb, request->ccbsize); if (callback) { request->callback = callback; @@ -215,7 +216,8 @@ } /* wait for request to complete */ - tsleep((caddr_t)request, PRIBIO, "atprq", 0); + if (request->error == EINPROGRESS) + tsleep((caddr_t)request, PRIBIO, "atprq", 0); splx(s); error = request->error; if (error) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message