From owner-freebsd-i386@FreeBSD.ORG Sun Oct 17 20:10:34 2004 Return-Path: Delivered-To: freebsd-i386@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CA78D16A4CE for ; Sun, 17 Oct 2004 20:10:34 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 985FF43D49 for ; Sun, 17 Oct 2004 20:10:34 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i9HKAYti027940 for ; Sun, 17 Oct 2004 20:10:34 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i9HKAYB3027939; Sun, 17 Oct 2004 20:10:34 GMT (envelope-from gnats) Date: Sun, 17 Oct 2004 20:10:34 GMT Message-Id: <200410172010.i9HKAYB3027939@freefall.freebsd.org> To: freebsd-i386@FreeBSD.org From: "Don L. Belcher" Subject: Re: i386/71158: pci bus number 3 devices are missing on laptop [5.3-BETA5] X-BeenThere: freebsd-i386@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: "Don L. Belcher" List-Id: I386-specific issues for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Oct 2004 20:10:35 -0000 The following reply was made to PR i386/71158; it has been noted by GNATS. From: "Don L. Belcher" To: freebsd-gnats-submit@FreeBSD.org Cc: Subject: Re: i386/71158: pci bus number 3 devices are missing on laptop [5.3-BETA5] Date: Sun, 17 Oct 2004 13:09:31 -0700 This is a multi-part message in MIME format. --------------070308020307050204000202 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit By removing this change from 5.3-stable built on Oct. 17 2004 fixes the problem. Diff for /src/sys/dev/pccbb/pccbb.c between version 1.108 and 1.109 Line 683 cbb_print_config(device_t dev) Line 683 cbb_print_config(device_t dev) static int static int cbb_attach(device_t brdev) cbb_attach(device_t brdev) { { static int curr_bus_number = 1; /* XXX EVILE BAD (see below) */ struct cbb_softc *sc = (struct cbb_softc *)device_get_softc(brdev); struct cbb_softc *sc = (struct cbb_softc *)device_get_softc(brdev); int rid; int rid, bus, pribus; device_t parent; parent = device_get_parent(brdev); mtx_init(&sc->mtx, device_get_nameunit(brdev), "cbb", MTX_DEF); mtx_init(&sc->mtx, device_get_nameunit(brdev), "cbb", MTX_DEF); cv_init(&sc->cv, "cbb cv"); cv_init(&sc->cv, "cbb cv"); sc->chipset = cbb_chipset(pci_get_devid(brdev), NULL); sc->chipset = cbb_chipset(pci_get_devid(brdev), NULL); Line 758 cbb_attach(device_t brdev) Line 761 cbb_attach(device_t brdev) sc->exca.flags |= EXCA_HAS_MEMREG_WIN; sc->exca.flags |= EXCA_HAS_MEMREG_WIN; sc->exca.chipset = EXCA_CARDBUS; sc->exca.chipset = EXCA_CARDBUS; cbb_chipinit(sc); cbb_chipinit(sc); /* * This is a gross hack. We should be scanning the entire pci * tree, assigning bus numbers in a way such that we (1) can * reserve 1 extra bus just in case and (2) all sub busses * are in an appropriate range. */ bus = pci_read_config(brdev, PCIR_SECBUS_2, 1); pribus = pcib_get_bus(parent); DEVPRINTF((brdev, "Secondary bus is %d\n", bus)); if (bus == 0) { if (curr_bus_number < pribus) curr_bus_number = pribus + 1; if (pci_read_config(brdev, PCIR_PRIBUS_2, 1) != pribus) { DEVPRINTF((brdev, "Setting primary bus to %d\n", pribus)); pci_write_config(brdev, PCIR_PRIBUS_2, pribus, 1); } bus = curr_bus_number; DEVPRINTF((brdev, "Secondary bus set to %d subbus %d\n", bus, bus + 1)); sc->secbus = bus; sc->subbus = bus + 1; pci_write_config(brdev, PCIR_SECBUS_2, bus, 1); pci_write_config(brdev, PCIR_SUBBUS_2, bus + 1, 1); curr_bus_number += 2; } /* attach children */ /* attach children */ sc->cbdev = device_add_child(brdev, "cardbus", -1); sc->cbdev = device_add_child(brdev, "cardbus", -1); --------------070308020307050204000202 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit



By removing this change from 5.3-stable built on Oct. 17 2004 fixes the problem.

Diff for /src/sys/dev/pccbb/pccbb.c between version 1.108 and 1.109

Line 683  cbb_print_config(device_t dev)
Line 683  cbb_print_config(device_t dev)
 static int  static int
 cbb_attach(device_t brdev)  cbb_attach(device_t brdev)
 {  {
           static int curr_bus_number = 1; /* XXX EVILE BAD (see below) */
         struct cbb_softc *sc = (struct cbb_softc *)device_get_softc(brdev);          struct cbb_softc *sc = (struct cbb_softc *)device_get_softc(brdev);
         int rid;          int rid, bus, pribus;
           device_t parent;
   
           parent = device_get_parent(brdev);
         mtx_init(&sc->mtx, device_get_nameunit(brdev), "cbb", MTX_DEF);          mtx_init(&sc->mtx, device_get_nameunit(brdev), "cbb", MTX_DEF);
         cv_init(&sc->cv, "cbb cv");          cv_init(&sc->cv, "cbb cv");
         sc->chipset = cbb_chipset(pci_get_devid(brdev), NULL);          sc->chipset = cbb_chipset(pci_get_devid(brdev), NULL);
Line 758  cbb_attach(device_t brdev)
Line 761  cbb_attach(device_t brdev)
         sc->exca.flags |= EXCA_HAS_MEMREG_WIN;          sc->exca.flags |= EXCA_HAS_MEMREG_WIN;
         sc->exca.chipset = EXCA_CARDBUS;          sc->exca.chipset = EXCA_CARDBUS;
         cbb_chipinit(sc);          cbb_chipinit(sc);
   
           /*
            * This is a gross hack.  We should be scanning the entire pci
            * tree, assigning bus numbers in a way such that we (1) can
            * reserve 1 extra bus just in case and (2) all sub busses
            * are in an appropriate range.
            */
           bus = pci_read_config(brdev, PCIR_SECBUS_2, 1);
           pribus = pcib_get_bus(parent);
           DEVPRINTF((brdev, "Secondary bus is %d\n", bus));
           if (bus == 0) {
                   if (curr_bus_number < pribus)
                           curr_bus_number = pribus + 1;
                   if (pci_read_config(brdev, PCIR_PRIBUS_2, 1) != pribus) {
                           DEVPRINTF((brdev, "Setting primary bus to %d\n", pribus));
                           pci_write_config(brdev, PCIR_PRIBUS_2, pribus, 1);
                   }
                   bus = curr_bus_number;
                   DEVPRINTF((brdev, "Secondary bus set to %d subbus %d\n", bus,
                       bus + 1));
                   sc->secbus = bus;
                   sc->subbus = bus + 1;
                   pci_write_config(brdev, PCIR_SECBUS_2, bus, 1);
                   pci_write_config(brdev, PCIR_SUBBUS_2, bus + 1, 1);
                   curr_bus_number += 2;
           }
   
         /* attach children */          /* attach children */
         sc->cbdev = device_add_child(brdev, "cardbus", -1);          sc->cbdev = device_add_child(brdev, "cardbus", -1);

--------------070308020307050204000202--