[PATCH] if_fxp: do not initialize PCI bus itself

Joel Sherrill <joel@OARcorp.com> joel.sherrill at OARcorp.com
Thu Aug 18 22:30:36 UTC 2005


Karel Gardas wrote:
> 
> Hello,
> 
> if_fxp NIC driver worked well on pc386 BSP, since it initializes PCI bus 
> itself. Experts here pointed out that this is wrong way early this year 
> and I've finally removed this initialization from the driver and tested 
> that it still works with the pc386 BSP with previous PCI bus init patch 
> applied. Hopefuly this is also right for other supported platforms.

This steps into more of a grey area to me.  It looks like 
pci_initialize() is called from bspstart.c for every BSP that calls
it.  So that assumption is safe.

However, it also looks like other drivers in libchip/network
call pci_initialize().  So if it is correct to remove
the call to pci_initialize() from the if_fxp driver, it must
also be correct to do from the other drivers.

I need to either not apply the patch or remove the call
to pci_initialize from the other drivers.  If we do the latter,
we are assuming that the BSP will take care of that for
device drivers.

Comments?

--joel

> Cheers,
> Karel
> -- 
> Karel Gardas                  kgardas at objectsecurity.com
> ObjectSecurity Ltd.           http://www.objectsecurity.com
> 
> 
> ------------------------------------------------------------------------
> 
> Index: c/src/ChangeLog
> ===================================================================
> RCS file: /usr1/CVS/rtems/c/src/ChangeLog,v
> retrieving revision 1.259
> diff -u -r1.259 ChangeLog
> --- c/src/ChangeLog	15 Aug 2005 13:54:15 -0000	1.259
> +++ c/src/ChangeLog	18 Aug 2005 18:51:16 -0000
> @@ -1,3 +1,7 @@
> +2005-08-18  Karel Gardas  <kgardas at objectsecurity.com>
> +
> +	* libchip/network/if_fxp.c: Remove initialization of PCI bus.
> +
>  2005-08-15	Ralf Corsepius <ralf.corsepius at rtems.org>
>  
>  	* optman/Makefile.am: Add preinstall.am.
> Index: c/src/libchip/network/if_fxp.c
> ===================================================================
> RCS file: /usr1/CVS/rtems/c/src/libchip/network/if_fxp.c,v
> retrieving revision 1.16
> diff -u -r1.16 if_fxp.c
> --- c/src/libchip/network/if_fxp.c	18 Jul 2005 15:42:24 -0000	1.16
> +++ c/src/libchip/network/if_fxp.c	18 Aug 2005 18:51:37 -0000
> @@ -447,16 +447,6 @@
>  	s = splimp();
>  
>  	/*
> -	 * init PCI Bios interface...
> -	 */
> -	i = pci_initialize();
> -	DBGLVL_PRINTK(2,"fxp_attach: pcib_init returned %d\n",i);
> -	if (i != PCIB_ERR_SUCCESS) {
> -	  device_printf(dev, "could not initialize pci bios interface\n");
> -	  return 0;
> -	}
> -
> -	/*
>  	 * find device on pci bus
>  	 */
>      { int j; int pbus, pdev, pfun;


-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
    Support Available             (256) 722-9985




More information about the users mailing list