Subject: Re: Disable pci_addr_fixup printf
To: None <wileyc@rezrov.net>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: port-sgimips
Date: 12/11/2005 11:40:06
In article <20051210234037.GA7542@rezrov.net>
wileyc@rezrov.net wrote:
> > Now most PCI devices on O2 work properly, so is it okay to disable
> > printfs for pci_addr_fixup info, which might confuse some users?
>
> These bits might conceivably have debug value; how about replacing the printf()
> with aprint_debug()?
Hmm, how should we fix pciaddr_print_devid()?
It will be called both on verbose case and error case.
Is it easy to use (currently undeclared?) pcibiosverbose variable?
Usage of pciaddrverbose in i386/pci/pci_addr_fixup.c also looks
a bit strange anyway.
---
Izumi Tsutsui
Index: pci_mace.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sgimips/mace/pci_mace.c,v
retrieving revision 1.5
diff -u -r1.5 pci_mace.c
--- pci_mace.c 29 Sep 2004 04:06:52 -0000 1.5
+++ pci_mace.c 11 Dec 2005 02:31:35 -0000
@@ -93,6 +93,8 @@
unsigned int ioaddr_base = 0x1000;
unsigned int memaddr_base = 0x80100000;
+static int pcibiosverbose = 0;
+
CFATTACH_DECL(macepci, sizeof(struct macepci_softc),
macepci_match, macepci_attach, NULL, NULL);
@@ -499,23 +501,19 @@
macepci_conf_write(pc, tag, mapreg, *addr);
/* check */
-#ifdef PCIBIOSVERBOSE
- if (!pcibiosverbose)
-#endif
- {
- printf("pci_addr_fixup: ");
- pciaddr_print_devid(pc, tag);
- }
if (pciaddr_ioaddr(macepci_conf_read(pc, tag, mapreg)) != *addr) {
macepci_conf_write(pc, tag, mapreg, 0); /* clear */
+ printf("pci_addr_fixup: ");
+ pciaddr_print_devid(pc, tag);
printf("fixup failed. (new address=%#x)\n", (unsigned)*addr);
return (1);
}
-#ifdef PCIBIOSVERBOSE
- if (!pcibiosverbose)
-#endif
+ if (pcibiosverbose) {
+ printf("pci_addr_fixup: ");
+ pciaddr_print_devid(pc, tag);
printf("new address 0x%08x (size 0x%x)\n", (unsigned)*addr,
(unsigned)size);
+ }
return (0);
}