linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiang Liu <liuj97@gmail.com>
To: Bjorn Helgaas <bhelgaas@google.com>,
	Yinghai Lu <yinghai@kernel.org>,
	"Rafael J . Wysocki" <rjw@sisk.pl>
Cc: Jiang Liu <jiang.liu@huawei.com>,
	Yijing Wang <wangyijing@huawei.com>,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org
Subject: [PATCH 1/2] acpiphp: create companion ACPI devices before creating PCI devices
Date: Thu, 31 Jan 2013 00:10:09 +0800	[thread overview]
Message-ID: <1359562210-26536-1-git-send-email-jiang.liu@huawei.com> (raw)

From: Jiang Liu <jiang.liu@huawei.com>

With commit 4f535093cf8f6da8c "PCI: Put pci_dev in device tree as
early as possible", companion ACPI devices should be created before
creating correspoding PCI devices, otherwise it will break the ACPI
PCI binding logic.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
---
Hi Bjorn,
	This patch set applies to your pci/yinghai-root-bus branch.
There are still other potential bugs in the acpiphp driver under
investigation. So I will send out these two first to catch up with
the 3.9 merging window.
	Thanks!
	Gerry
---
 drivers/pci/hotplug/acpiphp_glue.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index bd784ff..acb7af2 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -839,6 +839,9 @@ static int __ref enable_device(struct acpiphp_slot *slot)
 	if (slot->flags & SLOT_ENABLED)
 		goto err_exit;
 
+	list_for_each_entry(func, &slot->funcs, sibling)
+		acpiphp_bus_add(func);
+
 	num = pci_scan_slot(bus, PCI_DEVFN(slot->device, 0));
 	if (num == 0) {
 		/* Maybe only part of funcs are added. */
@@ -862,9 +865,6 @@ static int __ref enable_device(struct acpiphp_slot *slot)
 		}
 	}
 
-	list_for_each_entry(func, &slot->funcs, sibling)
-		acpiphp_bus_add(func);
-
 	pci_bus_assign_resources(bus);
 	acpiphp_sanitize_bus(bus);
 	acpiphp_set_hpp_values(bus);
-- 
1.7.9.5


             reply	other threads:[~2013-01-30 16:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-30 16:10 Jiang Liu [this message]
2013-01-30 16:10 ` [PATCH 2/2] acpiphp: remove dead code for PCI host bridge hotplug Jiang Liu
2013-01-30 17:27   ` Yinghai Lu
2013-01-31 15:37     ` Jiang Liu
2013-01-31 15:59       ` Yinghai Lu
2013-02-01  8:50         ` Yijing Wang
2013-02-02  0:01           ` Yinghai Lu
2013-02-01 23:18   ` Bjorn Helgaas
2013-02-01 23:06 ` [PATCH 1/2] acpiphp: create companion ACPI devices before creating PCI devices Bjorn Helgaas
2013-02-01 23:17   ` Bjorn Helgaas
2013-02-02  2:24   ` Yijing Wang

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=1359562210-26536-1-git-send-email-jiang.liu@huawei.com \
    --to=liuj97@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=jiang.liu@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=wangyijing@huawei.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).