Re: [PATCH] pci: overwite pci bridge res regs to get big range

From: Jesse Barnes
Date: Thu Sep 17 2009 - 12:36:49 EST


On Sun, 13 Sep 2009 15:57:10 -0700
Yinghai Lu <yinghai@xxxxxxxxxx> wrote:
> Signed-off-by: Yinghai Lu <yinghai@xxxxxxxxxx>
>
> ---
> drivers/pci/setup-bus.c | 13 +++++++++++--
> 1 file changed, 11 insertions(+), 2 deletions(-)
>
> Index: linux-2.6/drivers/pci/setup-bus.c
> ===================================================================
> --- linux-2.6.orig/drivers/pci/setup-bus.c
> +++ linux-2.6/drivers/pci/setup-bus.c
> @@ -299,8 +299,17 @@ static struct resource *find_free_bus_re
> r = bus->resource[i];
> if (r == &ioport_resource || r == &iomem_resource)
> continue;
> - if (r && (r->flags & type_mask) == type
> && !r->parent)
> - return r;
> + if (r && (r->flags & type_mask) == type) {
> + if (!r->parent)
> + return r;
> + /*
> + * if there is no child under that, we
> should release
> + * and use it. don't need to reset it,
> pbus_size_* will
> + * set it again
> + */
> + if (!r->child && !release_resource(r))
> + return r;
> + }
> }
> return NULL;
> }

This does seem like a good way of getting some extra bus space... We
should have all the child resources of a given bus by this point so it
seems like it would be safe.

You ok with this Linus?

Thanks,
--
Jesse Barnes, Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/