All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bhelgaas@google.com>
To: Yinghai Lu <yinghai@kernel.org>
Cc: Len Brown <lenb@kernel.org>,
	Taku Izumi <izumi.taku@jp.fujitsu.com>,
	Jiang Liu <jiang.liu@huawei.com>,
	linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: Re: [PATCH 4/8] PCI, ACPI: assign unassigned resource for hot add root bus
Date: Fri, 28 Sep 2012 21:31:25 -0600	[thread overview]
Message-ID: <CAErSpo4Or84GO-DjKcu=G7hqUo8BF8Lu7czHwfmZDecvVS-tMQ@mail.gmail.com> (raw)
In-Reply-To: <CAE9FiQW2mvXGVKF7Wn0Td+_Wafu1sPMYr-sn2zffAfBycKi=Hg@mail.gmail.com>

On Fri, Sep 28, 2012 at 7:56 PM, Yinghai Lu <yinghai@kernel.org> wrote:
> On Fri, Sep 28, 2012 at 4:46 PM, Bjorn Helgaas <bhelgaas@google.com> wrote:
>> On Thu, Sep 27, 2012 at 2:11 AM, Yinghai Lu <yinghai@kernel.org> wrote:
>>> After we get hot-added ioapic registered.
>>> pci_enable_bridges will try to enable ioapic irq for pci bridges.
>>
>> What makes this specifically related to IOAPICs?

I think you missed this question.

>>> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
>>> ---
>>>  drivers/acpi/pci_root.c |    7 +++++++
>>>  1 files changed, 7 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
>>> index bce469c..27adbfd 100644
>>> --- a/drivers/acpi/pci_root.c
>>> +++ b/drivers/acpi/pci_root.c
>>> @@ -644,12 +644,19 @@ static int acpi_pci_root_start(struct acpi_device *device)
>>>         struct acpi_pci_root *root = acpi_driver_data(device);
>>>         struct acpi_pci_driver *driver;
>>>
>>> +       if (system_state != SYSTEM_BOOTING)
>>> +               pci_assign_unassigned_bus_resources(root->bus);
>>> +
>>>         mutex_lock(&acpi_pci_root_lock);
>>>         list_for_each_entry(driver, &acpi_pci_drivers, node)
>>>                 if (driver->add)
>>>                         driver->add(root);
>>>         mutex_unlock(&acpi_pci_root_lock);
>>>
>>> +       /* need to after hot-added ioapic is registered */
>>> +       if (system_state != SYSTEM_BOOTING)
>>> +               pci_enable_bridges(root->bus);
>>
>> Theoretically, we should be able to assign resources and enable
>> bridges here regardless of the system_state.
>>
>> I think the reason you don't want to do it while SYSTEM_BOOTING is
>> because we currently do this at boot-time:
>>
>>     acpi_pci_root_add
>>         pci_scan_child_bus
>>     acpi_pci_root_start
>>         pci_bus_add_devices
>>     <account for some motherboard (PNP0C01) resources>
>>     pcibios_assign_resources            # fs_initcall
>>         pci_assign_unassigned_resources
>>             pci_enable_bridges
>>
>> and without the SYSTEM_BOOTING check, we might assign PCI resources at
>> boot-time that conflict with motherboard resources.
>>
>> Is that right?
>
> yes.
>
>>
>> This is completely non-obvious and future readers deserve a hint about
>> what's going on here.
>>
>> The right way to do this would be to pay attention to the host bridge
>> apertures, and assign resources from within the apertures.  Then we
>> could always assign PCI resources when adding a host bridge instead of
>> in an fs_initcall.  I understand we still have legacy issues and
>> machines where we still don't pay attention to _CRS.  But if we're
>> doing things to work around a broken design, it's important to be
>> aware of how the design is broken so we have some hope of eventually
>> fixing the design.
>
> that could be another big topic.

I agree, and I'm not asking you to fix that.  I'm just trying to
understand what's going on and write some comments and changelogs that
will help make this maintainable in the future.

Also note the question at the top -- your changelog calls out IOAPICs,
but I'm still not sure what this patch has to do with IOAPICs.

  reply	other threads:[~2012-09-29  3:31 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-27  8:11 [PATCH 0/8] PCI, ACPI, x86: pci root bus hotplug support pci_root.c related core changes Yinghai Lu
2012-09-27  8:11 ` [PATCH 1/8] PCI: Separate out pci_assign_unassigned_bus_resources() Yinghai Lu
2012-09-27  8:11 ` [PATCH 2/8] PCI: Move pci_rescan_bus() back to probe.c Yinghai Lu
2012-09-27  8:11 ` [PATCH 3/8] PCI: Move out pci_enable_bridges out of assign_unsigned_bus_res Yinghai Lu
2012-09-28 23:46   ` Bjorn Helgaas
2012-09-29  1:48     ` Yinghai Lu
2012-09-29  1:52       ` Yinghai Lu
2012-09-29  3:27         ` Bjorn Helgaas
2012-09-29  4:04           ` Yinghai Lu
2012-10-01 18:01             ` Bjorn Helgaas
2012-09-29  4:13         ` Yinghai Lu
2012-09-27  8:11 ` [PATCH 4/8] PCI, ACPI: assign unassigned resource for hot add root bus Yinghai Lu
2012-09-28 23:46   ` Bjorn Helgaas
2012-09-29  1:56     ` Yinghai Lu
2012-09-29  3:31       ` Bjorn Helgaas [this message]
2012-09-29  3:37         ` Jiang Liu
2012-09-29  3:37           ` Jiang Liu
2012-09-29  4:19           ` Yinghai Lu
2012-09-29  4:19             ` Yinghai Lu
2012-09-29  4:08         ` Yinghai Lu
2012-09-27  8:11 ` [PATCH 5/8] PCI: Add pci_stop_and_remove_root_bus() Yinghai Lu
2012-09-28 23:46   ` Bjorn Helgaas
2012-09-29  2:05     ` Yinghai Lu
2012-09-27  8:11 ` [PATCH 6/8] PCI, ACPI: Make acpi_pci_root_remove stop/remove pci root bus Yinghai Lu
2012-09-27  8:11 ` [PATCH 7/8] PCI, ACPI: delete root bus prt during hot remove path Yinghai Lu
2012-09-27  8:11 ` [PATCH 8/8] PCI, ACPI: remove acpi_root_driver in reserse order Yinghai Lu
2012-09-28 23:46   ` Bjorn Helgaas
2012-09-29  2:09     ` Yinghai Lu
2012-10-30  4:02 [PATCH v3 7/8] ACPI, PCI: add hostbridge removal function Bjorn Helgaas
2012-10-30 17:42 ` (unknown), Yinghai Lu
2012-10-30 17:42   ` [PATCH 4/8] PCI, ACPI: assign unassigned resource for hot add root bus Yinghai Lu

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='CAErSpo4Or84GO-DjKcu=G7hqUo8BF8Lu7czHwfmZDecvVS-tMQ@mail.gmail.com' \
    --to=bhelgaas@google.com \
    --cc=izumi.taku@jp.fujitsu.com \
    --cc=jiang.liu@huawei.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=yinghai@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.