From owner-p4-projects@FreeBSD.ORG Fri Jul 14 05:43:43 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E9E6D16A4DD; Fri, 14 Jul 2006 05:43:42 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A369F16A4DF for ; Fri, 14 Jul 2006 05:43:42 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1714D43D55 for ; Fri, 14 Jul 2006 05:43:42 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k6E5hfxZ036234 for ; Fri, 14 Jul 2006 05:43:41 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k6E5hfOw036231 for perforce@freebsd.org; Fri, 14 Jul 2006 05:43:41 GMT (envelope-from imp@freebsd.org) Date: Fri, 14 Jul 2006 05:43:41 GMT Message-Id: <200607140543.k6E5hfOw036231@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 101522 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2006 05:43:43 -0000 http://perforce.freebsd.org/chv.cgi?CH=101522 Change 101522 by imp@imp_lighthouse on 2006/07/14 05:43:35 Newer machines don't assign PCI bus numbers to the cardbus bridges. Cope better with this. # waiting to hear back folks with this problem to see if it solves it. Affected files ... .. //depot/projects/arm/src/sys/dev/pccbb/pccbb_pci.c#7 edit Differences ... ==== //depot/projects/arm/src/sys/dev/pccbb/pccbb_pci.c#7 (text+ko) ==== @@ -302,10 +302,11 @@ { static int curr_bus_number = 2; /* XXX EVILE BAD (see below) */ struct cbb_softc *sc = (struct cbb_softc *)device_get_softc(brdev); + struct sysctl_ctx_list *sctx; + struct sysctl_oid *soid; int rid; device_t parent; - struct sysctl_ctx_list *sctx; - struct sysctl_oid *soid; + uint32_t pribus; parent = device_get_parent(brdev); mtx_init(&sc->mtx, device_get_nameunit(brdev), "cbb", MTX_DEF); @@ -317,7 +318,7 @@ sc->exca[0].pccarddev = NULL; sc->secbus = pci_read_config(brdev, PCIR_SECBUS_2, 1); sc->subbus = pci_read_config(brdev, PCIR_SUBBUS_2, 1); - sc->pribus = pci_read_config(brdev, PCIR_PRIBUS_2, 1); + sc->pribus = pcib_get_bus(parent); SLIST_INIT(&sc->rl); cbb_powerstate_d0(brdev); @@ -359,10 +360,11 @@ * are in an appropriate range. */ DEVPRINTF((brdev, "Secondary bus is %d\n", sc->secbus)); - if (sc->secbus == 0) { + pribus = pci_read_config(brdev, PCIR_PRIBUS_2, 1); + if (sc->secbus == 0 || sc->pribus != pribus) { if (curr_bus_number <= sc->pribus) curr_bus_number = sc->pribus + 1; - if (pci_read_config(brdev, PCIR_PRIBUS_2, 1) != sc->pribus) { + if (pribus != sc->pribus) { DEVPRINTF((brdev, "Setting primary bus to %d\n", sc->pribus)); pci_write_config(brdev, PCIR_PRIBUS_2, sc->pribus, 1);