From owner-freebsd-current Wed Nov 25 21:35:13 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA27055 for freebsd-current-outgoing; Wed, 25 Nov 1998 21:35:13 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from digger1.defence.gov.au (digger1.defence.gov.au [203.5.217.4]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA27001 for ; Wed, 25 Nov 1998 21:34:59 -0800 (PST) (envelope-from Matthew.Thyer@dsto.defence.gov.au) Received: from exchsa1.dsto.defence.gov.au (exchsa1.dsto.defence.gov.au [131.185.2.94]) by digger1.defence.gov.au (8.7.5/8.7.3) with ESMTP id PAA04868; Thu, 26 Nov 1998 15:59:02 +1030 (CST) Received: from fuzz.dsto.defence.gov.au ([131.185.75.229]) by exchsa1.dsto.defence.gov.au with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2232.9) id XTZMWN31; Thu, 26 Nov 1998 16:04:36 +1030 Received: from dsto.defence.gov.au (localhost [127.0.0.1]) by fuzz.dsto.defence.gov.au (8.9.1/8.8.8) with ESMTP id QAA00758; Thu, 26 Nov 1998 16:04:31 +1030 (CST) (envelope-from Matthew.Thyer@dsto.defence.gov.au) Message-ID: <365CE867.62F68C8A@dsto.defence.gov.au> Date: Thu, 26 Nov 1998 16:04:31 +1030 From: Matthew Thyer X-Mailer: Mozilla 4.07 [en] (X11; U; FreeBSD 3.0-BETA i386) MIME-Version: 1.0 To: "Justin T. Gibbs" CC: Graham Menhennitt , CURRENT@FreeBSD.ORG Subject: aha delaying patch works for genuine 1542B Content-Type: multipart/mixed; boundary="------------FD0CFC316C29D9F6C098DBFA" Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG This is a multi-part message in MIME format. --------------FD0CFC316C29D9F6C098DBFA Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit The card wasn't detected at all before and now it works fine! The card in question is a genuine Adaptec 1542B and I really need it to work as it contains my /usr/src !! As Graham Menhennitt said: "Could somebody please commit this change" The source I patched was CTM src-cur.3631 where /sys/dev/aha/aha.c is version 1.12 The patch I used is: fuzz: {1} diff /sys/dev/aha/aha.c.orig /sys/dev/aha/aha.c 356a357,359 > printf("aha: Before Matts DELAY\n"); > DELAY(100000); > printf("aha: After Matts DELAY\n"); 357a361 > printf("aha: After aha_inb(aha, GEOMETRY_REG)\n"); -- Matthew Thyer Phone: +61 8 8259 7249 Corporate Information Systems Fax: +61 8 8259 5537 Defence Science and Technology Organisation, Salisbury PO Box 1500 Salisbury South Australia 5108 --------------FD0CFC316C29D9F6C098DBFA Content-Type: message/rfc822; name="nsmail365B38EB0105803" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="nsmail365B38EB0105803" Received: from exchsa1.dsto.defence.gov.au (exchsa1.dsto.defence.gov.au [131.185.2.94]) by itd3.dsto.defence.gov.au (8.8.8/sendmail.ITD.EDB+userdb.960305) with ESMTP id IAA10950 for ; Wed, 11 Nov 1998 08:38:29 +1030 (CST) Received: by exchsa1.dsto.defence.gov.au with Internet Mail Service (5.5.2232.9) id ; Wed, 11 Nov 1998 08:38:38 +1030 Received: from dsto-ms1.dsto.defence.gov.au (mimesweeper.dsto.defence.gov.au [131.185.2.51]) by exchsa1.dsto.defence.gov.au with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2232.9) id WTQFV9HF; Wed, 11 Nov 1998 08:38:33 +1030 Received: from digger1.defence.gov.au (unverified [203.5.217.4]) by dsto-ms1.dsto.defence.gov.au (Integralis SMTPRS 2.04) with SMTP id ; Wed, 11 Nov 1998 08:41:49 +1030 Received: from hub.freebsd.org (hub.FreeBSD.ORG [204.216.27.18]) by digger1.defence.gov.au (8.7.5/8.7.3) with ESMTP id IAA00765 for ; Wed, 11 Nov 1998 08:32:39 +1030 (CST) Received: by hub.freebsd.org (VMailer, from userid 1) id 8C540A0B6; Tue, 10 Nov 1998 14:07:27 -0800 (PST) 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 Delivered-To: vmailer-current@freebsd.org 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 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 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=us-ascii X-Mozilla-Status2: 00000000 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 --------------FD0CFC316C29D9F6C098DBFA-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message