Strange error 4.9RC1

Erik Trulsson ertr1013 at student.uu.se
Mon Oct 6 17:31:00 PDT 2003


On Mon, Oct 06, 2003 at 07:33:24PM -0400, Brian Lynn wrote:
> 
> On Sun, 05 Oct 2003, Jack Raats wrote:
>           
> > After compiling the kernel 4.9RC1 dmesg gives the following error
> > 
> > lpt0: Interrupt-driven port
> > ppi0: <Parallel I/O> on ppbus0
> > ed1: <Realtek Plug & Play Ethernet Card> at port 0x220-0x23f irq 5 on isa0
> > ed1: address 52:54:40:28:83:9a, type NE2000 (16 bit)
> > ad0: 4112MB <WDC AC24300L> [8912/15/63] at ata0-master WDMA2
> > Mounting root from ufs:/dev/ad0s1a
> > module_register: module miibus/ukphy already exists!
> > linker_file_sysinit "miibus.ko" failed to register! 17
> > module_register: module pci/ed already exists!
> > linker_file_sysinit "if_ed.ko" failed to register! 17
> > 
> > /root/kernel/HEAVEN have the following to lines
> > 
> > # PCI Ethernet NICs that use the common MII bus controller code.
> > device          miibus          # MII bus support
> > device          ed0     at isa? disable port 0x280 irq 10 iomem 0xd8000
> > 
> > Is this a bug, a feature or I am doing something wrong?
> > 
> > 
> > 
> > Met vriendelijke groeten,
> > Jack Raats
> 
> There is a bug here, whereby ifconfig(8) does not match the name
> registered in the kernel by ed(4).  Erik Trulsson posted some patches
> to fix this last month; search the archive for a thread titled
> "strange problem with ed driver".  [1]

Or just cvsup to the latest RELENG_4 since the following commit was
made a short while ago:


imp         2003/10/05 19:53:52 PDT
  FreeBSD src repository
  Modified files:        (Branch: RELENG_4)
    sys/dev/ep           if_ep_eisa.c if_ep_isa.c if_ep_mca.c
                         if_ep_pccard.c
    sys/dev/ed           if_ed_cbus.c if_ed_isa.c if_ed_pccard.c
                         if_ed_pci.c
  Log:
  Driver names for DRIVER_MODULE in current are 'ed' and 'ep', but in
  -stable they need to be 'if_ed' and 'if_ep'.  ifconfig should be
  modified, but this is a lower risk change this late in the release
  cycle.
  Approved by: re@




> 
> However, depending on the remainder of your kernel config, there could
> be something additional going on here.  Note the discrepancy between the
> dmesg (ed1) and the config file (ed0).  You might check whether you are
> actually loading if_ed.ko in /boot/loader.conf.

Note that in the config file ed0 is specified as using irq 10 and port
0x280. (And ed0 is disabled in the config file.)
When then a NIC is detected as port 0x220 IRQ 5, it can't be given
the name ed0 since that device is supposed to reside elsewhere, so the
next available name, ed1, is used instead.

So this seems to be working correctly and as expected (depending on
expectations), but it might be a good idea to change the kernel config
to reflect the actual hardware, unless there is a good reason for it
being as it is.

(Since the card is a Plug-and-Play card, one can probably skip
specifying IRQ and I/O port and just use 'device ed' in the kernel
config, since the actual values for IRQ/port are detected
automatically. Works for PCI cards anyway.)

I don't think /boot/loader.conf is involved although I suppose it is
possible.
The problem is almost certainly the (harmless) bug mentioned above
where ifconfig(8) and the ed(4) driver didn't agree on which name sh


> 
> Brian Lynn
> 
> [1] The following patch to ifconfig.c also solves this problem on my
> system.  This is taken from v1.90 in HEAD and modifies the ifmaybeload()
> function.  It does not break on any of the interfaces I use (ed xl lo),
> but I don't really know what I'm doing - YMMV.
> 
> --- sbin/ifconfig/ifconfig.c.orig	Tue Jan 28 06:02:56 2003
> +++ sbin/ifconfig/ifconfig.c	Tue Sep 23 18:06:07 2003
> @@ -1995,7 +1995,8 @@
>  				cp = mstat.name;
>  			}
>  			/* already loaded? */
> -			if (!strcmp(ifkind, cp))
> +		/*	if (!strcmp(ifkind, cp))	*/
> +			if (!strncmp(name, cp, strlen(cp)))
>  				return;
>  		}
>  	}

As far as I can tell, that patch will not work for those drivers that
*do* register as BUS/if_FOO instead of BUS/FOO.
In -CURRENT all the network drivers seem to have been changed at the
same time to register themselves as BUS/FOO rather than BUS/if_FOO so
there the patch should work, but I don't think it will work in -STABLE.

Are you sure it works correctly for the 'xl' interface? (I.e. that if
you have the 'xl' driver in the kernel, ifconfig will not attempt to
load it as a module.)
('lo' is not available as a module, so no problem there, and 'ed'
used the convention that this patch will make ifconfig use, so those
should work with the patch. (At least before the commit referenced
above which changes 'ed' to use the if_FOO style.)



-- 
<Insert your favourite quote here.>
Erik Trulsson
ertr1013 at student.uu.se


More information about the freebsd-stable mailing list