From patchwork Wed May 16 18:29:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Borislav Petkov X-Patchwork-Id: 10404629 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 3C6B2601D2 for ; Wed, 16 May 2018 18:32:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2924C28671 for ; Wed, 16 May 2018 18:32:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D88B28662; Wed, 16 May 2018 18:32:27 +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=ham 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 A9209288E2 for ; Wed, 16 May 2018 18:31:36 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=sYonYQ4LLgst+7cb974SRct1CFTdn3/rMkXKUUeyf4g=; b=FVHsEPR9xBKo5D 2RLMYJ8gFWsjBPh48QH/fCmswI2ielZG7IA8jSOTfy13upOY8u8lkePtCrFpIlvtMnKH0QR7kGtsi U8WxiZiWIvy3651B438BOtglxiaZcSsUZU08vHxGQKCMyaBtJCxojU8bVeTGkNKc9W0Q1n0ekDMXx G62dMqiP7FtbgJScIxx6Ms+5+0s5wN8czFVgbP97p/yNBLURxMKPxkVvFqJ39b4mI/eC1ce2xY14o BaqHhIVvFnhi8tRGe2r9FQ2Ny6aKEGr/YGdAnjp31Dnbnfle0POcba3l8fiMQ+hTlfSvS/LC1QpuH 7xeP2lalzalMCDZPVPqQ==; 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 1fJ1Co-0002ja-3l; Wed, 16 May 2018 18:31:18 +0000 Received: from mail.skyhub.de ([2a01:4f8:190:11c2::b:1457]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJ1CJ-0002Fv-OV for linux-arm-kernel@lists.infradead.org; Wed, 16 May 2018 18:30:50 +0000 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de Received: from mail.skyhub.de ([127.0.0.1]) by localhost (blast.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id tsUfoP5FPgKE; Wed, 16 May 2018 20:30:14 +0200 (CEST) Received: from pd.tnic (p200300EC2BC9C0002C6AA0ECF4A0BD88.dip0.t-ipconnect.de [IPv6:2003:ec:2bc9:c000:2c6a:a0ec:f4a0:bd88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 20BF41EC02B8; Wed, 16 May 2018 20:30:14 +0200 (CEST) Date: Wed, 16 May 2018 20:29:58 +0200 From: Borislav Petkov To: James Morse Subject: Re: [PATCH] ghes_edac: enable HIP08 platform edac driver Message-ID: <20180516182958.GB17092@pd.tnic> References: <1526039543-180996-1-git-send-email-zhengqiang10@huawei.com> <20180511121901.GA12705@pd.tnic> <5AF90C70.408@huawei.com> <20180514094709.GC23049@pd.tnic> <20180514164720.GH23049@pd.tnic> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.3 (2018-01-21) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180516_113048_004508_2BE53F48 X-CRM114-Status: GOOD ( 21.10 ) 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: toshi.kani@hpe.com, linuxarm@huawei.com, mchehab@kernel.org, Zhengqiang , "linux-arm-kernel@lists.infradead.org" , linux-edac@vger.kernel.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 On Wed, May 16, 2018 at 02:38:38PM +0100, James Morse wrote: > XGene has its own edac driver, but it doesn't probe when booted via ACPI so > won't conflict with ghes_edac. Actually it will. EDAC core can have only one EDAC driver loaded. Don't ask me why - it has been that way since forever. We can change it some day but frankly, I don't see reasoning for it. One driver can easily manage *all* error sources on a system, I'd say. > ... The thing has 4 dimm slots, but only two are populated. I swapped > them round and the table was regenerated, so I don't think its faking > it. Ok. > So I think we're good to make the whitelist x86 only. > Your diff-hunk makes 'idx=-1', so we always get the 'Unfortunately' warning. I'd > like to suppress this unless force_load has been used. Yeah, we should handle that differently for ARM. Toshi added the idx thing in 5deed6b6a479 ("EDAC, ghes: Add platform check") to dump this when the platform is not whitelisted. So let's do that: Tested-by: James Morse Reviewed-by: James Morse --- --- > What is the history behind the fake thing here? It predates 32fa1f53c2d > "ghes_edac: do a better job of filling EDAC DIMM info", was it to support a > valid system, or just to ease merging the driver when not all systems had the > dmi table? I wouldn't be surprised if there were some, TBH. Looks to me like it used to fake DIMMs, see - /* FIXME: FAKE DATA */ - dimm->nr_pages = 1000; - dimm->grain = 128; - dimm->mtype = MEM_UNKNOWN; - dimm->dtype = DEV_UNKNOWN; - dimm->edac_mode = EDAC_SECDED; which 32fa1f53c2d removes. $ git annotate drivers/edac/ghes_edac.c 32fa1f53c2d~1 shows you the driver before the DMI scanning so it looks like initially it was faking stuff to satisfy EDAC core when it creates sysfs entries using struct dimm_info descriptors. > It looks like even the oldest Arm64 ACPI systems have dmi tables, so we can > probably require DMI or the 'force' flag. Well, with the hunk above it would still do ghes_edac_count_dimms() on ARM and if it fails to find something, it will set fake, which is a good sanity-check as it screams loudly. :) Thx. diff --git a/drivers/edac/ghes_edac.c b/drivers/edac/ghes_edac.c index 863fbf3db29f..473aeec4b1da 100644 --- a/drivers/edac/ghes_edac.c +++ b/drivers/edac/ghes_edac.c @@ -440,12 +440,16 @@ int ghes_edac_register(struct ghes *ghes, struct device *dev) struct mem_ctl_info *mci; struct edac_mc_layer layers[1]; struct ghes_edac_dimm_fill dimm_fill; - int idx; + int idx = -1; - /* Check if safe to enable on this system */ - idx = acpi_match_platform_list(plat_list); - if (!force_load && idx < 0) - return -ENODEV; + if (IS_ENABLED(CONFIG_X86)) { + /* Check if safe to enable on this system */ + idx = acpi_match_platform_list(plat_list); + if (!force_load && idx < 0) + return -ENODEV; + } else { + idx = 0; + } /* * We have only one logical memory controller to which all DIMMs belong.