Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3358821pxb; Mon, 24 Jan 2022 08:01:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJwOpbt5oSMt9bNlVAdmhmbJiRc4GBmmRzrwLJdjd+nrfPJiKlAwC4x5tcoNXc3/Xn3zXV2C X-Received: by 2002:a05:6a00:1a86:b0:4c1:3039:16a6 with SMTP id e6-20020a056a001a8600b004c1303916a6mr14378353pfv.5.1643040101855; Mon, 24 Jan 2022 08:01:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643040101; cv=none; d=google.com; s=arc-20160816; b=D5XNamqfKEZWg1GDUE9RCxaSuM17W47ybFhw7NUcYgAzP/jTGLfzOEjQujo35tFX54 BjbbsN008BjHsmkbiwASBbddy7IVbz3a7t/5hgkWzr2CxogUHf3aZlGOIDO/9V1OKV4e fU7jd+XVtKWSNj6eVt48SDUja0TRJLy6tVJM41ZiaSyG7jGaX4qGuIP8o+FqIG2zwza3 DnG5GjihnGZInFTl1OxMsvYGnsqDCzQ1qjmGm+08KaLj7EbcNMdijDRmA66g9BvNQwQE +VtQLA8MZGPWXHJ8/Dk+v1NAJa2c9cmZeoSlZr7PEabxb+VJwIY2itQiiQz3wfFk4/rM CiwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=L5xNlu5nvCoKBWAaIsBXMJIGWxSnvGYuDFDdW5M4PBg=; b=sXaZ5/C7V5pMvc95ShURdVKJqQoTjeVDXPn+J0tEoOoi0U9WD+gBX79bMh9KKtTPhK Fxu13CndSH/n/6x6KZSo4uP86R/GRJVaKlkYg3OSzn49fbGJm4RPxHveUuuEI0nKQi2r Vjiv1Kt1hV+qGSzcfP4Dp0Pw1jHp7mok5z0O3BRi8EULdSp/PuF4KBpFImpzN8emmv/v ppWtu48qixuKTGNawyhGjg3okx97WFz7r4QRL7LAQW5vQhPImu1xN33GiPQp6IHX9e6p qP/VYDbZB+yfR/Lywu7h+ikE/F+9viKDu/MFnuJ/sEbv5OQ+pPOcpkmCTCjU8SDXiQLY yOjQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k5si16292814plk.64.2022.01.24.08.01.29; Mon, 24 Jan 2022 08:01:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240938AbiAXCsJ (ORCPT + 99 others); Sun, 23 Jan 2022 21:48:09 -0500 Received: from out30-132.freemail.mail.aliyun.com ([115.124.30.132]:40244 "EHLO out30-132.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235357AbiAXCsI (ORCPT ); Sun, 23 Jan 2022 21:48:08 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R151e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=xueshuai@linux.alibaba.com;NM=1;PH=DS;RN=12;SR=0;TI=SMTPD_---0V2cQ9l9_1642992481; Received: from localhost.localdomain(mailfrom:xueshuai@linux.alibaba.com fp:SMTPD_---0V2cQ9l9_1642992481) by smtp.aliyun-inc.com(127.0.0.1); Mon, 24 Jan 2022 10:48:03 +0800 From: Shuai Xue To: bp@alien8.de, rric@kernel.org Cc: mchehab@kernel.org, tony.luck@intel.com, james.morse@arm.com, ardb@kernel.org, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, xueshuai@linux.alibaba.com, zhangliguang@linux.alibaba.com, zhuo.song@linux.alibaba.com Subject: [RESEND PATCH v3 0/2] EDAC/ghes: refactor memory error reporting to avoid Date: Mon, 24 Jan 2022 10:47:57 +0800 Message-Id: <20220124024759.19176-1-xueshuai@linux.alibaba.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20211210134019.28536-1-xueshuai@linux.alibaba.com> References: <20211210134019.28536-1-xueshuai@linux.alibaba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ghes_edac_report_mem_error() in ghes_edac.c is a Long Method and have Duplicated Code with cper_mem_err_location(), cper_dimm_err_location(), and cper_mem_err_type_str() in drivers/firmware/efi/cper.c. In addition, the cper_print_mem() in drivers/firmware/efi/cper.c only reports the error status and misses its description. This patch set is to refactor ghes_edac_report_mem_error with: - Patch 01 is to wrap up error status decoding logics and reuse it in cper_print_mem(). - Patch 02 is to introduces cper_*(), into ghes_edac_report_mem_error(), this can avoid bunch of duplicate code lines; Changes since v2: - delete the unified patch - adjusted the order of patches - Link: https://lore.kernel.org/all/20211210134019.28536-1-xueshuai@linux.alibaba.com/ - Thanks Borislav Petkov for review comments. Changes since v1: - add a new patch to unify ghes and cper before removing duplication. - document the changes in patch description - add EXPORT_SYMBOL_GPL()s for cper_*() - document and the dependency and add UEFI_CPER dependency explicitly - Link: https://lore.kernel.org/all/20211207031905.61906-2-xueshuai@linux.alibaba.com/ - Thanks Robert Richter for review comments. Shuai Xue (2): efi/cper: add cper_mem_err_status_str to decode error description EDAC/ghes: use cper functions to avoid code duplication drivers/edac/Kconfig | 1 + drivers/edac/ghes_edac.c | 196 +++++++----------------------------- drivers/firmware/efi/cper.c | 82 +++++++++++---- include/linux/cper.h | 3 + 4 files changed, 102 insertions(+), 180 deletions(-) -- 2.20.1.12.g72788fdb