lkml.org 
[lkml]   [2005]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: PROBLEM: Devices behind PCI Express-to-PCI bridge not mapped
On Mon, Jun 06, 2005 at 02:27:39AM +0200, Andreas Koch wrote:
> For your reference, at this stage we appear to have a cascade of three
> bridges between a potential device (currently empty CardBus slot) and
> the CPU
>
> 1 2 3
> CPU Southbridge -> PCI Express -> PCI -> CardBus
>
> Note that the messages before this log, e.g., from ohci1394, also indicate
> that the peripherals in the docking station still remain inaccessible due to
> unmapped memory (all reads return 0xff).

Well, the problem is that bridge 1 in this chain is completely unconfigured
(it seems to be in after-reset state), while bridge 2 (PCIE-to-PCI one)
does have reasonable setup. This leads to "successful" resource allocations
on the bus 3, even though these resources are not accessible due to
incorrect setup of the bridge 1.
On the other hand, pci_assign_unassigned_resources() doesn't touch
already allocated resources, probably leaving them outside of bridge windows.

I think the correct behaviour of pcibios_allocate_bus_resources()
(arch/i386/pci/i386.c) should be as follows:
if some bridge resource cannot be allocated for whatever reason,
don't allow any child resource assignments in that range. Just
clear the resource flags - this prevents building an inconsistent
resource tree.

pci_assign_unassigned_resources() should correctly configure bridge 1
and all subordinate stuff then.

Ivan.

--- linux/arch/i386/pci/i386.c.orig Sat Mar 19 09:34:53 2005
+++ Linux/arch/i386/pci/i386.c Mon Jun 6 15:09:18 2005
@@ -106,11 +106,14 @@ static void __init pcibios_allocate_bus_
if ((dev = bus->self)) {
for (idx = PCI_BRIDGE_RESOURCES; idx < PCI_NUM_RESOURCES; idx++) {
r = &dev->resource[idx];
- if (!r->start)
- continue;
pr = pci_find_parent_resource(dev, r);
- if (!pr || request_resource(pr, r) < 0)
+ if (!r->start || !pr || request_resource(pr, r) < 0) {
printk(KERN_ERR "PCI: Cannot allocate resource region %d of bridge %s\n", idx, pci_name(dev));
+ /* Something is wrong with the region.
+ Invalidate the resource to prevent child
+ resource allocations in this range. */
+ r->flags = 0;
+ }
}
}
pcibios_allocate_bus_resources(&bus->children);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-06-06 16:47    [W:0.073 / U:0.112 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site