Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2528461pxp; Mon, 21 Mar 2022 23:37:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy70T57iw3TTt1cziR6eonoRmD9CPwGtJXnuNehOXdBs/CFAg6JW1ARgpkdRMccsQqzm0a5 X-Received: by 2002:a17:90a:5ae4:b0:1bf:9c61:6973 with SMTP id n91-20020a17090a5ae400b001bf9c616973mr3249358pji.73.1647931066101; Mon, 21 Mar 2022 23:37:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647931066; cv=none; d=google.com; s=arc-20160816; b=fWNXirFCwGxdk8WXaC1gGNfuE8cUri0YWYrPNvV8m5sia5NtGoKlCM/L93rxYC2AoY PEAvmZPjPccJ2ubwNQdtO4ajBppQX0W7HY/W8GtrQge2MA4CpkmnhLgHiSHWtrkcicqL txL0qgzG9lvPm0rewiTYnTfxfCfyLlE8iogKa0STEsR9OffztFLaTevwSYoEl2oMB9ax wxW9Yy4gXnp2/CR9pyR01SD4aKFsmvIaGMGITPAK9kFusakmtRebqXGx5zjfqdKJAUty FLBwR7sFvR7TiWbF1oQkbSW8g+QFsQPWOijuRU4EvIaFzgIj/av2R8SstJyDOOpLt4Id ivCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=TIeHEr3e4H3jo5EPphJEZQWY8c5zcpQLhWDR56Xs7HU=; b=NP9eRZ4bl6/y6zeezRdge+Kz8n0mCSbEsD+dN75EYYP9xBt9UKTnk5SVwafH8iR25S VbW+HdTAbEfToYbcnZsiC2mDexwMGoRbbuhWErgOLlFtDidVUdRxmDNof6LLpEi4tVff ICp4bltvThaeMjykrKfx1gOkh7uL7kRZVk1s+TEaRgxR8vvzvaaqCCIAYEBHxwQ/XxMb U2ha6iqOfTxd/N6Kq7Kj/puVS9tYHAz9A2iOMBdOm102ss1kuxWdUNaX+OyMhn3gyAby QylTskIWZJ3+GtxgPxkPr5faaweWc1o9ygNaMsRqyH7ABiPenx69PkWBHNYYQnlUD9jB 42Mg== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id t7-20020a63b707000000b003816043f14bsi14652423pgf.832.2022.03.21.23.37.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 23:37:46 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E0BABCCC; Mon, 21 Mar 2022 23:10:12 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236853AbiCVGLZ (ORCPT + 99 others); Tue, 22 Mar 2022 02:11:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229485AbiCVGLX (ORCPT ); Tue, 22 Mar 2022 02:11:23 -0400 Received: from out30-131.freemail.mail.aliyun.com (out30-131.freemail.mail.aliyun.com [115.124.30.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F289DBAC; Mon, 21 Mar 2022 23:09:55 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R581e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04395;MF=xueshuai@linux.alibaba.com;NM=1;PH=DS;RN=11;SR=0;TI=SMTPD_---0V7uMwUf_1647929391; Received: from 30.240.116.16(mailfrom:xueshuai@linux.alibaba.com fp:SMTPD_---0V7uMwUf_1647929391) by smtp.aliyun-inc.com(127.0.0.1); Tue, 22 Mar 2022 14:09:52 +0800 Message-ID: Date: Tue, 22 Mar 2022 14:09:46 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v7 0/3] EDAC/ghes: refactor memory error reporting to avoid code duplication Content-Language: en-US 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, zhangliguang@linux.alibaba.com, zhuo.song@linux.alibaba.com References: <20211210134019.28536-1-xueshuai@linux.alibaba.com> <20220308144053.49090-1-xueshuai@linux.alibaba.com> From: Shuai Xue In-Reply-To: <20220308144053.49090-1-xueshuai@linux.alibaba.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Gentle ping. 在 2022/3/8 PM10:40, Shuai Xue 写道: > 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; > - Patch 03 is to improve report format > > Changes since v6: > - Rework patch 02 by Borislav Petkov > - add patch 03 to improve format > - Link: https://lore.kernel.org/r/20220303122626.99740-3-xueshuai@linux.alibaba.com > > Changes since v5: > - Delete change summary in commit log > - Link: https://lore.kernel.org/all/20220126081702.55167-1-xueshuai@linux.alibaba.com/ > - Thanks Borislav Petkov for review comments. > > Changes since v4: > - Fix alignment and format problem > - Link: https://lore.kernel.org/all/20220125024939.30635-1-xueshuai@linux.alibaba.com/ > > Changes since v3: > > - make cper_mem_err_status_str table a lot more compact > - Fix alignment and format problem > - Link: https://lore.kernel.org/all/20220124024759.19176-1-xueshuai@linux.alibaba.com/ > > 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/ > > 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/ > > Shuai Xue (3): > efi/cper: add cper_mem_err_status_str to decode error description > EDAC/ghes: Unify CPER memory error location reporting > efi/cper: reformat CPER memory error location to more readable > > drivers/edac/Kconfig | 1 + > drivers/edac/ghes_edac.c | 200 +++++++----------------------------- > drivers/firmware/efi/cper.c | 64 ++++++++---- > include/linux/cper.h | 3 + > 4 files changed, 87 insertions(+), 181 deletions(-)