Date: Sat, 6 Nov 2010 19:11:49 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r214896 - head/sys/dev/ata Message-ID: <201011061911.oA6JBnaQ045198@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Sat Nov 6 19:11:49 2010 New Revision: 214896 URL: http://svn.freebsd.org/changeset/base/214896 Log: Mark command submission timeouts as timeouts. This should trigger device resets and increase chances of getting device back again. Modified: head/sys/dev/ata/ata-lowlevel.c Modified: head/sys/dev/ata/ata-lowlevel.c ============================================================================== --- head/sys/dev/ata/ata-lowlevel.c Sat Nov 6 18:36:21 2010 (r214895) +++ head/sys/dev/ata/ata-lowlevel.c Sat Nov 6 19:11:49 2010 (r214896) @@ -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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201011061911.oA6JBnaQ045198>