linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Prarit Bhargava <prarit@redhat.com>
To: Linux PCI <linux-pci@vger.kernel.org>
Subject: Initial APCI root bus discovery vs. rescan
Date: Mon, 25 May 2015 19:36:58 -0400	[thread overview]
Message-ID: <5563B21A.8080504@redhat.com> (raw)

During system init, acpi_pci_root_add() is called which uses ACPI information to
reserve memory and IO regions for PCI devices under the root bridge.

If I hot remove a device, by echo'ing 1 into its remove file, and then
rescanning the parent bus (in this case the same bridge discovered by
acpi_pci_root_add()) by echo'ing 1 into the rescan file, the code path calls

unsigned int pci_rescan_bus(struct pci_bus *bus)
{
        unsigned int max;

        max = pci_scan_child_bus(bus);
        pci_assign_unassigned_bus_resources(bus);
        pci_bus_add_devices(bus);

        return max;
}

which AFAICT does not take into account ACPI Memory and IO regions for devices
under the bridge.  Is there an obvious reason to do this?  Or is there some
other init required before I issue the rescan on the bus?

Or ... is this a bug?

FWIW, I am removing a PCI Serial port card by echo'ing 1 into its remove file
and then reinserting it by doing a rescan on the parent bus.  The card does not
come up with the same memory & IO as it initially had.  I would have expected
that it did come up with the same resources as the memory & IO are free... but
maybe that expectation is incorrect.

P.


P.

             reply	other threads:[~2015-05-25 23:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-25 23:36 Prarit Bhargava [this message]
2015-05-26 16:07 ` Initial APCI root bus discovery vs. rescan Bjorn Helgaas
2015-06-02 17:54   ` Prarit Bhargava
2015-06-02 20:44     ` Bjorn Helgaas
2015-06-02 22:31       ` Prarit Bhargava
2015-06-02 22:38         ` Prarit Bhargava
2015-06-02 23:38           ` Bjorn Helgaas

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=5563B21A.8080504@redhat.com \
    --to=prarit@redhat.com \
    --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).