From patchwork Thu Jun 13 16:32:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 2717851 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 648B29F3DD for ; Thu, 13 Jun 2013 16:39:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3E6CB20473 for ; Thu, 13 Jun 2013 16:39:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1C1142046F for ; Thu, 13 Jun 2013 16:39:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758366Ab3FMQfW (ORCPT ); Thu, 13 Jun 2013 12:35:22 -0400 Received: from mail-pd0-f180.google.com ([209.85.192.180]:60001 "EHLO mail-pd0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758349Ab3FMQfU (ORCPT ); Thu, 13 Jun 2013 12:35:20 -0400 Received: by mail-pd0-f180.google.com with SMTP id 10so11485190pdi.11 for ; Thu, 13 Jun 2013 09:35:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=NGhl6X/kck4PC4AeKmjf0lC+p5J8rgfy1DO0Y94HnEw=; b=aF8XW8ERV2MY1DcNoH5Dv/9h20r4HSeJXP7MzBL0ukEbPG2wav5dgcrSlNXS5RtGRd QLI9JGZNU5fZBLV8OyRpTivmJ5oiOr/rd0G4+FXnSeZaaqHGi+oeO+SrtPHEXGTnmiPf FR7ZsEJ0DpgPXYOvofUv+tTasSbUrQt+m//9VHoLM7W7ucedKJt9/dhoJrtZhEa0Ofle hmxEF6wrEsO2K0mvAYfPr4Nx8oxqr+OQADCXYcQRy03smMm7tz5RiVHSxpcUxj2w5jwc H+vjW/gDGh//WrI1yB6rUdzYcxVb2w9RVmokGgd9i9dqRnAnGO2S84F2B4N3ujcWTjZT jX7g== X-Received: by 10.66.246.194 with SMTP id xy2mr3504538pac.131.1371141320178; Thu, 13 Jun 2013 09:35:20 -0700 (PDT) Received: from localhost.localdomain ([114.250.95.159]) by mx.google.com with ESMTPSA id ty8sm176964pac.8.2013.06.13.09.35.15 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 09:35:19 -0700 (PDT) From: Jiang Liu To: "Rafael J . Wysocki" , Bjorn Helgaas , Yinghai Lu , "Alexander E . Patrakov" Cc: Jiang Liu , Greg Kroah-Hartman , Yijing Wang , Jiang Liu , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Subject: [BUGFIX 1/9] ACPI, DOCK: initialize dock subsystem before scanning PCI root buses Date: Fri, 14 Jun 2013 00:32:24 +0800 Message-Id: <1371141152-9468-2-git-send-email-jiang.liu@huawei.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1371141152-9468-1-git-send-email-jiang.liu@huawei.com> References: <1371141152-9468-1-git-send-email-jiang.liu@huawei.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Changeset "3b63aaa70e1 PCI: acpiphp: Do not use ACPI PCI subdriver mechanism" causes a regression which breaks ACPI dock support, please refer to https://bugzilla.kernel.org/show_bug.cgi?id=59501 The root cause is that changeset 3b63aaa70e1 changed the relative initialization order of ACPI dock subsystem and acpiphp driver, and acpiphp driver has dependency on ACPI dock subsystem's initialization result, so that acpiphp can't correctly detect ACPI dock stations now. On the other hand, ACPI dock is a built-in driver, so we could explicitly initialize it before the acpiphp driver is used. Signed-off-by: Jiang Liu Reported-by: Alexander E. Patrakov Tested-by: Alexander E. Patrakov Cc: "Rafael J. Wysocki" Cc: linux-acpi@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: # 3.9+ --- drivers/acpi/dock.c | 7 +------ drivers/acpi/internal.h | 5 +++++ drivers/acpi/scan.c | 1 + 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c index 4fdea38..02b0563 100644 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c @@ -1033,7 +1033,7 @@ find_dock_and_bay(acpi_handle handle, u32 lvl, void *context, void **rv) return AE_OK; } -static int __init dock_init(void) +int __init acpi_dock_init(void) { if (acpi_disabled) return 0; @@ -1062,9 +1062,4 @@ static void __exit dock_exit(void) dock_remove(dock_station); } -/* - * Must be called before drivers of devices in dock, otherwise we can't know - * which devices are in a dock - */ -subsys_initcall(dock_init); module_exit(dock_exit); diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h index 297cbf4..c610a76 100644 --- a/drivers/acpi/internal.h +++ b/drivers/acpi/internal.h @@ -40,6 +40,11 @@ void acpi_container_init(void); #else static inline void acpi_container_init(void) {} #endif +#ifdef CONFIG_ACPI_DOCK +void acpi_dock_init(void); +#else +static inline void acpi_dock_init(void) {} +#endif #ifdef CONFIG_ACPI_HOTPLUG_MEMORY void acpi_memory_hotplug_init(void); #else diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 44225cb..4148163 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -2045,6 +2045,7 @@ int __init acpi_scan_init(void) acpi_lpss_init(); acpi_container_init(); acpi_memory_hotplug_init(); + acpi_dock_init(); mutex_lock(&acpi_scan_lock); /*