All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/pci: Fix the initial value of hose->first_busno
@ 2015-01-30  9:48 Chunhe Lan
  2015-01-30  9:49 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 5+ messages in thread
From: Chunhe Lan @ 2015-01-30  9:48 UTC (permalink / raw)
  To: linux-pci; +Cc: benh, Chunhe Lan

When use "Intel PRO/1000 PT Quad Port Low Profile Server Adapter"
card on P5040DS and T1040RDB, 32-bit kernel does not identify this
card. This card has the four RJ-45 ports.

The bus range of every pci is "bus-range = <0 0xff>" in dts file.
So the first bus number of every pci should start from 0, and it
does not start from next_busno. The next_busno is used to count
the bus sum of all pci devices. So the value of next_busno is
accumulated.

This patch fixes this issue, and "Intel PRO/1000 PT Quad Port Low
Profile Server Adapter" card can work rightly.

Signed-off-by: Chunhe Lan <Chunhe.Lan@freescale.com>
---
 arch/powerpc/kernel/pci_32.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index 432459c..a194685 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -236,13 +236,13 @@ static int __init pcibios_init(void)
 
 	/* Scan all of the recorded PCI controllers.  */
 	list_for_each_entry_safe(hose, tmp, &hose_list, list_node) {
-		if (pci_assign_all_buses)
-			hose->first_busno = next_busno;
+		hose->first_busno = 0;
 		hose->last_busno = 0xff;
 		pcibios_scan_phb(hose);
 		pci_bus_add_devices(hose->bus);
 		if (pci_assign_all_buses || next_busno <= hose->last_busno)
-			next_busno = hose->last_busno + pcibios_assign_bus_offset;
+			next_busno += hose->last_busno +
+					pcibios_assign_bus_offset;
 	}
 	pci_bus_count = next_busno;
 
-- 
1.7.6.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-03-23  9:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-30  9:48 [PATCH] powerpc/pci: Fix the initial value of hose->first_busno Chunhe Lan
2015-01-30  9:49 ` Benjamin Herrenschmidt
2015-02-02 15:54   ` Bjorn Helgaas
2015-02-03  3:42     ` Chunhe Lan
2015-03-23  9:17       ` Chunhe.Lan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.