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: 10462797 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 7E2C260329 for ; Wed, 13 Jun 2018 18:22:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C34328FEE for ; Wed, 13 Jun 2018 18:22:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 60EAA28FFC; Wed, 13 Jun 2018 18:22:36 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 D048028FEE for ; Wed, 13 Jun 2018 18:22:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935256AbeFMSWe (ORCPT ); Wed, 13 Jun 2018 14:22:34 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:42886 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935202AbeFMSWe (ORCPT ); Wed, 13 Jun 2018 14:22:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:MIME-Version:Date:Message-ID:Subject:From:Cc:To:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=I9Bv65Ik3WN08MkCIy0lfL9lk2l5YvROMhSZWCg+xTg=; b=kfCjcH4dqka+RpsjqyjlMKtAl ViQOPHhgMQd7ZLEKtFAhuqYM7NqAy1sQiXDGjclsguugLrZ3bzicWKZwaRSCcZzJCaL5HBI8Fxlkz zauWzrY1utzqEni18FeGOOYxQNkZpyqBeK5k0sFRjtn11F2oL7zVYqZIZwbKxrMf4Vqx+aJZ3N+aX jcoI46Vsrm3CeLr/U/K3hGse6VIwK9hYKdtmTuY3weM5OXsQmjTR9KuxeGgyJ/haZog1tIn/V97ox zIK55t90iwOk+x6SeSn8stXRfE7hfiG3+98IEt+B/wcnUK3H+vvYe0H0FgT5M5eaEagqOhNvEn1bL MvHiSKd0w==; 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 Cc: Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , Riku Voipio , Mark Salter , linux-arm-kernel@lists.infradead.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 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 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