linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Myron Stowe <mstowe@redhat.com>
To: Yinghai Lu <yinghai@kernel.org>
Cc: Myron Stowe <myron.stowe@redhat.com>,
	bhelgaas@google.com, linux-pci@vger.kernel.org,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 06/15] PCI/acpiphp: Convert "acpiphp" sub-driver's functionality to built-in only
Date: Fri, 07 Dec 2012 12:11:04 -0700	[thread overview]
Message-ID: <1354907464.2419.34.camel@zim.stowe> (raw)
In-Reply-To: <CAE9FiQUh_jcoemFpeiAKHr4FyxSA4itHycNwJk+Dhf45Ap5prA@mail.gmail.com>

On Thu, 2012-12-06 at 22:48 -0800, Yinghai Lu wrote:
> On Thu, Dec 6, 2012 at 10:25 PM, Myron Stowe <myron.stowe@redhat.com> wrote:
> > The "ACPI Hot Plug PCI Controller ("acpiphp")" sub-driver may be compiled
> > as a module.  Kernel modules are instantiated somewhat randomly - the
> > order in which they are linked as the kernel as built - thus if there are
> > any dependencies on the ordering of attaching sub-drivers, they can not be
> > effectively dealt with.
> >
> > This patch series resolves any potential sequencing inter-dependencies by
> > converting "acpiphp" sub-driver's functionality to being only supported as
> > statically built-in to the kernel.  Inter-dependencies can then be
> > effectively handled by explicitly sequencing the addition of such
> > functionality.
> 
> some slots may support both acpiphp and pciehp.
> 
> if make acpiphp to be built-in, user do not have choice anymore.

What area are you worried about and how do we exercise that choice
today?

Here is my current understanding to set a little context -

I see the following call chains with respect to pciehp and acpiphp:

  pcied_init			# pciehp module_init
    pciehp_firmware_init
      pciehp_acpi_slot_detection_init
        parse_detect_mode	#pcie, acpi, auto (default)
    pcie_port_service_register


  acpiphp_init					# module_init
    init_acpi
      acpiphp_glue_init
        acpi_pci_register_driver(&acpi_pci_hp_driver)
          list_for_each_entry(root, &acpi_pci_roots, node)
            driver->add				# for \_SB_.PCI0
              add_bridge
                add_host_bridge
                  bridge = kzalloc(struct acpiphp_bridge)
                  bridge->handle = handle	# \_SB_.PCI0
                  bridge->pci_bus = root_bus	#pci_bus 0000:00
                  init_bridge_misc
                    acpi_walk_namespace(..., register_slot, ...)
                      register_slot
                        if (device_is_managed_by_native_pciehp(pdev))
                          return AE_OK

Does pciehp influence device_is_managed_by_native_pciehp()?  If not, it
seems that the acpiphp driver will never attach.

Looking at ./drivers/pci/hotplug/Makefile, CONFIG_HOTPLUG_PCI_PCIE comes
before CONFIG_HOTPLUG_PCI_ACPI so if pciehp and acpiphp are both
configured as modules then the load order would seem to be:
  acpiphp, pciehp: acpiphp ignores, pciehp claims
  pciehp, acpiphp: pciehp claims, acpiphp ignores

To complete the matrix taking built-in vs. module into account -
  pciehp=y, acpiphp=y
    pciehp, acpiphp: pciehp claims, acpiphp ignores

  pciehp=y, acpiphp=m
    pciehp, acpiphp: pciehp claims, acpiphp ignores

  pciehp=m, acpiphp=y
    acpiphp, pciehp: acpiphp ignores, pciehp claims

The above combinations all seem to end up with pciehp claiming the slot
which raises the question: How do we get acpiphp to claim a slot today?

Thanks,
 Myron 
> 
> Thanks
> 
> Yinghai



  reply	other threads:[~2012-12-07 19:11 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-07  6:24 [PATCH 00/15] PCI/ACPI: Remove "pci_root" sub-driver support Myron Stowe
2012-12-07  6:25 ` [PATCH 01/15] PCI, acpiphp: Separate out hot-add support of pci host bridge Myron Stowe
2012-12-07 19:32   ` Bjorn Helgaas
2012-12-07 21:04     ` Rafael J. Wysocki
2012-12-07 21:30     ` Yinghai Lu
2012-12-07 21:36       ` Bjorn Helgaas
2012-12-07 21:42         ` Yinghai Lu
2012-12-07  6:25 ` [PATCH 02/15] PCI/acpiphp: Fix coding style of external declarations in acpiphp.h Myron Stowe
2012-12-07  6:25 ` [PATCH 03/15] PCI/acpiphp: Leave the "acpiphp" sub-driver registered and in place Myron Stowe
2012-12-07  6:25 ` [PATCH 04/15] PCI/acpiphp: Change acpiphp_glue_init() to return void instead of 0 Myron Stowe
2012-12-07  6:25 ` [PATCH 05/15] PCI/acpiphp: Collapse initialization call chain of "acpiphp" sub-driver Myron Stowe
2012-12-07  6:25 ` [PATCH 06/15] PCI/acpiphp: Convert "acpiphp" sub-driver's functionality to built-in only Myron Stowe
2012-12-07  6:48   ` Yinghai Lu
2012-12-07 19:11     ` Myron Stowe [this message]
2012-12-07  6:25 ` [PATCH 07/15] PCI/acpiphp: Declare acpi_{add, remove}_bridge() as external functions Myron Stowe
2012-12-07  6:25 ` [PATCH 08/15] PCI/acpiphp: Collapse the initialization call chain of "acpiphp" further Myron Stowe
2012-12-07  6:25 ` [PATCH 09/15] PCI/acpiphp: Add "acpiphp" functionality statically within "pci_root" Myron Stowe
2012-12-07  6:25 ` [PATCH 10/15] PCI/acpiphp: Change acpiphp_add_bridge() to return void instead of 0 Myron Stowe
2012-12-07  6:25 ` [PATCH 11/15] PCI/ACPI: Fix latent refcount issue in acpi_pci_root_start() Myron Stowe
2012-12-07  6:26 ` [PATCH 12/15] PCI/ACPI: Move where dmi_check_system() is called from Myron Stowe
2012-12-07  6:26 ` [PATCH 13/15] PCI/ACPI: Convert "pci_slot" sub-driver's functionality to built-in only Myron Stowe
2012-12-07  6:26 ` [PATCH 14/15] PCI/ACPI: Add "pci_slot" functionality statically within "pci_root" Myron Stowe
2012-12-07  6:26 ` [PATCH 15/15] PCI/ACPI: Remove the "pci_root" driver's sub-driver infrastructure Myron Stowe

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=1354907464.2419.34.camel@zim.stowe \
    --to=mstowe@redhat.com \
    --cc=bhelgaas@google.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=myron.stowe@redhat.com \
    --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 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).