[PATCH 1/2] PCI-PCI transparent bridge handling improvements (pci core)

[PATCH 1/2] PCI-PCI transparent bridge handling improvements (pci core)

Post by Dominik Br » Sat, 19 Mar 2005 08:30:17


Transparent" PCI-PCI bridges are currently "ignored" by the resource
management code in the PCI core. This means devices behind the bridge are
handled as if there was no bridge.

However, it seems more suitable -- and it seems to allow for proper
"prefetch"-type memory handling, too -- to handle a transparent PCI-PCI bridge
like any other PCI-PCI bridge, and to only break out of the limits set by
the bridge windows if the resource allocation code determines it needs to
do s.

The tricky part is in pci_find_parent_resource(). There are two types of
functions calling it: some functions already know the exact resource for
which they want to find the parent in order to properly insert it into the
resource database. This can be handled easily -- if the resource is inside
the bridge window, this is returned; if it isn't, the bridge's parent
resource is returned.

However, two callers (yenta_socket and i2o) intend something different: they
call pci_find_parent_resource() with an empty resource and want to find out
the biggest valid resource of the proper type in order to analyze it and
adapt its own hunger for resources to it. To keep this behaviour
backwards-compatible, we always need to not limit it to the bridge window
resources, but get back to the parent bus.


This patch is a modified and (hopefully) improved derivation of Linus'
"pcmcia-bridge-resource-management-fix.patch" included in 2.6.11-rc4-mm1.


Signed-off-by: Dominik Brodowski < XXXX@XXXXX.COM >

Index: 2.6.11++/drivers/pci/bus.c
===================================================================
--- 2.6.11++.orig/drivers/pci/bus.c 2005-03-17 00:39:00.000000000 +0100
+++ 2.6.11++/drivers/pci/bus.c 2005-03-17 00:39:24.000000000 +0100
@@ -18,22 +18,12 @@
#include "pci.h"

/**
- * pci_bus_alloc_resource - allocate a resource from a parent bus
- * @bus: PCI bus
- * @res: resource to allocate
- * @size: size of resource to allocate
- * @align: alignment of resource to allocate
- * @min: minimum /proc/iomem address to allocate
- * @type_mask: IORESOURCE_* type flags
- * @alignf: resource alignment function
- * @alignf_data: data argument for resource alignment function
+ * pci_one_bus_alloc_resource - allocate a resource from one specific bus
*
- * Given the PCI bus a device resides on, the size, minimum address,
- * alignment and type, try to find an acceptable resource allocation
- * for a specific device resource.
+ * Always use pci_bus_alloc_resource() described below.
*/
-int
-pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res,
+static int
+pci_one_bus_alloc_resource(struct pci_bus *bus, struct resource *res,
unsigned long size, unsigned long align, unsigned long min,
unsigned int type_mask,
void (*alignf)(void *, struct resource *,
@@ -69,6 +59,48 @@
}

/**
+ * pci_bus_alloc_resource - allocate a resource from a parent bus
+ * @bus: PCI bus
+ * @res: resource to allocate
+ * @size: size of resource to allocate
+ * @align: alignment of resource to allocate
+ * @min: minimum /proc/iomem address to allocate
+ * @type_mask: IORESOURCE_* type flags
+ * @alignf: resource alignment function
+ * @alignf_data: data argument for resource alignment function
+ *
+ * Given the PCI bus a device resides on, the size, minimum address,
+ * alignment and type, try to find an acceptable resource allocation
+ * for a specific device resource.
+ */
+int
+pci_bus_alloc_resource(s
 
 
 

1. Updating PCI/PCI Express configuration values for PCI/PCI Express bridge

2. PCI Standard PCI-PCI Bridge Duplicated

For some time now I've had this conflict between my Hercules Prophet 4000XT
Video card and my network card. The PCI Standard PCI-PCI Bridge is
duplicated and both are linked to it. If I disable the one linked to the
NIC the video card is recognized by Win2k and works properly. Otherwise
there are memory and resource conflicts that I can not alter because
windows arrogantly will not allow it. ACPI management is an example of
mismanagement of MY computer. Is there a solution or do I need to get
another computer?

Paul

3. PCI Standard PCI-to-PCI Bridge

4. PCI Standard PCI-to-PCI bridge

5. Accessing PCI-to-PCI bridge in PCI Configuration Space

6. [PATCH 1/7]: PCI revised (3) [PATCH 16/42]: PCI: PCI Error reporting callbacks

7. [PATCH 1/7]: PCI revised [PATCH 16/42]: PCI: PCI Error reporting callbacks

8. [PATCH 1/7]: PCI revised (2) [PATCH 16/42]: PCI: PCI Error reporting callbacks

9. [PATCH 1/7]: PCI revised [PATCH 16/42]: PCI: PCI Error reporting callbacks

10. [PATCH 1/7]: PCI revised (2) [PATCH 16/42]: PCI: PCI Error reporting callbacks

11. [PATCH] PCI: drivers/pci/pci.c: #if 0 pci_find_ext_capability()

12. [PATCH] PCI: add linux-pci mailing list to PCI maintainers entry.

13. [PATCH] PCI: drivers/pci/pci.c: remove pci_dac_set_dma_mask

14. [PATCH] PCI Hotplug: PCI panic on dlpar add (add pci slot to running partition)

15. [PATCH 00/14] pci: update pci bridge resources