lkml.org 
[lkml]   [2008]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [patch] pci: revert "PCI: remove transparent bridge sizing"
From
Date

On Wed, 2008-03-26 at 22:47 +0000, Alan Cox wrote:
> > I dunno. I'm not going to do anything in this area before 2.6.25 is out
> > because this *does* make me a bit nervous, but if somebody wants to think
> > about this and perhaps write patches for testing, that would be good.
> One way to kill off some of the assumptions and gunge would be to add
> pci_resource_assigned(resource) [or indeed just resource_assigned()].
> Iomap has similar problems - we have no portable defined "not mapped" at
> the moment, although we use NULL technically mmio maps of 0 end up at 0
> in the implementation today.

There is IORESOURCE_UNSET... We could use that. I use it to some extent
on powerpc but x86 doesn't. Though I remember spotting a code path in
setup-res.c will not clear it when actually assigning the resource to a
bus. I can't remember if that hits in practice tho. I have a patch
anyway :-)

----
[PATCH] pci: Make pci_assign_resource always clear IORESOURCE_UNSET
For bus resources pci_assign_resrouce() needs to also clear
IORESOURCE_UNSET. (For device resources, it's handled by
pci_update_resource).

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
Index: linux-merge/drivers/pci/setup-res.c
===================================================================
--- linux-merge.orig/drivers/pci/setup-res.c 2007-12-13 13:06:27.000000000 +1100
+++ linux-merge/drivers/pci/setup-res.c 2007-12-13 13:06:50.000000000 +1100
@@ -167,7 +167,8 @@ int pci_assign_resource(struct pci_dev *
(unsigned long long)res->start, pci_name(dev));
} else if (resno < PCI_BRIDGE_RESOURCES) {
pci_update_resource(dev, res, resno);
- }
+ } else
+ res->flags &= ~IORESOURCE_UNSET;

return ret;
}



\
 
 \ /
  Last update: 2008-03-27 00:25    [from the cache]
©2003-2011 Jasper Spaans