ATAPI_RESET hang fix

From: Brian Rogers <burpmaster_at_truffula.net>
Date: Mon, 23 Aug 2004 22:25:27 -0700
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.


--- ata-all.c.orig	Tue Aug 24 04:39:52 2004
+++ ata-all.c	Tue Aug 24 04:40:05 2004
_at__at_ -624,6 +624,7 _at__at_
 	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
_at__at_ -656,6 +657,7 _at__at_
 	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
Received on Tue Aug 24 2004 - 03:25:30 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:08 UTC