From owner-freebsd-current@FreeBSD.ORG Tue Aug 24 05:25:30 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9FD9916A4CE for ; Tue, 24 Aug 2004 05:25:30 +0000 (GMT) Received: from rwcrmhc12.comcast.net (rwcrmhc12.comcast.net [216.148.227.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 65B4843D1D for ; Tue, 24 Aug 2004 05:25:28 +0000 (GMT) (envelope-from burpmaster@truffula.net) Received: from [192.168.0.2] (c-67-169-200-31.client.comcast.net[67.169.200.31]) by comcast.net (rwcrmhc12) with ESMTP id <20040824052527014007lri5e> (Authid: rogers240); Tue, 24 Aug 2004 05:25:27 +0000 Message-ID: <412AD147.7050502@truffula.net> Date: Mon, 23 Aug 2004 22:25:27 -0700 From: Brian Rogers User-Agent: Mozilla Thunderbird 0.7.3 (X11/20040806) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-current@freebsd.org Content-Type: multipart/mixed; boundary="------------020609060909080609050002" Subject: ATAPI_RESET hang fix X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2004 05:25:30 -0000 This is a multi-part message in MIME format. --------------020609060909080609050002 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I was getting the hang on start after the "ATAPI_RESET time = x" message. I stuck in a diagnostic printf before the ATAPI_RESET, and that actually fixed the hang. So I replaced it with a DELAY(50), and that also avoids the hang. I guess some ATAPI devices don't like being reset right after being queried. (Or there is a bug with handling that in FreeBSD) Patch is attached. --------------020609060909080609050002 Content-Type: text/plain; name="ata-patch.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ata-patch.diff" --- ata-all.c.orig Tue Aug 24 04:39:52 2004 +++ ata-all.c Tue Aug 24 04:40:05 2004 @@ -624,6 +624,7 @@ if (ata_getparam(&ch->device[SLAVE], ATA_ATAPI_IDENTIFY)) ch->devices &= ~ATA_ATAPI_SLAVE; else { + DELAY(50); ata_controlcmd(&ch->device[SLAVE], ATA_ATAPI_RESET, 0, 0, 0); switch (ch->device[SLAVE].param->config & ATA_ATAPI_TYPE_MASK) { #ifdef DEV_ATAPICD @@ -656,6 +657,7 @@ if (ata_getparam(&ch->device[MASTER], ATA_ATAPI_IDENTIFY)) ch->devices &= ~ATA_ATAPI_MASTER; else { + DELAY(50); ata_controlcmd(&ch->device[MASTER], ATA_ATAPI_RESET, 0, 0, 0); switch (ch->device[MASTER].param->config & ATA_ATAPI_TYPE_MASK) { #ifdef DEV_ATAPICD --------------020609060909080609050002--