| To: | Deng-Cheng Zhu <dengcheng.zhu@gmail.com> |
|---|---|
| Subject: | Re: [RFC PATCH 1/3] MIPS: PCI: Use pci_bus_remove_resources()/pci_bus_add_resource() to set up root resources |
| From: | Bjorn Helgaas <bhelgaas@google.com> |
| Date: | Thu, 25 Aug 2011 17:23:24 -0600 |
| Cc: | jbarnes@virtuousgeek.org, ralf@linux-mips.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@linux-mips.org, eyal@mips.com, zenon@mips.com |
| Dkim-signature: | v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1314314627; bh=t7BnSVrtkKYZ85eaeJnysp9lJxs=; h=MIME-Version:In-Reply-To:References:From:Date:Message-ID:Subject: To:Cc:Content-Type:Content-Transfer-Encoding; b=jbFRNsJbVpCE6MSFprXbC+awkSMUkhBIedKGCCGYMFC3j/MLn3Evy3BzObM9Rg5td 0kVCmtLB6HIo7SSBexr8Q== |
| Dkim-signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=beta; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=aI7GADTY+4k5NNls2jlRXMrKTuROeH2ZOW4UReSm4uE=; b=TDDrWTSseF1gBHhlACkaZ+3XLaHPuC/FaV/kegsOrN/bVVx8CB3wzdQW3OCM810SjI yP4X/SOLCP4htNq4QzWA== |
| Domainkey-signature: | a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=dkim-signature:mime-version:in-reply-to:references:from:date: message-id:subject:to:cc:content-type: content-transfer-encoding:x-system-of-record; b=g/MNkgNxB/nNi7VosRg8ycttONqb7/ZK8k1pT3Ix1s02TosTdxVuPWC1lqpPpc10b OZWNR02txr44Sh2cgLBOg== |
| In-reply-to: | <CAOfQC9-kS_nVg-+2OZRGHP1X-E7B12uG63QGfB64hPAGecgFLw@mail.gmail.com> |
| References: | <1314167063-15785-1-git-send-email-dengcheng.zhu@gmail.com> <1314167063-15785-2-git-send-email-dengcheng.zhu@gmail.com> <CAErSpo4091J2pGvzZKPbKK68LWWkDyVApA7suZYn7miq=tXrQg@mail.gmail.com> <CAOfQC98Nkr7Ek3uQfiD3OdW=YC76XGjfQ4WSfoLpsm2kvqKnog@mail.gmail.com> <CAErSpo4zojYjYVd=6U72ToqiZOD-qL-saP8huwa6ShrNnaR3vA@mail.gmail.com> <CAOfQC9-kS_nVg-+2OZRGHP1X-E7B12uG63QGfB64hPAGecgFLw@mail.gmail.com> |
| Sender: | linux-mips-bounce@linux-mips.org |
On Thu, Aug 25, 2011 at 5:14 PM, Deng-Cheng Zhu <dengcheng.zhu@gmail.com> wrote: > 2011/8/25 Bjorn Helgaas <bhelgaas@google.com>: >> 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? I don't think it's worth it. Just check for failure of controller_resources(), and if it fails, skip the pci_create_bus() call. You've already printed a message (you might add the PCI domain/bus number). Bjorn |
| Previous by Date: | Re: [RFC PATCH 1/3] MIPS: PCI: Use pci_bus_remove_resources()/pci_bus_add_resource() to set up root resources, Deng-Cheng Zhu |
|---|---|
| Next by Date: | Re: [PATCH] mips/loongson: unify compiler flags and load location for Loongson 2E and 2F, Matt Turner |
| Previous by Thread: | Re: [RFC PATCH 1/3] MIPS: PCI: Use pci_bus_remove_resources()/pci_bus_add_resource() to set up root resources, Deng-Cheng Zhu |
| Next by Thread: | [RFC PATCH 2/3] PCI: Pass available resources into pci_create_bus(), Deng-Cheng Zhu |
| Indexes: | [Date] [Thread] [Top] [All Lists] |