Re: kern/64637: [PATCH] ata1-slave: stat=0x01 err=0x00 lsb=0x00 msb=0x00 <- repeats for exactly 30 seconds during boot when no slave is wired

From: Paul Seniura <pdseniura_at_techie.com>
Date: Wed, 28 Apr 2004 11:29:47 -0500 (CDT)
Hi,

I saw Soren's private msg (heh, I can't figure out how to spell his name correctly ;) .
I know anything this low-level is a thorny thing to be modifying.

But this is one of those irritating things that bother one so much that it compels one to try fixing it oneself.

I'm no expert, but 30 years of building electronics and interfacing some of them to computers & writing drivers for them, I kinda have a knack.  ;)

The dmesg may be showing the 'answer' to this, up a bit further, in the tp1 lines:
 [...]
 ata0: reset tp1 mask=03 ostat0=50 ostat1=00
 [...]
 ata1: reset tp1 mask=03 ostat0=50 ostat1=00
 [...]

I _think_ we are _already_ getting a definitive response that there are no slaves connected.

Let me hear from y'all if this is correct or not:

The ostat1 in particular comes from the query for the ATA_SLAVE device on that channel (shown by 'ata#:') and getting the ATA_STATUS from that query (see patch below).

A zero value means nothing is busy, nothing is ready, nothing has an error, etc. etc. etc. (status flags defined following line #82 in ata-all.h v1.78).

We're seeing zeroes because nothing is there to respond.

Ergo, no slave device there.

What I do _not_ know is why we aren't getting ATA_NO_SLAVE lit up, but that part of ata-lowlevel.c (under line #556) is being executed anyway (this _is_ an older IBM 300PL model with its latest BIOS; its ACPI and APM modes make no difference here).

I also don't know if a zero value should prompt the code to check other flags -- if so, where & what & how??

So I am testing this patch for the time being:

===== cut here =====
--- ata-lowlevel.c_orig	Wed Apr 28 00:43:17 2004
+++ ata-lowlevel.c	Wed Apr 28 10:33:44 2004
_at__at_ -546,7 +546,7 _at__at_ ata_generic_reset(struct ata_channel *ch
     ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_MASTER);
     DELAY(10);
     ostat0 = ATA_IDX_INB(ch, ATA_STATUS);
-    if ((ostat0 & 0xf8) != 0xf8 && ostat0 != 0xa5) {
+    if ((ostat0 & 0xf8) != 0xf8 && ostat0 != 0xa5 && ostat0 != 0) {
 	stat0 = ATA_S_BUSY;
 	mask |= 0x01;
     }
_at__at_ -557,7 +557,7 _at__at_ ata_generic_reset(struct ata_channel *ch
 
     /* in some setups we dont want to test for a slave */
     if (!(ch->flags & ATA_NO_SLAVE)) {
-	if ((ostat1 & 0xf8) != 0xf8 && ostat1 != 0xa5) {
+	if ((ostat1 & 0xf8) != 0xf8 && ostat1 != 0xa5 && ostat1 != 0) {
 	    stat1 = ATA_S_BUSY;
 	    mask |= 0x02;
 	}
===== cut here =====


It's fixed the problem as best that I can figure out.  ;)

This IBM model does not have a ribbon connector for an extra drive (altho empty physical slot exist, but IBM wants to $ell you a new part for 'upgrading', see), so I'm not able to test this further.  Does anyone out there have the 'nads to try this patch?  ;)


  --  thx, Paul Seniura.
Received on Wed Apr 28 2004 - 07:28:54 UTC

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