From patchwork Wed Jun 13 18:22:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geoff Levand X-Patchwork-Id: 10462799 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 67F1A60329 for ; Wed, 13 Jun 2018 18:22:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 55B3228FF1 for ; Wed, 13 Jun 2018 18:22:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A31528FF8; Wed, 13 Jun 2018 18:22:44 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0114528FF1 for ; Wed, 13 Jun 2018 18:22:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Date:Message-ID:Subject: From:To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=YcfPudUqLRi75D4KntqIwOe/9z/nuFMAU+JHCjLlxP0=; b=UXpt9iSQBTvXXf 38npRu5XNKSxJ4tVi1L3wXFs5yVkmDDkNpaTQUYdqeY+z0LmZccjQ2sGi866h1NyzCzjh7o2ig1GR ptNQ4fXgKpTYd1YDFqz331dE2HiU3xH69GxH6fpVxbUQGbm+NCcFhC8ZA0gSX3KiGiFZBfT+BhhAx KeIfD85v8wRZPrv7DUdc/xwC6SPMs2xjbAB8WVgT2qFG9LMoYB84Lnb3unKIPTxR5bqmiRz1DWwqp hgMZloMlXrzYKvCMhuCzXNea0B4iL6ZP2GdnEg7D2ieJHCa0sxhK3Ziamp5bsG8q0b+Nuhsg1NRq/ 1bJvy7nzIFgVqksYIxJA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fTAPh-0000ma-KX; Wed, 13 Jun 2018 18:22:33 +0000 Received: from 50-233-148-156-static.hfc.comcastbusiness.net ([50.233.148.156] helo=[10.18.6.178]) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fTAPf-0000m2-9V; Wed, 13 Jun 2018 18:22:31 +0000 To: linux-acpi@vger.kernel.org From: Geoff Levand Subject: [PATCH] arm64/acpi: Add fixup for HPE m400 quirks Message-ID: <51d3d738-cdf5-2992-bba5-c3e1f34096c2@infradead.org> Date: Wed, 13 Jun 2018 11:22:30 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 Content-Language: en-US X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lorenzo Pieralisi , Riku Voipio , Sudeep Holla , Hanjun Guo , Mark Salter , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Adds a new ACPI init routine acpi_fixup_m400_quirks that adds a work-around for HPE ProLiant m400 APEI firmware problems. The work-around disables APEI when CONFIG_ACPI_APEI is set and m400 firmware is detected. Without this fixup m400 systems experience errors like these on startup: [Hardware Error]: Hardware error from APEI Generic Hardware Error Source: 2 [Hardware Error]: event severity: fatal [Hardware Error]: Error 0, type: fatal [Hardware Error]: section_type: memory error [Hardware Error]: error_status: 0x0000000000001300 [Hardware Error]: error_type: 10, invalid address Kernel panic - not syncing: Fatal hardware error! Signed-off-by: Geoff Levand Tested-by: Riku Voipio Reviewed-by: Graeme Gregory --- Hi, It seems unlikely there will be any m400 firmware updates to fix this problem. APEI support is desired for new ARM64 servers coming to market. Distros are now forced to have their own fixes, not enable APEI, or let m400 users fend for themselves. Please consider. -Geoff arch/arm64/kernel/acpi.c | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c index 7b09487ff8fb..3c315c2c7476 100644 --- a/arch/arm64/kernel/acpi.c +++ b/arch/arm64/kernel/acpi.c @@ -31,6 +31,8 @@ #include #include +#include + #ifdef CONFIG_ACPI_APEI # include # include @@ -177,6 +179,33 @@ static int __init acpi_fadt_sanity_check(void) return ret; } +/* + * acpi_fixup_m400_quirks - Work-around for HPE ProLiant m400 APEI firmware + * problems. + */ +static void __init acpi_fixup_m400_quirks(void) +{ + acpi_status status; + struct acpi_table_header *header; +#if !defined(CONFIG_ACPI_APEI) + int hest_disable = HEST_DISABLED; +#endif + + if (!IS_ENABLED(CONFIG_ACPI_APEI) || hest_disable != HEST_ENABLED) + return; + + status = acpi_get_table(ACPI_SIG_HEST, 0, &header); + + if (ACPI_SUCCESS(status) && !strncmp(header->oem_id, "HPE ", 6) && + !strncmp(header->oem_table_id, "ProLiant", 8) && + MIDR_IMPLEMENTOR(read_cpuid_id()) == ARM_CPU_IMP_APM) { + hest_disable = HEST_DISABLED; + pr_info("Disabled APEI for m400.\n"); + } + + acpi_put_table(header); +} + /* * acpi_boot_table_init() called from setup_arch(), always. * 1. find RSDP and get its address, and then find XSDT @@ -232,11 +261,14 @@ void __init acpi_boot_table_init(void) if (acpi_disabled) { if (earlycon_acpi_spcr_enable) early_init_dt_scan_chosen_stdout(); - } else { - acpi_parse_spcr(earlycon_acpi_spcr_enable, true); - if (IS_ENABLED(CONFIG_ACPI_BGRT)) - acpi_table_parse(ACPI_SIG_BGRT, acpi_parse_bgrt); + return; } + + acpi_parse_spcr(earlycon_acpi_spcr_enable, true); + if (IS_ENABLED(CONFIG_ACPI_BGRT)) + acpi_table_parse(ACPI_SIG_BGRT, acpi_parse_bgrt); + + acpi_fixup_m400_quirks(); } #ifdef CONFIG_ACPI_APEI