Re: PCI bus numbering and orphaned devices

From: Thomas Moestl <t.moestl_at_tu-bs.de>
Date: Tue, 10 Jun 2003 13:24:59 +0200
On Mon, 2003/06/09 at 16:58:38 -0700, John-Mark Gurney wrote:
> Hello,
> 
> I've recently started work on making FreeBSD work better on a sparc64
> box that a friend has.  It's a Netra AX1105-500 (UltraSPARC-IIe 500MHz).
> 
> So far I have found out that the pci bus numbering has problems.  We
> don't attach pci busses as they are numbered in the bridge/OFW info.
> This causes problems with pciconf -l and pciconf -{w,r} not agreeing.
> It isn't too hard to tie down the busses to make pciconf agree with
> itself.
>
> [...]
>
> Index: apb.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/sparc64/pci/apb.c,v
> retrieving revision 1.4
> diff -u -r1.4 apb.c
> --- apb.c	2002/03/24 02:10:56	1.4
> +++ apb.c	2003/06/09 23:33:07
> _at__at_ -207,9 +207,11 _at__at_
>  	 * number, we should pick a better value.  One sensible alternative
>  	 * would be to pick 255; the only tradeoff here is that configuration
>  	 * transactions would be more widely routed than absolutely necessary.
> +	 *
> +	 * If we don't hardware the bus down, pciconf gets confused.
>  	 */
>  	if (sc->secbus != 0) {
> -		child = device_add_child(dev, "pci", -1);
> +		child = device_add_child(dev, "pci", sc->secbus);
>  		if (child != NULL)
>  			return (bus_generic_attach(dev));
>  	} else

This one looks good, please commit. The comment above is outdated, so
it might be better to just remove it completely.

	- Thomas

-- 
Thomas Moestl <t.moestl_at_tu-bs.de>	http://www.tu-bs.de/~y0015675/
              <tmm_at_FreeBSD.org>		http://people.FreeBSD.org/~tmm/
PGP fingerprint: 1C97 A604 2BD0 E492 51D0  9C0F 1FE6 4F1D 419C 776C
Received on Tue Jun 10 2003 - 02:45:48 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:11 UTC