Patchwork remove annoying noisy message

login
register
about
Submitter Stefan Reinauer
Date 2010-04-02 16:16:37
Message ID <4BB61865.9030604@coresystems.de>
Download mbox | patch
Permalink /patch/1187/
State Accepted
Headers show

Comments

Stefan Reinauer - 2010-04-02 16:16:37
On 4/2/10 6:09 PM, ron minnich wrote:
> On Fri, Apr 2, 2010 at 9:04 AM, Stefan Reinauer <stepan@coresystems.de> wrote:
>   
>> See patch
>>     
> I'm mixed on this one, but at the same time, I bet there are few
> broken devices that return 0 as there were in the old days.
I wonder, what would we do with them if we knew..

Maybe we should only print the message if something else than 0xffffffff
is read? Would that be more appropriate?
0xffffffff is the expected read-back if there is no device, and I think
that case should not be reported as "bad id"

Like the attached one

Stefan
Myles Watson - 2010-04-02 16:21:03
> Maybe we should only print the message if something else than 0xffffffff
> is read? Would that be more appropriate?
> 0xffffffff is the expected read-back if there is no device, and I think
> that case should not be reported as "bad id"
> 
> Like the attached one

Acked-by: Myles Watson <mylesgw@gmail.com>

Thanks,
Myles

Patch

Index: src/devices/pci_device.c
===================================================================
--- src/devices/pci_device.c	(revision 5344)
+++ src/devices/pci_device.c	(working copy)
@@ -910,10 +910,13 @@ 
 		dummy.path.pci.devfn = devfn;
 		id = pci_read_config32(&dummy, PCI_VENDOR_ID);
 		/* Have we found something?
-		 * Some broken boards return 0 if a slot is empty.
+		 * Some broken boards return 0 if a slot is empty, but
+		 * the expected answer is 0xffffffff
 		 */
-		if ((id == 0xffffffff) || (id == 0x00000000) ||
-		    (id == 0x0000ffff) || (id == 0xffff0000)) {
+		if (id == 0xffffffff)
+			return NULL;
+		if ((id == 0x00000000) || (id == 0x0000ffff) ||
+		    (id == 0xffff0000)) {
 			printk(BIOS_SPEW, "%s, bad id 0x%x\n", dev_path(&dummy), id);
 			return NULL;
 		}