From patchwork Wed Jun 10 13:01:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 6579331 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 72C5EC0020 for ; Wed, 10 Jun 2015 13:02:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8D268205F9 for ; Wed, 10 Jun 2015 13:02:29 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A8652205FC for ; Wed, 10 Jun 2015 13:02:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E59D07A00D; Wed, 10 Jun 2015 06:02:27 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by gabe.freedesktop.org (Postfix) with ESMTP id ABCA77A00D for ; Wed, 10 Jun 2015 06:02:26 -0700 (PDT) Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 57DE5363630; Wed, 10 Jun 2015 13:02:26 +0000 (UTC) Received: from shalem.localdomain.com (vpn1-4-95.ams2.redhat.com [10.36.4.95]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t5AD1YLH026315; Wed, 10 Jun 2015 09:02:22 -0400 From: Hans de Goede To: Darren Hart , "Rafael J. Wysocki" Subject: [PATCH 12/32] acpi-video: Move dmi_check_system from module_init to acpi_video_register Date: Wed, 10 Jun 2015 15:01:12 +0200 Message-Id: <1433941292-21530-13-git-send-email-hdegoede@redhat.com> In-Reply-To: <1433941292-21530-1-git-send-email-hdegoede@redhat.com> References: <1433941292-21530-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 Cc: Matthew Garrett , Hans de Goede , Ike Panhc , linux-acpi@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, acpi4asus-user@lists.sourceforge.net, Henrique de Moraes Holschuh , dri-devel@lists.freedesktop.org, Azael Avalos , Lee Chun-Yi , Mattia Dongili , Cezary Jackiewicz , Ben Skeggs , Corentin Chary , =?UTF-8?q?Pali=20Roh=C3=A1r?= , platform-driver-x86@vger.kernel.org, Aaron Lu X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, 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 When builtin there is no guarantee in which order module_init functions are run, so acpi_video_register() may get called from the i915 driver (if it is also builtin) before acpi_video_init() gets called, resulting in the dmi quirks not yet being parsed. This commit moves the dmi_check_system() call to acpi_video_register(), so that we can be sure the dmi quirks have always been applied before probing. Signed-off-by: Hans de Goede --- drivers/acpi/video.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index f5ffac9..b8053a8 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c @@ -380,13 +380,13 @@ acpi_video_device_lcd_set_level(struct acpi_video_device *device, int level) */ static int bqc_offset_aml_bug_workaround; -static int __init video_set_bqc_offset(const struct dmi_system_id *d) +static int video_set_bqc_offset(const struct dmi_system_id *d) { bqc_offset_aml_bug_workaround = 9; return 0; } -static struct dmi_system_id video_dmi_table[] __initdata = { +static struct dmi_system_id video_dmi_table[] = { /* * Broken _BQC workaround http://bugzilla.kernel.org/show_bug.cgi?id=13121 */ @@ -1944,6 +1944,8 @@ int acpi_video_register(void) mutex_init(&video_list_lock); INIT_LIST_HEAD(&video_bus_head); + dmi_check_system(video_dmi_table); + ret = acpi_bus_register_driver(&acpi_video_bus); if (ret) return ret; @@ -2009,8 +2011,6 @@ static int __init acpi_video_init(void) if (acpi_disabled) return 0; - dmi_check_system(video_dmi_table); - if (intel_opregion_present()) return 0;