Date: Fri, 9 Oct 2009 17:38:07 GMT From: Alexander Motin <mav@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 169347 for review Message-ID: <200910091738.n99Hc7QN084927@repoman.freebsd.org>
index | next in thread | raw e-mail
http://perforce.freebsd.org/chv.cgi?CH=169347 Change 169347 by mav@mav_mavtest on 2009/10/09 17:37:25 Use ata_wait() command for waiting for !BSY and !ERR after PACKET command submission. It allows to less confuse ATA drive and recover faster. Affected files ... .. //depot/projects/scottl-camlock/src/sys/dev/ata/ata-lowlevel.c#14 edit Differences ... ==== //depot/projects/scottl-camlock/src/sys/dev/ata/ata-lowlevel.c#14 (text+ko) ==== @@ -666,6 +666,7 @@ if (request->flags & ATA_R_ATAPI) { int timeout = 5000; + int res; /* issue packet command to controller */ if (request->flags & ATA_R_DMA) { @@ -684,6 +685,13 @@ if (request->flags & ATA_R_ATAPI_INTR) 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"); + return (-1); + } /* wait for ready to write ATAPI command block */ while (timeout--) { int reason = ATA_IDX_INB(ch, ATA_IREASON);help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200910091738.n99Hc7QN084927>
