[Top] [All Lists]

Re: [RFC PATCH 1/3] MIPS: PCI: Use pci_bus_remove_resources()/pci_bus_ad

To: Bjorn Helgaas <>
Subject: Re: [RFC PATCH 1/3] MIPS: PCI: Use pci_bus_remove_resources()/pci_bus_add_resource() to set up root resources
From: Deng-Cheng Zhu <>
Date: Fri, 26 Aug 2011 07:14:16 +0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=SigOJAWfkwKH8gwrnspPgUCcmql1sJOk3uYQOVdQWqU=; b=XPKmzYQiYhsbCoyCNu3kf47Ew1CQ2FUtQg+OEK/RUsmRiyoZTBM1PIoum2iGw2/GlR qkxveKDBenRk9nXkjsyYU7vC1wEhiMmyKeNGIOsCe3YM8ncOgPJXxGBxkP++GYLUPx/A Q3XtrlDtRuvvvsMm72co2H0jwmoM1RHijeC6k=
In-reply-to: <>
References: <> <> <> <> <>
2011/8/25 Bjorn Helgaas <>:
> No, I just mean that I don't see why you need this patch at all.  If
> you pass the list of bus resources to pci_create_bus(), there's no
> need to fix anything up later.  Or am I missing something?

Well, doing the root resource fixups in here is a *paranoid* way. It's to
deal with the 'unlikely' circumstance where controller_resources() returns
the NULL pointer in pcibios_scanbus() due to memory allocation failure.
Most of the time (always) it's nothing more than repeating the resource
list setup. But maybe we can do something like this:

if (unlikely(!dev && list_empty(&bus->resources))
        pcibios_setup_root_resources(bus, hose);

What do you think?


<Prev in Thread] Current Thread [Next in Thread>