From patchwork Fri Jun 14 19:27:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 2723671 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 679AAC0AB1 for ; Fri, 14 Jun 2013 19:34:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 61A9720377 for ; Fri, 14 Jun 2013 19:34:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7B40720369 for ; Fri, 14 Jun 2013 19:34:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753924Ab3FNTeg (ORCPT ); Fri, 14 Jun 2013 15:34:36 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:59086 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753907Ab3FNTee (ORCPT ); Fri, 14 Jun 2013 15:34:34 -0400 Received: by mail-pa0-f45.google.com with SMTP id bi5so950795pad.32 for ; Fri, 14 Jun 2013 12:34:33 -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=o8kK8maWxF87kJLPhmCn3INIcLybq0Ubjh1xxD+zwIsKpBq7KnCWLR8NokZDcAvyEw 7mWarKYaxr+A5TRuxEPERggaG+23dpasN0JPCBmbIOazbWeSZ+DLcCM6etFdfwfm3hj2 nY9q1+YcV4XE8UiieC/uzsgGuEwTzNFPDh3S4y3rfKJg+QD0Pp81q8B4BVaYhU1tZziM LJ3Pq/gsZo6ibHL7Q7Wd3ib0mdzknc3wg7Yngwjw7t20VPY+x6cu2aGNQi5XXt5FmRVt 397QAkQs9Hdghho7Cu7hJ2e9kdX2v20xWpL72w5ODqYjJbYJfX7AKfAsNi2kRRJ0RXeH RHOw== X-Received: by 10.66.163.5 with SMTP id ye5mr3906378pab.60.1371238473747; Fri, 14 Jun 2013 12:34:33 -0700 (PDT) Received: from localhost.localdomain ([114.246.168.177]) by mx.google.com with ESMTPSA id tq8sm3276142pbc.30.2013.06.14.12.34.29 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 14 Jun 2013 12:34:33 -0700 (PDT) From: Jiang Liu To: "Rafael J . Wysocki" , Bjorn Helgaas , Yinghai Lu , "Alexander E . Patrakov" Cc: Jiang Liu , Greg Kroah-Hartman , Yijing Wang , linux-acpi@vger.kernel.org, Jiang Liu , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Subject: [BUGFIX v2 1/4] ACPI, DOCK: initialize dock subsystem before scanning PCI root buses Date: Sat, 15 Jun 2013 03:27:58 +0800 Message-Id: <1371238081-32260-2-git-send-email-jiang.liu@huawei.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1371238081-32260-1-git-send-email-jiang.liu@huawei.com> References: <1371238081-32260-1-git-send-email-jiang.liu@huawei.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.1 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); /*