From parag@pinhead.parag.codegen.com Thu Sep  2 14:25:45 1999
Return-Path: <parag@pinhead.parag.codegen.com>
Received: from pinhead.parag.codegen.com (207-44-235-154.CodeGen.COM [207.44.235.154])
	by hub.freebsd.org (Postfix) with ESMTP id DDFB214C83
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  2 Sep 1999 14:25:44 -0700 (PDT)
	(envelope-from parag@pinhead.parag.codegen.com)
Received: (from parag@localhost)
	by pinhead.parag.codegen.com (8.9.3/8.9.3) id OAA10698;
	Thu, 2 Sep 1999 14:25:06 -0700 (PDT)
	(envelope-from parag)
Message-Id: <199909022125.OAA10698@pinhead.parag.codegen.com>
Date: Thu, 2 Sep 1999 14:25:06 -0700 (PDT)
From: parag@codegen.com
Sender: parag@pinhead.parag.codegen.com
Reply-To: parag@codegen.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: Too-verbose output from PCI probe at bootup
X-Send-Pr-Version: 3.2

>Number:         13546
>Category:       kern
>Synopsis:       Too-verbose output from PCI probe at bootup
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    se
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep  2 14:30:01 PDT 1999
>Closed-Date:    Wed Dec 31 08:10:24 PST 2003
>Last-Modified:  Wed Dec 31 08:10:24 PST 2003
>Originator:     Parag Patel
>Release:        FreeBSD 3.2-STABLE i386
>Organization:
CodeGen, Inc.
>Environment:

	4xPentium-Pro/200Mhz system with 2 PCI buses on board

>Description:

	The PCI probe code is much too verbose when it probes for PCI
	busses that do not exist.  On this system, I get this message:
		Probing for devices on PCI bus 2
		Probing for devices on PCI bus 3
		...
		Probing for devices on PCI bus 255
	about 255 times.  I'm not sure why it's so chatty, and CURRENT
	does not display all these messages.

	My fix below simply puts the verbose messages under
	"bootverbose", so the messages can still be displayed if one
	boots "-v" but not otherwise.

>How-To-Repeat:

	Simply boot the kernel on a similar machine.

>Fix:
	
***************
*** 547,553 ****
        while (bus <= bushigh) {
                int newbushigh;

!               printf("Probing for devices on PCI bus %d:\n", bus);
                newbushigh = pci_probebus(bus);

                if (bushigh < newbushigh)
--- 547,555 ----
        while (bus <= bushigh) {
                int newbushigh;

!               if (bootverbose)
!                       printf("Probing for devices on PCI bus %d:\n", bus);
!
                newbushigh = pci_probebus(bus);

                if (bushigh < newbushigh)



>Release-Note:
>Audit-Trail:

From: Parag Patel <parag@cgt.com>
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: kern/13546: Too-verbose output from PCI probe at bootup
Date: Mon, 06 Sep 1999 14:08:03 -0700

 Following up to my easlier bug-report (kern/13546), I looked over the
 PCI code in STABLE and CURRENT more closely.  The CURRENT code does not
 display this messaage because the code is no longer there!
 
 CURRENT probes for and attaches PCI bridges as bus/devices and STABLE
 does not.
 
 In pci/pci.c, the STABLE version uses the "bushigh" return value from
 pci_probebus() to determine the next PCI bus number to probe.  My guess
 is that the 4xPPRO box I've got lies and always returns one more bus to
 probe for this code.
 
 CURRENT's pci/pci.c however doesn't use this "bushigh" information from
 pci_add_children(), and indeed doesn't use its return value at all.
 (The code determining bushigh can be deleted and pci_add_children should
 return "void".)  It seems to detect the bridge chip and attach that as a
 device and then probes under it.  STABLE doesn't seem to do this and
 its code is scattered with XXX througout.
 
 So I think my earlier patch for simply wrapping the "Probing PCI bus"
 message with an "if (bootverbose)" is the right solution/workaround for
 systems like mine.  Not that it's a big deal - it's easy enough for me
 to patch by hand - but I thought that others may be similarly afflicted.
 
 
 	-- Parag Patel
 

From: Parag Patel <parag@cgt.com>
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: kern/13546: Too-verbose output from PCI probe at bootup
Date: Thu, 09 Sep 1999 10:41:51 -0700

 Here's a better fix.  Turns out that this 4xPPro box has two "Orion"
 chips in it, and the code that picks off the number of subordinate buses
 returns 255 for whatever reason.  The fix is copied from the
 fixbushigh_450nx() routine into the fixbushigh_orion() routine, which
 appears to have the same problem.
 
 The fix could be made generic and moved out of both bushigh routines if
 there are no systems out there with 255 subordinate buses.  The magic
 number 255 may mean different things to different chipsets so I settled
 for this Orion-specific fix.
 
 
 	-- Parag Patel
 
 
 
 *** /sys/pci/pcisupport.c       Sat Sep  4 04:02:49 1999
 - --- pcisupport.c        Wed Sep  8 12:03:00 1999
 ***************
 *** 129,134 ****
 - --- 129,149 ----
   {
         tag->secondarybus = pci_cfgread(tag, 0x4a, 1);
         tag->subordinatebus = pci_cfgread(tag, 0x4b, 1);
 +
 +       if (tag->subordinatebus == 255) {
 +               printf("fixbushigh_orion: bogus highest PCI bus %d",
 +                      tag->subordinatebus);
 + #ifdef NBUS
 +               tag->subordinatebus = NBUS - 2;
 + #else
 +               tag->subordinatebus = 10;
 + #endif
 +               printf(", reduced to %d\n", tag->subordinatebus);
 +       }
 +
 +       if (bootverbose)
 +               printf("fixbushigh_orion: subordinatebus is %d\n",
 +                       tag->subordinatebus);
   }
 
   static void
 
Responsible-Changed-From-To: freebsd-bugs->se 
Responsible-Changed-By: johan 
Responsible-Changed-When: Thu Aug 24 07:50:40 PDT 2000 
Responsible-Changed-Why:  
Stefan, you commited the code in pci.c which the first of the two 
patches deals with. Can you please have a look at this and close 
this PR if you do not think it is worth fixing in RELENG_3. 

It is already fixed in RELENG_4 and HEAD according to the originator. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=13546 
State-Changed-From-To: open->closed 
State-Changed-By: jhb 
State-Changed-When: Wed Dec 31 08:09:39 PST 2003 
State-Changed-Why:  
RELENG_3 is now a dormant branch.  The submitter reports that RELENG_4 and 
later branches do not have this bug. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=13546 
>Unformatted:
