From patchwork Wed Jan 30 16:10:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 2068621 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id B78B83FD2B for ; Wed, 30 Jan 2013 16:12:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753510Ab3A3QMP (ORCPT ); Wed, 30 Jan 2013 11:12:15 -0500 Received: from mail-pa0-f54.google.com ([209.85.220.54]:45008 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753439Ab3A3QMP (ORCPT ); Wed, 30 Jan 2013 11:12:15 -0500 Received: by mail-pa0-f54.google.com with SMTP id bi5so1165853pad.27 for ; Wed, 30 Jan 2013 08:12:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=HLfo6wg4ANy815742AJ1GS1CeriYCU3ImvHKKmkT1uo=; b=Yk3elVvNbr7isCFhWZmO39JaGkkgepuN0yquaNTdabizKKOHyXsxyFeHfu2AqVJAhg tjKtNGYyO8ZZUmf9PFtxo7QiS1kHPqetw9ZxotDgtFUPe6cysVMJJ/7sSG4UCZyrArZq N9A/tuKsjQdO6era9QSL8tUqPud78Tj5cV95oYfDhHWJ/xlCj/rp62EDOWWBXtyZGZE6 Vl2xBAFq34rCECyNVPPVoP50eZi4SWnXstqOlXbD7juXxQqT4Yd3XCIXNHiCHK6/iaB+ awZTlRHbA4GwrjA9R68xUCqOKTjj5Y+M/TKB/9XbpCnjujR/J52stGPsqP9fcX2nAGTZ 3Z1A== X-Received: by 10.66.89.132 with SMTP id bo4mr12371835pab.62.1359562334654; Wed, 30 Jan 2013 08:12:14 -0800 (PST) Received: from localhost.localdomain ([114.246.176.105]) by mx.google.com with ESMTPS id a4sm2448831paw.21.2013.01.30.08.12.05 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Jan 2013 08:12:13 -0800 (PST) From: Jiang Liu To: Bjorn Helgaas , Yinghai Lu , "Rafael J . Wysocki" Cc: Jiang Liu , Yijing Wang , 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 Message-Id: <1359562210-26536-1-git-send-email-jiang.liu@huawei.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From: Jiang Liu 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 --- 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);