From patchwork Mon Mar 7 03:16:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cilissen X-Patchwork-Id: 548927 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E681EC433EF for ; Mon, 7 Mar 2022 03:17:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234954AbiCGDSQ (ORCPT ); Sun, 6 Mar 2022 22:18:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232516AbiCGDSP (ORCPT ); Sun, 6 Mar 2022 22:18:15 -0500 Received: from wnew1-smtp.messagingengine.com (wnew1-smtp.messagingengine.com [64.147.123.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBF1645AF7 for ; Sun, 6 Mar 2022 19:17:20 -0800 (PST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id 85BCB2B0024D; Sun, 6 Mar 2022 22:17:17 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 06 Mar 2022 22:17:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yotsuba.nl; h=cc :cc:content-transfer-encoding:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm2; bh=LC0j3/G2hKvPK3P9v7Jsob3YP1xJDOoZkhPu00702s4=; b=QPTYc E4lBWiR740zuP/i60F10qhDc1am8plxYD/7WQYz4BBt6pBGPt/etw7bjGqy4lmOG EDfAmZ9dIPUNTuklrE/XHnt6Ag1xaIXQ+geGFsvWjgSjM/XOrYe5ehzGWKdE4Twt cTsJ5lM3fQX5BBD/vq+nfW3pLMBNt3VCWwept2TbZnHqO9zKE2bkh6AsFD6+Of88 88WP6T4cdByGqBu/YvQ1MDrFeK3RohU5mXdhtB8r7IRu9bU1bcpnjq9/WNw1rYjG qdzFAeA88S1ITo3R8Kx/qzz8C8PNcuvofgo9B1WjI9noZiAoofr39xWB4rlvmBE1 zR6tgi7ihpOJs8+aw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :from:from:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=LC0j3/G2hKvPK3P9v7Jsob3YP1xJD OoZkhPu00702s4=; b=Yay/FmVJlDDIGi6wv7Px8BgByxqqqwxrkj621ZIewzHx0 IkrM4mw57T/tB3idZ0M2hddtZnrZW8fAnnNN36GQ5gAeXoMydQ/VZLevMCeRXSe6 H2HgdPgFIR9ZxDsTmWCIA/WIyYujZ+G3s+uVidum00Sb4rEz0VWtIiwXcQSsz9O9 2B9vp3eCFYn4rZyIc079GTfMfhdG6bC4AfcrGQ8mNff/LtJC4utBWqraSE8Dnv+C VA1gEMQYnb//k1TCDYqbDMhHFRgRu4DYBhQiZeKxo8wnphnvf51HiPsPax294CJy GIR+G4R8wbDC+8K8apQ/s3fmQl4S3Izk7WsBzTjZQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddruddufedgheeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffoggfgsedtkeertdertddtnecuhfhrohhmpeforghrkhcuvehi lhhishhsvghnuceomhgrrhhkseihohhtshhusggrrdhnlheqnecuggftrfgrthhtvghrnh epheduveehtdelfeekgfejudevhffghfehvdetffehgfelteelheelgefftdffudehnecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhgrrhhkse ihohhtshhusggrrdhnlh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 6 Mar 2022 22:17:14 -0500 (EST) From: Mark Cilissen To: linux-acpi@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org Cc: Hans de Goede , "Rafael J. Wysocki" , Len Brown , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Mark Cilissen , kernel test robot Subject: [PATCH v3] ACPI / x86: Work around broken XSDT on Advantech DAC-BJ01 board Date: Mon, 7 Mar 2022 04:16:58 +0100 Message-Id: <20220307031658.81285-1-mark@yotsuba.nl> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On this board the ACPI RSDP structure points to both a RSDT and an XSDT, but the XSDT points to a truncated FADT. This causes all sorts of trouble and usually a complete failure to boot after the following error occurs: ACPI Error: Unsupported address space: 0x20 (*/hwregs-*) ACPI Error: AE_SUPPORT, Unable to initialize fixed events (*/evevent-*) ACPI: Unable to start ACPI Interpreter This leaves the ACPI implementation in such a broken state that subsequent kernel subsystem initialisations go wrong, resulting in among others mismapped PCI memory, SATA and USB enumeration failures, and freezes. As this is an older embedded platform that will likely never see any BIOS updates to address this issue and its default shipping OS only complies to ACPI 1.0, work around this by forcing `acpi=rsdt`. This patch, applied on top of Linux 5.10.102, was confirmed on real hardware to fix the issue. Signed-off-by: Mark Cilissen Cc: stable@vger.kernel.org Reviewed-by: Hans de Goede --- v3: - Change DMI matching criteria as per Hans's suggestion v2: - Reduce DMI match count to 4 to not overflow dmi_system_id structure Reported-by: kernel test robot - Change board ident to correct name - Fix small style issue - Fix up subject as per Rafael's changes --- arch/x86/kernel/acpi/boot.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) base-commit: 038101e6b2cd5c55f888f85db42ea2ad3aecb4b6 diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 5b6d1a95776f..0d01e7f5078c 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c @@ -1328,6 +1328,17 @@ static int __init disable_acpi_pci(const struct dmi_system_id *d) return 0; } +static int __init disable_acpi_xsdt(const struct dmi_system_id *d) +{ + if (!acpi_force) { + pr_notice("%s detected: force use of acpi=rsdt\n", d->ident); + acpi_gbl_do_not_use_xsdt = TRUE; + } else { + pr_notice("Warning: DMI blacklist says broken, but acpi XSDT forced\n"); + } + return 0; +} + static int __init dmi_disable_acpi(const struct dmi_system_id *d) { if (!acpi_force) { @@ -1451,6 +1462,19 @@ static const struct dmi_system_id acpi_dmi_table[] __initconst = { DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"), }, }, + /* + * Boxes that need ACPI XSDT use disabled due to corrupted tables + */ + { + .callback = disable_acpi_xsdt, + .ident = "Advantech DAC-BJ01", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "NEC"), + DMI_MATCH(DMI_PRODUCT_NAME, "Bearlake CRB Board"), + DMI_MATCH(DMI_BIOS_VERSION, "V1.12"), + DMI_MATCH(DMI_BIOS_DATE, "02/01/2011"), + }, + }, {} };