PERFORCE change 169347 for review
Alexander Motin
mav at FreeBSD.org
Fri Oct 9 17:38:07 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=169347
Change 169347 by mav at 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);
More information about the p4-projects
mailing list