From owner-freebsd-current Tue Nov 10 14:07:27 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA23792 for freebsd-current-outgoing; Tue, 10 Nov 1998 14:07:27 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from werple.mira.net (werple.mira.net [203.9.190.18]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id OAA23780 for ; Tue, 10 Nov 1998 14:07:24 -0800 (PST) (envelope-from gfm@mira.net) Received: (qmail 27050 invoked from network); 10 Nov 1998 22:07:04 -0000 Received: from dp-m-r051.werple.net.au (203.17.46.51) by mira.net with SMTP; 10 Nov 1998 22:07:04 -0000 From: gfm@mira.net (Graham Menhennitt) To: "Justin T. Gibbs" , freebsd-current@FreeBSD.ORG Subject: Re: 3.0-CURRENT: Adaptec 1540 not detected (with workaround) Date: Tue, 10 Nov 1998 22:09:37 GMT Message-ID: <3648b287.87315503@mira.net> References: <199811100058.RAA22604@narnia.plutotech.com> In-Reply-To: <199811100058.RAA22604@narnia.plutotech.com> X-Mailer: Forte Agent 1.5/32.451 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by hub.freebsd.org id OAA23785 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Ok, I did a bit more investigating. Firstly, I pulled the card out of the machine. It's an AHA 1542B. Then I added a printf to output the board id and the status value read from the geometry register. The values were 0x41 and 0xFF respectively. Hang on... with those values, the test should pass!!! I did a bit more fiddling and found that putting in the printf makes it work! It must be a timing problem. Sure enough, I added a delay loop before reading the geometry register and it fixed it. I forgot to generate a patch file but it now looks like: if (aha->boardid <= 0x42) { int dummy; for(dummy = 0; dummy < 1000; dummy++) ; status = aha_inb(aha, GEOMETRY_REG); if (status != 0xff) return (ENXIO); } I tried 100 for the loop count but it still failed. I don't know if there is a more elegant way of doing this. But anyway, the above seems to work 100% reliably. Could somebody please commit this change. Graham On Mon, 9 Nov 1998 17:58:30 -0700 (MST), you wrote: >In article <36484fb6.262608561@mira.net> you wrote: >> Eventually I found the problem. In /usr/src/sys/dev/aha/aha.c there is some >> code that attempts to distinguish between Adaptec and Buslogic adaptors. >> This was failing. I'm not sure what model my adaptor is (I think it's an >> 'A') but it is a genuine Adaptec. Hence the comment in the code about >> cloned cards may apply to some genuine ones also. > > >Can you print out the value of aha->boardid and send it to me? It >would also be useful for you to look in your machine and determine >exactly which version of this card you have. > >Thanks, >Justin To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message