Bug 32165

Summary: kernel tries to initialize xl driver in 3.1-STABLE (as of 3/30/1999) and fails reporting: "xl: couldn't map port"
Product: Base System Reporter: nadir <nadir>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.1-STABLE   
Hardware: Any   
OS: Any   

Description Gregory Bond 1999-04-01 04:26:38 UTC
I've just (199904010200 Z) cvsup'd and make world'd and made a new
kernel and the xl0 driver works fine for me:
	xl0: <3Com 3c905B Fast Etherlink XL 10/100BaseTX> rev 0x00 int a irq 11 on pci0.17.0
	xl0: Ethernet address: 00:10:5a:a9:84:33
	xl0: autoneg complete, link status good (full-duplex, 100Mbps)

hellcat$ ident /usr/src/sys/pci/if_xl*
/usr/src/sys/pci/if_xl.c:
     $Id: if_xl.c,v 1.22.2.4 1999/03/27 20:45:55 wpaul Exp $
     $Id: if_xl.c,v 1.22.2.4 1999/03/27 20:45:55 wpaul Exp $

/usr/src/sys/pci/if_xlreg.h:
     $Id: if_xlreg.h,v 1.9.2.1 1999/03/27 20:45:56 wpaul Exp $
Comment 1 nadir 1999-04-03 09:44:26 UTC
On Thu, 1 Apr 1999, Gregory Bond wrote:

> 
> I've just (199904010200 Z) cvsup'd and make world'd and made a new
> kernel and the xl0 driver works fine for me:
> 	xl0: <3Com 3c905B Fast Etherlink XL 10/100BaseTX> rev 0x00 int a irq 11 on pci0.17.0
> 	xl0: Ethernet address: 00:10:5a:a9:84:33
> 	xl0: autoneg complete, link status good (full-duplex, 100Mbps)
> 
> hellcat$ ident /usr/src/sys/pci/if_xl*
> /usr/src/sys/pci/if_xl.c:
>      $Id: if_xl.c,v 1.22.2.4 1999/03/27 20:45:55 wpaul Exp $
>      $Id: if_xl.c,v 1.22.2.4 1999/03/27 20:45:55 wpaul Exp $
> 
> /usr/src/sys/pci/if_xlreg.h:
>      $Id: if_xlreg.h,v 1.9.2.1 1999/03/27 20:45:56 wpaul Exp $
> 

  Hi folks,

  I know that you sure know what you're doing, but I am positive I know
what I am doing. I ftp'ed the latest floppies from a snapshot server, then
made two floppies: kernel and mfs. Then I booted the kernel, and
surprisingly, the kernel DID NOT install the driver and the same "xl0:
couldn't map port" message is still displaying.

  All the thing is that you must be missing something in the code as this
exact machine works fine if I install 3.1-RELEASE and it autodetects and
installs the driver.

  Whomever wants debugging messages/tests, tell me what, I'll send it.

  Noor
Comment 2 wpaul 1999-04-03 16:32:20 UTC
Of all the gin joints in all the towns in all the world, Noor Dawod had
to walk into mine and say:

>   Hi folks,
> 
>   I know that you sure know what you're doing, but I am positive I know
> what I am doing. I ftp'ed the latest floppies from a snapshot server, then
> made two floppies: kernel and mfs. Then I booted the kernel, and
> surprisingly, the kernel DID NOT install the driver and the same "xl0:
> couldn't map port" message is still displaying.

I'm pretty sure that the reason the driver worked before is that
it was manually determining the I/O address to use by reading the
PCI configuration registers on the card itself instead of going through
pci_map_ports(). But using pci_map_ports() is the right thing to do
and it clearly works for other people (including me, even on
FreeBSD/alpha). The patch I sent you under separate cover restores the
old behavior which should make it work again, however the problem
is either a bug in the PCI support code or some peculiarity about
your hardware. The xl driver itself is almost certainly not the real
problem.

The right thing to do is to add some debug code to pci.c or pci_compat.c
and find out why pci_map_ports() _and_ pci_map_mem() both fail. What
would also be helpful is if you could show the complete dmesg output
from your system, with the -v boot flag if possible.

-Bill

-- 
=============================================================================
-Bill Paul            (212) 854-6020 | System Manager, Master of Unix-Fu
Work:         wpaul@ctr.columbia.edu | Center for Telecommunications Research
Home:  wpaul@skynet.ctr.columbia.edu | Columbia University, New York City
=============================================================================
"Mulder, toads just fell from the sky!" "I guess their parachutes didn't open."
=============================================================================
Comment 3 msmith freebsd_committer freebsd_triage 1999-06-24 00:42:44 UTC
State Changed
From-To: open->closed

xl driver now has workaround for this case.
Comment 4 nadir 2001-11-21 15:00:00 UTC
I installed a new system on a P-II 350Mhz system, with AHA-2940 W/UW SCSI adapter. I installed FreeBSD 3.1-RELEASE the first time, and then I did a cvsup and upgraded to 3.1-STABLE (3/30/1999), compiled the kernel with no problems, and then rebooted.

In the previous installation of FreeBSD (3.1-RELEASE) the xl driver worked fine, and auto-negotiated the network and installed the driver. After upgrading, the xl driver "sees" the card, identifies it, but when trying to install the driver, reports: "xl: couldn't map port".

I tried changing a #define line in /usr/src/sys/pci/if_xl.c to use memory mapped instead of PIO mode, and recompiled. This time, the driver reported: "xl: couldn't map memory".

Fix: 

Tried, but couldn't fix it ;(
How-To-Repeat: Like I explain above, install 3.1-RELEASE, use cvsup to upgrade to 3.1-STABLE (for 3/30/1999) and then recompile the kernel. This time, the xl driver will not work.

Hardware includes also an AHA-2940 W/UW SCSI adapter.