linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yinghai Lu <yinghai.lu@oracle.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org, linux-arch@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Jesse Barnes <jbarnes@virtuousgeek.org>
Subject: Re: [PATCH v2 06/29] x86/PCI: convert to pci_create_root_bus() and pci_scan_root_bus()
Date: Fri, 14 Oct 2011 14:15:35 -0700	[thread overview]
Message-ID: <4E98A677.6050507@oracle.com> (raw)
In-Reply-To: <CAErSpo4629XKU=TNp0cb6Cxc+Jm_dQcD4244eTna2TC49_EtTw@mail.gmail.com>

On 10/14/2011 01:54 PM, Bjorn Helgaas wrote:

> On Fri, Oct 14, 2011 at 2:39 PM, Yinghai Lu <yinghai.lu@oracle.com> wrote:
>> On 10/14/2011 01:32 PM, Bjorn Helgaas wrote:
>>
>>
>>>>>       int node;
>>>>> @@ -353,11 +349,18 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_pci_root *root)
>>>>>               memcpy(bus->sysdata, sd, sizeof(*sd));
>>>>>               kfree(sd);
>>>>>       } else {
>>>>> -             bus = pci_create_bus(NULL, busnum, &pci_root_ops, sd);
>>>>> -             if (bus) {
>>>>> -                     get_current_resources(device, busnum, domain, bus);
>>>>> -                     bus->subordinate = pci_scan_child_bus(bus);
>>>>> +             INIT_LIST_HEAD(&resources);
>>>>> +             get_current_resources(device, busnum, domain, &resources);
>>>>> +             if (!pci_use_crs) {
>>>>> +                     pci_free_resource_list(&resources);
>>>>> +                     x86_pci_root_bus_resources(busnum, &resources);
>>>>>               }
>>>>
>>>>
>>>> You may need to update get_current_resources() to return status about handling _CRS...
>>>> and check that status insteaf of !pci_use_crs.
>>>
>>> Is the current patch broken here?  I don't think it will be simpler to
>>> have get_current_resources() return a status and check that.  But if
>>> something's actually broken, I want to fix it, of course.
>>>
>>
>>
>> yes. if for some reason, _CRS is not handled right, that root bus resources will not get set to default res.
>>
>> +             status = get_current_resources(device, busnum, domain, &resources);
>> +             if (status) {
>> +                     pci_free_resource_list(&resources);
>> +                     x86_pci_root_bus_resources(busnum, &resources);
>>              }
>>
>> get_current_resources() will not return 0 if _CRS is not really used.
> 
> OK.  I think it was that way before, too.  We created the bus with
> default resources, but the first thing get_current_resources() did was
> clear them all out.  If there was a problem parsing _CRS, we never
> went back and put the defaults back in.


that means you broke it when you clean up it last time. 

> 
> But I think this will do what you suggest and is nicer than what I had before:
> 
>                 INIT_LIST_HEAD(&resources);
>                 get_current_resources(device, busnum, domain, &resources);
>                 if (list_empty(&resources))
>                         x86_pci_root_bus_resources(busnum, &resources);


yes, that should work.

Yinghai

  parent reply	other threads:[~2011-10-14 21:15 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-14  4:27 [PATCH v2 00/29] Create PCI root buses with correct resources Bjorn Helgaas
2011-10-14  4:27 ` [PATCH v2 01/29] PCI: add helpers for building PCI bus resource lists Bjorn Helgaas
2011-10-14  4:27   ` Bjorn Helgaas
2011-10-14  4:27 ` [PATCH v2 02/29] PCI: add pci_create_root_bus(), deprecate pci_create_bus() Bjorn Helgaas
2011-10-14  4:27   ` Bjorn Helgaas
2011-10-14  4:27 ` [PATCH v2 03/29] PCI: add pci_scan_root_bus(), deprecate pci_scan_bus() and pci_scan_bus_parented() Bjorn Helgaas
2011-10-14  4:27   ` Bjorn Helgaas
2011-10-14  4:27 ` [PATCH v2 04/29] MIPS: PCI: convert to pci_scan_root_bus() for correct root bus resources Bjorn Helgaas
2011-10-14  4:27   ` Bjorn Helgaas
2011-10-14  4:27 ` [PATCH v2 05/29] x86/PCI: use pci_scan_bus() instead of pci_scan_bus_parented() Bjorn Helgaas
2011-10-14  4:27   ` Bjorn Helgaas
2011-10-14  4:27 ` [PATCH v2 06/29] x86/PCI: convert to pci_create_root_bus() and pci_scan_root_bus() Bjorn Helgaas
2011-10-14  5:30   ` Yinghai Lu
2011-10-14 20:32     ` Bjorn Helgaas
2011-10-14 20:39       ` Yinghai Lu
2011-10-14 20:54         ` Bjorn Helgaas
2011-10-14 20:54           ` Bjorn Helgaas
2011-10-14 21:15           ` Yinghai Lu [this message]
2011-10-14 21:15             ` Yinghai Lu
2011-10-14  4:27 ` [PATCH v2 07/29] powerpc/PCI: make pcibios_setup_phb_resources() static Bjorn Helgaas
2011-10-14  4:27   ` Bjorn Helgaas
2011-10-14  4:27 ` [PATCH v2 08/29] powerpc/PCI: split PHB part out of pcibios_map_io_space() Bjorn Helgaas
2011-10-14  4:27   ` Bjorn Helgaas
2011-10-14  4:27 ` [PATCH v2 09/29] powerpc/PCI: convert to pci_create_root_bus() for correct root bus resources Bjorn Helgaas
2011-10-14  4:27   ` Bjorn Helgaas
2011-10-14  7:34   ` Benjamin Herrenschmidt
2011-10-14  4:27 ` [PATCH v2 10/29] microblaze/PCI: fix pci_bus_for_each_resource() usage Bjorn Helgaas
2011-10-14  4:27   ` Bjorn Helgaas
2011-10-14  4:28 ` [PATCH v2 11/29] microblaze/PCI: make pcibios_setup_phb_resources() static Bjorn Helgaas
2011-10-14  4:28   ` Bjorn Helgaas
2011-10-14  4:28 ` [PATCH v2 12/29] microblaze/PCI: convert to pci_create_root_bus() for correct root bus resources Bjorn Helgaas
2011-10-14  4:28   ` Bjorn Helgaas
2011-10-14  4:28 ` [PATCH v2 13/29] microblaze/PCI: use pci_scan_root_bus() Bjorn Helgaas
2011-10-14  4:28   ` Bjorn Helgaas
2011-10-14  4:28 ` [PATCH v2 14/29] sparc/PCI: convert to pci_create_root_bus() for correct root bus resources Bjorn Helgaas
2011-10-14  4:28   ` Bjorn Helgaas
2011-10-14  4:46   ` David Miller
2011-10-14  4:46     ` David Miller
2011-10-14  4:49     ` David Miller
2011-10-14  4:28 ` [PATCH v2 15/29] sparc32, leon/PCI: convert to pci_scan_root_bus() " Bjorn Helgaas
2011-10-14  4:28   ` Bjorn Helgaas
2011-10-14  4:43   ` David Miller
2011-10-14  4:28 ` [PATCH v2 16/29] ia64/PCI: use pci_create_bus() instead of pci_scan_bus_parented() Bjorn Helgaas
2011-10-14  4:28   ` Bjorn Helgaas
2011-10-14  4:28 ` [PATCH v2 17/29] ia64/PCI: convert to pci_create_root_bus() for correct root bus resources Bjorn Helgaas
2011-10-14  4:28   ` Bjorn Helgaas
2011-10-14  4:28 ` [PATCH v2 18/29] parisc/PCI: use pci_create_root_bus() instead of pci_scan_bus_parented() Bjorn Helgaas
2011-10-14  4:28   ` Bjorn Helgaas
2011-10-14  4:28 ` [PATCH v2 19/29] parisc/PCI: supply root bus resources to pci_create_root_bus() Bjorn Helgaas
2011-10-14  4:28   ` Bjorn Helgaas
2011-10-14  4:28 ` [PATCH v2 20/29] parisc/PCI: deal with LMMIO/PAT overlaps before creating PCI root bus Bjorn Helgaas
2011-10-14  4:28 ` [PATCH v2 21/29] parisc/PCI: use pci_create_root_bus() instead of pci_scan_bus_parented() Bjorn Helgaas
2011-10-14  4:28   ` Bjorn Helgaas
2011-10-14  4:28 ` [PATCH v2 22/29] parisc/PCI: supply root bus resources to pci_create_root_bus() Bjorn Helgaas
2011-10-14  4:28   ` Bjorn Helgaas
2011-10-14  4:29 ` [PATCH v2 23/29] xen/PCI: use pci_create_root_bus() instead of pci_scan_bus_parented() Bjorn Helgaas
2011-10-14  4:29   ` Bjorn Helgaas
2011-10-14  4:29 ` [PATCH v2 24/29] alpha/PCI: convert to pci_scan_root_bus() for correct root bus resources Bjorn Helgaas
2011-10-14  4:29   ` Bjorn Helgaas
2011-10-14  4:29 ` [PATCH v2 25/29] arm/PCI: " Bjorn Helgaas
2011-10-14  4:29 ` [PATCH v2 26/29] frv/PCI: " Bjorn Helgaas
2011-10-14  4:29   ` Bjorn Helgaas
2011-10-14  4:29 ` [PATCH v2 27/29] mn10300/PCI: " Bjorn Helgaas
2011-10-14  4:29   ` Bjorn Helgaas
2011-10-14  4:29 ` [PATCH v2 28/29] sh/PCI: " Bjorn Helgaas
2011-10-14  4:29   ` Bjorn Helgaas
2011-10-14  4:29 ` [PATCH v2 29/29] xtensa/PCI: " Bjorn Helgaas
2011-10-14  4:29   ` Bjorn Helgaas
2011-10-14 15:14 ` [PATCH v2 00/29] Create PCI root buses with correct resources James Bottomley
2011-10-14 15:14   ` James Bottomley
2011-10-14 15:33   ` Bjorn Helgaas
2011-10-14 15:45     ` James Bottomley
2011-10-14 15:45       ` James Bottomley
2011-10-14 17:21       ` Bjorn Helgaas
2011-10-14 17:21         ` Bjorn Helgaas
2011-12-20 15:55       ` Bjorn Helgaas
2011-12-20 15:55         ` Bjorn Helgaas
2011-12-22 18:59         ` David Miller
2011-12-22 19:15           ` David Miller
2011-12-22 19:15             ` David Miller
2011-12-22 19:56             ` David Miller
2011-12-22 22:02               ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E98A677.6050507@oracle.com \
    --to=yinghai.lu@oracle.com \
    --cc=bhelgaas@google.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).