From owner-freebsd-current@FreeBSD.ORG Wed Apr 28 09:28:54 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 03ED916A4CE; Wed, 28 Apr 2004 09:28:54 -0700 (PDT) Received: from odot.okladot.state.ok.us (odot.okladot.state.ok.us [192.149.244.9]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2A6B243D48; Wed, 28 Apr 2004 09:28:53 -0700 (PDT) (envelope-from root@techpc04.okladot.state.ok.us) Received: from notes9c.okladot.state.ok.us (notes9a.okladot.state.ok.us [10.36.36.31])LAA36238; Wed, 28 Apr 2004 11:28:52 -0500 Received: from techpc04.okladot.state.ok.us ([199.27.9.37]) by notes9c.okladot.state.ok.us (Lotus Domino Release 5.0.12) with ESMTP id 2004042811292988:164341 ; Wed, 28 Apr 2004 11:29:29 -0500 Received: by techpc04.okladot.state.ok.us (Postfix, from userid 0) id 8044B5C98; Wed, 28 Apr 2004 11:29:47 -0500 (CDT) To: , From: "Paul Seniura" Errors-To: "Paul Seniura" Sender: "Paul Seniura" In-Reply-To: <20040323224904.9C8E95C11@techpc04.okladot.state.ok.us> References: <20040323224904.9C8E95C11@techpc04.okladot.state.ok.us> <20040427191603.B0B1F5C2B@techpc04.okladot.state.ok.us> <200404271920.i3RJK44d044158@freefall.freebsd.org> Message-Id: <20040428162947.8044B5C98@techpc04.okladot.state.ok.us> Date: Wed, 28 Apr 2004 11:29:47 -0500 (CDT) X-MIMETrack: Itemize by SMTP Server on Notes9c/ODOT(Release 5.0.12 |February 13, 2003) at 04/28/2004 11:29:29 AM,2003) at 04/28/2004 11:29:30 AM, Serialize complete at 04/28/2004 11:29:30 AM cc: sos@freebsd.org Subject: 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 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Paul Seniura List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2004 16:28:54 -0000 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 @@ -546,7 +546,7 @@ 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; } @@ -557,7 +557,7 @@ 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.