From owner-svn-src-stable-8@FreeBSD.ORG Tue Nov 23 21:22:19 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B190106564A; Tue, 23 Nov 2010 21:22:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D2E278FC18; Tue, 23 Nov 2010 21:22:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oANLMIcL044321; Tue, 23 Nov 2010 21:22:18 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oANLMIos044319; Tue, 23 Nov 2010 21:22:18 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201011232122.oANLMIos044319@svn.freebsd.org> From: Alexander Motin Date: Tue, 23 Nov 2010 21:22:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215771 - stable/8/sys/dev/ata X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Nov 2010 21:22:19 -0000 Author: mav Date: Tue Nov 23 21:22:18 2010 New Revision: 215771 URL: http://svn.freebsd.org/changeset/base/215771 Log: MFC r214896: Mark command submission timeouts as timeouts. This should trigger device resets and increase chances of getting device back again. Modified: stable/8/sys/dev/ata/ata-lowlevel.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ata/ata-lowlevel.c ============================================================================== --- stable/8/sys/dev/ata/ata-lowlevel.c Tue Nov 23 21:21:56 2010 (r215770) +++ stable/8/sys/dev/ata/ata-lowlevel.c Tue Nov 23 21:22:18 2010 (r215771) @@ -672,7 +672,8 @@ ata_generic_command(struct ata_request * /* ready to issue command ? */ if (ata_wait(ch, request->unit, 0) < 0) { device_printf(request->parent, "timeout waiting to issue command\n"); - return -1; + request->flags |= ATA_R_TIMEOUT; + return (-1); } /* enable interrupt */ @@ -697,13 +698,16 @@ ata_generic_command(struct ata_request * /* command interrupt device ? just return and wait for interrupt */ if (request->flags & ATA_R_ATAPI_INTR) - return 0; + return (0); /* command processed ? */ res = ata_wait(ch, request->unit, 0); if (res != 0) { - if (res < 0) - device_printf(request->parent, "timeout waiting for PACKET command\n"); + if (res < 0) { + device_printf(request->parent, + "timeout waiting for PACKET command\n"); + request->flags |= ATA_R_TIMEOUT; + } return (-1); } /* wait for ready to write ATAPI command block */ @@ -717,9 +721,10 @@ ata_generic_command(struct ata_request * DELAY(20); } if (timeout <= 0) { - device_printf(request->parent, "timeout waiting for ATAPI ready\n"); - request->result = EIO; - return -1; + device_printf(request->parent, + "timeout waiting for ATAPI ready\n"); + request->flags |= ATA_R_TIMEOUT; + return (-1); } /* this seems to be needed for some (slow) devices */ @@ -735,7 +740,7 @@ ata_generic_command(struct ata_request * /* issue command to controller */ ATA_IDX_OUTB(ch, ATA_COMMAND, request->u.ata.command); } - return 0; + return (0); } static void