Subject: Re: Snapshot 20030927 available
To: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
From: Christopher SEKIYA <wileyc@rezrov.net>
List: port-sgimips
Date: 10/01/2003 15:25:01
Hello,
On Tue, Sep 30, 2003 at 11:20:33PM +0900, Izumi Tsutsui wrote:
> It seems (ahc->flags & AHC_USEDEFAULTS) is true at ahc_pci.c:1035
> with your O2 on-board aic7xxx, right?
You are absolutely right -- AHC_USEDEFAULTS is indeed set at that point.
And, as you point out:
> On the other hand, there is the following comment:
> > /* Remember how the card was setup in case there is no SEEPROM */
> at line 914 in ahc_pci.c, but the next line is:
> > if ((ahc_inb(ahc, HCNTRL) & POWRDN) == 0) {
> so it does not see ahc->flags to check SEEPROM. Is this really OK?
I didn't notice that. Not only is it not checking ahc->flags, but it's
doing this _before_ it probes for the SEEPROM.
(I hadn't considered whether ahc_pci was behaving incorrectly. Thank you
very much for correcting my mistaken logic)
If we add a check for ahc->flags to that bit, and move it after the SEEPROM
probe, it works perfectly on the O2.
What do you think about the attached diff?
-- Chris
GPG key FEB9DE7F (91AF 4534 4529 4BCC 31A5 938E 023E EEFB FEB9 DE7F)
Index: ahc_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/ahc_pci.c,v
retrieving revision 1.43
diff -u -r1.43 ahc_pci.c
--- ahc_pci.c 2003/08/18 09:16:22 1.43
+++ ahc_pci.c 2003/10/01 06:21:33
@@ -911,21 +911,6 @@
ahc->bus_intr = ahc_pci_intr;
- /* Remember how the card was setup in case there is no SEEPROM */
- if ((ahc_inb(ahc, HCNTRL) & POWRDN) == 0) {
- ahc_pause(ahc);
- if ((ahc->features & AHC_ULTRA2) != 0)
- our_id = ahc_inb(ahc, SCSIID_ULTRA2) & OID;
- else
- our_id = ahc_inb(ahc, SCSIID) & OID;
- sxfrctl1 = ahc_inb(ahc, SXFRCTL1) & STPWEN;
- scsiseq = ahc_inb(ahc, SCSISEQ);
- } else {
- sxfrctl1 = STPWEN;
- our_id = 7;
- scsiseq = 0;
- }
-
error = ahc_reset(ahc);
if (error != 0)
goto error_out;
@@ -1019,6 +1004,21 @@
/* See if we have a SEEPROM and perform auto-term */
ahc_check_extport(ahc, &sxfrctl1);
+
+ /* Remember how the card was setup in case there is no SEEPROM */
+ if ( (ahc_inb(ahc, HCNTRL) & POWRDN) == 0 && !(ahc->flags & AHC_USEDEFAULTS) ) {
+ ahc_pause(ahc);
+ if ((ahc->features & AHC_ULTRA2) != 0)
+ our_id = ahc_inb(ahc, SCSIID_ULTRA2) & OID;
+ else
+ our_id = ahc_inb(ahc, SCSIID) & OID;
+ sxfrctl1 = ahc_inb(ahc, SXFRCTL1) & STPWEN;
+ scsiseq = ahc_inb(ahc, SCSISEQ);
+ } else {
+ sxfrctl1 = STPWEN;
+ our_id = 7;
+ scsiseq = 0;
+ }
/*
* Take the LED out of diagnostic mode