Skip to contentSkip to conversation

powerpc: fix pci domain detection

PATCH In review Arnd Bergmann 2 participants 2 messages Sep 26, 2007 – Oct 2, 2007 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: fix pci domain detection

The /proc/bus/pci/* files list PCI domain numbers only for devices that claim to be on a multi-domain system. The check for this is broken on powerpc, because the buid value is truncated to 32 bits.

There is at least one machine (IBM QS21) that only uses the high-order bits of the buid, so the return value of pci_proc_domain() ends up being always zero, which makes /proc/bus/pci useless.

Change the logic to always return '1' for a nonzero buid value.

arch/powerpc/kernel/pci_64.c +1 -1
index 291ffbc..9f63bdc 100644
@@ -588,7 +588,7 @@ int pci_proc_domain(struct pci_bus *bus)
 		return 0;
 	else {
 		struct pci_controller *hose = pci_bus_to_host(bus);
-		return hose->buid;
+		return hose->buid != 0;
 	}
 }
 
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Arnd Bergmann

The /proc/bus/pci/* files list PCI domain numbers only for devices that claim to be on a multi-domain system. The check for this is broken on powerpc, because the buid value is truncated to 32 bits.

There is at least one machine (IBM QS21) that only uses the high-order bits of the buid, so the return value of pci_proc_domain() ends up being always zero, which makes /proc/bus/pci useless.

Quoted 4 lines

Change the logic to always return '1' for a nonzero buid value.

Good catch !

Quoted 18 lines
arch/powerpc/kernel/pci_64.c +1 -1
index 291ffbc..9f63bdc 100644
@@ -588,7 +588,7 @@ int pci_proc_domain(struct pci_bus *bus)
 		return 0;
 	else {
 		struct pci_controller *hose = pci_bus_to_host(bus);
-		return hose->buid;
+		return hose->buid != 0;
 	}
 }
 

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev