lkml.org 
[lkml]   [2009]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/12] pci: add pci_bridge_release_unused_res and pci_bus_release_unused_bridge_res -v2
From
Date
On Fri, 2009-12-18 at 13:24 -0800, Linus Torvalds wrote:
>
> On Fri, 18 Dec 2009, Yinghai Lu wrote:
> >
> > so later we could use it to release small resource before pci assign unassign res
>
> However, I think this one is wrong.
>
> > +static void release_child_resources(struct resource *r)
> > +{
> > + struct resource *p;
> > + resource_size_t size;
> > +
> > + p = r->child;
> > + while (p) {
> > + release_child_resources(p);
> > + release_resource(p);
>
> So not only is this releasing resources that aren't necessarily PCI
> devices, it's releasing the whole tree - regardless of how they were
> allocated and initialized. ...

Help me fill in my mental picture of these resources ... This function
just takes a struct resource, so it doesn't know whether it's a PCI,
ACPI, or other resource. But in Yinghai's usage, I think we do know
that we're starting with a PCI resource. In that case, is it possible
that some child is a non-PCI resource?

The picture in my mind is that once we are downstream of a PCI host
bridge, all child resources must be PCI, and they must all conform to
the forwarding rules for PCI bridges and so on. I know there are PCI
devices with BARs at non-standard places, so Linux wouldn't know about
those resources (and that worries me a bit when we're talking about
reprogramming a bridge window that might be upstream of such a device).
But if Linux *did* learn about those non-standard resources via a quirk
or something, I would still think of those as PCI resources, not ACPI or
something else.

Anyway, I'd like to correct my mental picture if it's mistaken.

Bjorn




\
 
 \ /
  Last update: 2009-12-21 01:07    [W:0.069 / U:0.576 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site