Subject: RBUS_MIN_START
To: None <port-i386@netbsd.org>
From: Greg Troxel <gdt@ir.bbn.com>
List: port-i386
Date: 08/09/2006 12:02:20
--=-=-=
Content-Transfer-Encoding: quoted-printable


(This feels like an i386 problem, although it's really about
pci/cardbus bridges.)

On a T42p with 2 GB RAM, we had trouble with a Ubiquity high-power
ath(4) card, and wondered if the HAL wasn't new enough (it has a
fairly new atheros chip in it).  It turns out that the problem was
rbus_min_start, and other cardbus cards also failed to work.  On i386,
in src/sys/arch/i386/i386/rbus_machdep.c this RBUS_MIN_START is
defined to be 1 GB.  On amd64, it's 2 GB.

(Also, we found that the system crashed on shutdown when there was a
partially attached card, somewhere in ath shutdown hooks, but that's a
separate and minor issue.)

Armando found out that removing 1 GB of memory (leaving 1 GB) made the
card work, and that (alternatively) setting RBUS_MIN_START to 2 GB
made the card work.

Long ago, on a Thinkpad 600E with 192 MB, I had to set RBUS_MIN_START
to 0.5 GB to get cardbus to work.

So, I think rbus_min_start should be set dymamically based on
available memory.  I can think of two approaches:

1)
set rbus_min_start to the memory size, so we use as low a value as
possible, and which is therefore most likely to work.

2)
if memory > 1 GB, set rbus_min_start to memory size
if memory < 256 MB, set rbus_min_start to 0.5 GB
otherwise, use 1 GB
(if RBUS_MIN_START is defined, use that unconditionally.)

3)
If ACPI, figure it out somehow.

The big problem is that I can't possible really test any such code,
beyond the few machines I have.

Approach 3 is too hard for now, and we need a plan for non-acpi
machines.

Approach 1 seems simple, but changes rbus_min_start on a lot of
machines that now work.

Approach 2 solves the problem for TP600E and big-memory machines, but
leaves most of today's notebooks (256MB-1GB) alone.  Presumably most
of those are working.

So, I'd like to do approach 2 for i386 by modifying rbus_machdep.c and
machdep.c, and adding a boot-time printf of the resulting choice to
aid in troubleshooting.

Comments?  What are people with > 1 GB notebooks doing now?  Does
cardbus work on non-thinkpads?

=2D-=20
    Greg Troxel <gdt@ir.bbn.com>

--=-=-=
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (NetBSD)

iD8DBQFE2gcQ+vesoDJhHiURAkf6AJ0UKtkGOe8KZFb1FXo/SgmnI0bnqACeOCap
VsEucKoLi3E62v7+tF6fKs0=
=rbl/
-----END PGP SIGNATURE-----
--=-=-=--