lkml.org 
[lkml]   [2011]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [RFC PATCH 1/3] MIPS: PCI: Use pci_bus_remove_resources()/pci_bus_add_resource() to set up root resources
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-08-26 01:25    [W:0.085 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site