From patchwork Wed Aug 29 17:06:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean Delvare X-Patchwork-Id: 10580675 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E27985A4 for ; Wed, 29 Aug 2018 17:06:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CAFDA2B753 for ; Wed, 29 Aug 2018 17:06:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BEF662B76D; Wed, 29 Aug 2018 17:06:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FC752B753 for ; Wed, 29 Aug 2018 17:06:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728279AbeH2VEI (ORCPT ); Wed, 29 Aug 2018 17:04:08 -0400 Received: from mx2.suse.de ([195.135.220.15]:42446 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728003AbeH2VEI (ORCPT ); Wed, 29 Aug 2018 17:04:08 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id A6F7FAFDB; Wed, 29 Aug 2018 17:06:15 +0000 (UTC) Date: Wed, 29 Aug 2018 19:06:14 +0200 From: Jean Delvare To: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Takashi Iwai , "Zheng, Lv" , "Rafael J. Wysocki" , Len Brown Subject: [PATCH] ACPI / bus: Only call dmi_check_system on X86 Message-ID: <20180829190614.5814817b@endymion> Organization: SUSE Linux X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.31; x86_64-suse-linux-gnu) MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Calling dmi_check_system() early only works on X86. Other architectures initialize the DMI subsystem later so it's not ready yet when ACPI itself gets initialized. In the best case it results in a useless call to a function which will do nothing. But depending on the dmi implementation, it could also result in warnings. Best is to not call the function when it can't work and isn't needed. Additionally, if anyone ever needs to add non-x86 quirks, it would surprisingly not work, so document the limitation to avoid confusion. Signed-off-by: Jean Delvare Fixes: cce4f632db20 ("ACPI: fix early DSDT dmi check warnings on ia64") Cc: stable@vger.kernel.org Cc: Takashi Iwai Cc: "Zheng, Lv" Cc: "Rafael J. Wysocki" (supporter:ACPI) Cc: Len Brown (supporter:ACPI) --- drivers/acpi/bus.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) --- linux-4.17.orig/drivers/acpi/bus.c 2018-06-03 23:15:21.000000000 +0200 +++ linux-4.17/drivers/acpi/bus.c 2018-08-29 17:54:09.498532435 +0200 @@ -35,11 +35,11 @@ #include #ifdef CONFIG_X86 #include +#include #endif #include #include #include -#include #include #include "internal.h" @@ -109,10 +109,6 @@ static const struct dmi_system_id acpi_q }, {} }; -#else -static const struct dmi_system_id acpi_quirks_dmi_table[] __initconst = { - {} -}; #endif /* -------------------------------------------------------------------------- @@ -1060,8 +1056,15 @@ void __init acpi_early_init(void) acpi_permanent_mmap = true; - /* Check machine-specific quirks */ +#ifdef CONFIG_X86 + /* + * Check machine-specific quirks + * Note that calling dmi_check_system here on other architectures + * would not be OK because only x86 intializes dmi early enough. + * Thankfully only x86 systems need such quirks for now. + */ dmi_check_system(acpi_quirks_dmi_table); +#endif status = acpi_reallocate_root_table(); if (ACPI_FAILURE(status)) {