Re: ATAng still problematic

From: Soren Schmidt <sos_at_spider.deepcore.dk>
Date: Thu, 18 Sep 2003 15:54:36 +0200 (CEST)
It seems Jan Srzednicki wrote:
> First of all, the drive still does not get detected properly. Funny
> thing is that after some playing with atacontrol attach/detach, it
> finally gets detected. And later on, it is normally detected, before.
> Same scenario happened like 3 times with ATAng and newer and newer
> kernels. I don't know whether some device hints or anything are just
> updated; yet, I didn't have _any_ drive detection problems with ATAold.
> 
> The problem is with the second drive. There's still some randomness in
> it, as it gets undetected from time to time.

Try the below patch and let me know if that changes anything..

Index: ata-lowlevel.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/ata-lowlevel.c,v
retrieving revision 1.13
diff -u -r1.13 ata-lowlevel.c
--- ata-lowlevel.c      16 Sep 2003 15:21:37 -0000      1.13
+++ ata-lowlevel.c      18 Sep 2003 07:55:10 -0000
_at__at_ -551,11 +551,8 _at__at_
                        ch->devices |= ATA_ATA_MASTER;
                    }
                }
-               else if (err == lsb && err == msb) {
-                   ATA_IDX_OUTB(ch, ATA_ERROR, 0xff);
-                   DELAY(10);
-                   if (stat0 == ATA_IDX_INB(ch, ATA_STATUS))
-                       stat0 |= ATA_S_BUSY;
+               else if ((stat0 & 0x4f) && err == lsb && err == msb) {
+                   stat0 |= ATA_S_BUSY;
                }
            }
        }
_at__at_ -579,11 +576,8 _at__at_
                        ch->devices |= ATA_ATA_SLAVE;
                    }
                }
-               else if (err == lsb && err == msb) {
-                   ATA_IDX_OUTB(ch, ATA_ERROR, 0xff);
-                   DELAY(10);
-                   if (stat1 == ATA_IDX_INB(ch, ATA_STATUS))
-                       stat1 |= ATA_S_BUSY;
+               else if ((stat1 & 0x4f) && err == lsb && err == msb) {
+                   stat1 |= ATA_S_BUSY;
                }
            }
        }

-Søren
Received on Thu Sep 18 2003 - 04:54:49 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:22 UTC