Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Oct 2000 23:46:46 -0700 (MST)
From:      John Reynolds <jjreynold@home.com>
To:        stable@freebsd.org, sos@freebsd.org
Subject:   Re: breakage with two ed network devices - PATCH included
Message-ID:  <14837.12374.578218.236365@whale.home-net>
In-Reply-To: <39DE6BC7.DDCAD907@freeloader.freeserve.co.uk>
References:  <14812.58143.609625.133015@hip186.ch.intel.com> <A0E035400B00D4118F9E0008C70D4D77A88A@ITC1> <200010051637.KAA51557@harmony.village.org> <200010060408.WAA05189@harmony.village.org> <200010061618.MAA07034@world.std.com> <200010061722.NAA13450@world.std.com> <200010061947.PAA17583@world.std.com> <14814.12910.409342.160241@hip186.ch.intel.com> <39DE6BC7.DDCAD907@freeloader.freeserve.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help

[ weeks have passed by since this thread "died." I have finally scraped up
enough time to debug h/w and s/w ]

Summary of this thread: I tried to update to 4.1.1-S from 4.1-S and all of a
sudden my first 'ed' NIC wasn't probed and all heck broke loose. I tracked the
problem down to some ATA commits on 8/22 around 8-ish in the morning.

One of the NICs is on IRQ15. Warner Losh suggested that maybe the ATA code
wasn't giving up the resources after a probe. Indeed that appeared to be the
problem. Here is dmesg output for my broken 4.1.1-S system:

atapci0: <Intel PIIX4 ATA33 controller> port 0xf000-0xf00f at device 7.1 on pci0
ata0: iobase=0x01f0 altiobase=0x03f6 bmaddr=0xf000
ata0: mask=03 status0=50 status1=00
ata0: mask=03 status0=50 status1=00
ata0: devices = 0x1
ata0: at 0x1f0 irq 14 on atapci0
ata1: iobase=0x0170 altiobase=0x0376 bmaddr=0xf008
ata1: mask=03 status0=2c status1=2c
ata1: mask=03 status0=1c status1=1c
ata1: devices = 0x0
ata1: at 0x170 irq 15 on atapci0

I do -NOT- have anything even connected to the master or slave of the second
IDE channel provided by the BX. But, ata1 is still attaching using 0x170 and
IRQ15. This is what ruins my NIC's day. On 4.1-R the dmesg output looks like:

atapci0: <Intel PIIX4 ATA33 controller> port 0xf000-0xf00f at device 7.1 on pci0
ata0: iobase=0x01f0 altiobase=0x03f6 bmaddr=0xf000
ata0: mask=03 status0=50 status1=00
ata0: mask=03 status0=50 status1=00
ata0: devices = 0x1
ata0: at 0x1f0 irq 14 on atapci0
ata1: iobase=0x0170 altiobase=0x0376 bmaddr=0xf008
ata1: mask=03 status0=25 status1=25
ata1: mask=03 status0=16 status1=16
ata1: devices = 0x0
ata1: probe allocation failed

and nothing else is mentioned about ata1.

I tried mucking around with different IRQ values for these NICs and even dinked
with PnP for them (which they were not initially setup for). Nothing really
seamed to work besides my original config:

  device          ed0     at isa? port 0x2c0 irq 15 iomem 0xd8000
  device          ed1     at isa? port 0x340 irq 9 iomem 0xd0000

So, with favorite beverage in hand I went to inspect the ATA code. I found
something which cures my problem, but I'm not sure if it is "right" in general.

If you inspect version 1.50.2.4

 http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/ata/ata-all.c?rev=1.50.2.4&content-type=text/x-cvsweb-markup&only_with_tag=RELENG_4

and 1.50.2.6

http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/ata/ata-all.c?rev=1.50.2.6&content-type=text/x-cvsweb-markup&only_with_tag=RELENG4

of ata-all.c and look at the ata_probe function, there appears to be a small
"goto" missing. Version 1.50.2.4 is what shipped with 4.1-RELEASE. Right before
the first TAILQ_INIT near the end of the routine there is a "goto failure" if
the device count was zero. This is missing from version 1.50.2.6 which is what
4.1.1-STABLE pulls. 

The patch is thus:

--- ata-all.c.orig      Mon Oct 23 22:08:21 2000
+++ ata-all.c   Mon Oct 23 23:00:51 2000
@@ -832,6 +832,9 @@
     if (bootverbose)
        ata_printf(scp, -1, "devices = 0x%x\n", scp->devices);
 
+    if (!scp->devices) {
+        goto failure;
+    }
     if (!mask)
        goto failure;
 

With this patch in place, I can boot 4.1.1-S and the output shows:

atapci0: <Intel PIIX4 ATA33 controller> port 0xf000-0xf00f at device 7.1 on pci0
ata0: iobase=0x01f0 altiobase=0x03f6 bmaddr=0xf000
ata0: mask=03 status0=50 status1=00
ata0: mask=03 status0=50 status1=00
ata0: devices = 0x1
ata0: at 0x1f0 irq 14 on atapci0
ata1: iobase=0x0170 altiobase=0x0376 bmaddr=0xf008
ata1: mask=03 status0=28 status1=28
ata1: mask=03 status0=19 status1=18
ata1: devices = 0x0
ata1: probe allocation failed

but more gleefully, by NICs are happy:

ed0 at port 0x2c0-0x2df iomem 0xd8000 irq 15 on isa0
ed0: address 00:40:05:6e:67:c0, type NE2000 (16 bit) 
ed1 at port 0x340-0x35f iomem 0xd0000 irq 9 on isa0
ed1: address 00:40:05:6e:67:9c, type NE2000 (16 bit) 

It seems that without this patch, the ATA code will probe and attach any ATA
channels regardless of whether or not they've got devices hanging off
them. This doesn't seem right does it? If this patch is indeed correct, can we
get it committed to -STABLE? I just pulled version 1.80 of the file (for
-current) and the same problem exists there. Comments?

-Jr

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
John Reynolds         Chandler Capabilities Engineering, CDS, Intel Corporation
jreynold@sedona.ch.intel.com  My opinions are mine, not Intel's. Running
jjreynold@home.com          FreeBSD 4.1-STABLE. FreeBSD: The Power to Serve.
http://members.home.com/jjreynold/  Come join us!!! @ http://www.FreeBSD.org/
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14837.12374.578218.236365>