From patchwork Mon Jun 24 15:09:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 167608 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4347632ilk; Mon, 24 Jun 2019 08:09:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqwyeM2dAU1EMBgw9Z4jiUs2QPYDnQYuyn2yyVvbNypMGMxXqG1OjueIV5f7Q3aPQbAYDx7W X-Received: by 2002:a63:ea0a:: with SMTP id c10mr6309873pgi.426.1561388973590; Mon, 24 Jun 2019 08:09:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561388973; cv=none; d=google.com; s=arc-20160816; b=t7HiHpR/h/bbMJIqHYouSCHanWMuGGrqJ0LwFLaG020LpTUxaw4T/gt+qTKgtPHr+z Fw/RNgnQfL0ufGuJX4ysTGZwVMSlfLT1vVk816uW6SMd/K5ncwZXiCqgtQ7riBrxpXQv Mm9XgcyMEMr2AphI7ApJqptUCulEJGRCOLzVk4smLXKlPKlzUnpOv98q1L0ZRE8ThLgH f3lwe5CRGfNoCs4zBLZylXgH067p1MyACNiYY0oagl9Iz0+QtIiyt0JpSbGAI/SoXFQU 63Q+O0bRn4TEMNxPLLE5eAPBlE8BE/aFXajJpRUyasUmbn5ZWEvWl/Ux3ZoOnhdKEhEk nMsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature :dkim-signature; bh=1z4n1jeMPp6r5mxtCk8Fww1wa8P4O49mEyhBNwJ/G2s=; b=DMg3WMeBqV7bmeLB2B8fRXPgesM+w4ueg1/qUh/BEKm9+f9QYKiN4jqJx/cc89vhY5 6OYeG2pg9WnXf27LxYBjRF+cU1T6qc76Hj2bfwXuQtBH5KJJ5ibSf2VRbb7GWdNY3Gpm z8f55NSFs4AdfJ5dnuTmUPtRHpQ9mTedC3yfWZPXi3NXTB8JMyq1EBjxXsRhSFs0xuhX iHhga5rDI8p9NEXdN20zAJqcKbxvANsx++3XMb6KVCJ8npsepGL61sd/ycf9WxY7JOwc EvUFQKaoFL/1WHuvO1YotSEn82ZwpAgGt2SBwe2A4F3OYrKIAgvuIgvUxCtcGXG4Hi2t mkOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0818 header.b=KTjUtGI0; dkim=pass header.i=@marvell.onmicrosoft.com header.s=selector2-marvell-onmicrosoft-com header.b=iLrmvrhH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=marvell.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id az12si10124027plb.165.2019.06.24.08.09.33; Mon, 24 Jun 2019 08:09:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0818 header.b=KTjUtGI0; dkim=pass header.i=@marvell.onmicrosoft.com header.s=selector2-marvell-onmicrosoft-com header.b=iLrmvrhH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=marvell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730634AbfFXPJc (ORCPT + 30 others); Mon, 24 Jun 2019 11:09:32 -0400 Received: from mx0a-0016f401.pphosted.com ([67.231.148.174]:31880 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729578AbfFXPJ2 (ORCPT ); Mon, 24 Jun 2019 11:09:28 -0400 Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5OF0Kft018697; Mon, 24 Jun 2019 08:09:20 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=1z4n1jeMPp6r5mxtCk8Fww1wa8P4O49mEyhBNwJ/G2s=; b=KTjUtGI0wzLeDnBcQGu8e3EJ9ZFmRr4HhDGkl0g7Rw++S5bI3rAn/gvR+UzYtFDXNw0S /kJp3muvHsT5uLprywGCDr32yqzDxi4ceJ3eKJFc/L6VxmJHJQa0t/I9V6hY7EYgepPF q/2ILazFLGyAFUX9/0tqwO1EjxuQQhyi980dYa2Wn8vi5yOjy5bbzTd3L5TtWjStTk1F hUKElj/BMUoo8GW/5/2AAfH1ykKcdka7U1ms024AzvWitLleshuv2y7qulPRcXdEA1YO FSi4Sp+LdNxcel/6QsjSO5U8yQmHAbLBjVuPif5lMC0TrhO7KHGZiIoJ70LxwnzARTFA Rg== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0a-0016f401.pphosted.com with ESMTP id 2tarxr9taf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 24 Jun 2019 08:09:20 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 24 Jun 2019 08:09:19 -0700 Received: from NAM03-BY2-obe.outbound.protection.outlook.com (104.47.42.57) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Mon, 24 Jun 2019 08:09:18 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector2-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1z4n1jeMPp6r5mxtCk8Fww1wa8P4O49mEyhBNwJ/G2s=; b=iLrmvrhHoEqBOlhb3dXMB+Fzp9rfnKvQM13iIu071a6e0pJD81GFb27TFaZDvJlTBa+Oqb3qUKsI6oeAWyngznovMQNXwjtzwx9082ibfBSazwTyswT1YAZxgZZP803Ff4abIAt+pQEsivOVTza2RCI9Uie4E/5D6PtbqM/9qhM= Received: from MN2PR18MB3408.namprd18.prod.outlook.com (10.255.238.217) by MN2PR18MB3197.namprd18.prod.outlook.com (10.255.236.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2008.13; Mon, 24 Jun 2019 15:09:17 +0000 Received: from MN2PR18MB3408.namprd18.prod.outlook.com ([fe80::d3:794c:1b94:cf3]) by MN2PR18MB3408.namprd18.prod.outlook.com ([fe80::d3:794c:1b94:cf3%4]) with mapi id 15.20.2008.014; Mon, 24 Jun 2019 15:09:17 +0000 From: Robert Richter To: Borislav Petkov , James Morse , "Mauro Carvalho Chehab" CC: "linux-edac@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Robert Richter Subject: [PATCH v2 11/24] EDAC, mc: Rework edac_raw_mc_handle_error() to use struct dimm_info Thread-Topic: [PATCH v2 11/24] EDAC, mc: Rework edac_raw_mc_handle_error() to use struct dimm_info Thread-Index: AQHVKp7LH4BzYmX+0kOgmnuIJiKvpw== Date: Mon, 24 Jun 2019 15:09:17 +0000 Message-ID: <20190624150758.6695-12-rrichter@marvell.com> References: <20190624150758.6695-1-rrichter@marvell.com> In-Reply-To: <20190624150758.6695-1-rrichter@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HE1P190CA0035.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::24) To MN2PR18MB3408.namprd18.prod.outlook.com (2603:10b6:208:16c::25) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-originating-ip: [92.254.182.202] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ba94cb3a-ec6d-4c73-5b2c-08d6f8b5ed60 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:MN2PR18MB3197; x-ms-traffictypediagnostic: MN2PR18MB3197: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4303; x-forefront-prvs: 007814487B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(366004)(136003)(396003)(346002)(376002)(199004)(189003)(36756003)(110136005)(107886003)(54906003)(81156014)(81166006)(68736007)(8676002)(25786009)(5660300002)(8936002)(305945005)(7736002)(4326008)(1076003)(186003)(6116002)(14454004)(476003)(486006)(2616005)(11346002)(256004)(14444005)(446003)(3846002)(50226002)(26005)(2906002)(52116002)(76176011)(71200400001)(71190400001)(99286004)(386003)(6506007)(102836004)(478600001)(316002)(86362001)(6512007)(66066001)(53936002)(6486002)(73956011)(66946007)(66476007)(66556008)(64756008)(66446008)(6436002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR18MB3197; H:MN2PR18MB3408.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: ooK+K5j9JPaaRMMaVHI5I6EhsJov3REDgW/7xXcXpuYxoReYfItvbKIn4ESPGPy2OoiNpItzw3dESrx+voDrMdpjTX3RxalKMkxvUxseos/2YdCKz+Si1o5Wbns1NR32/C6KuxR6VjarpsQ79t9+IRlY/i5lzkabzqJakuE+cKYl5th26Ij2Ih/iO5I5yP/NEc2DQlPgKIi7gXhTuNFhLDvVbs/k5x85PJAJ75slOCMsMhZkQm2MYRNVEUPaztjKtpewS4aqtl0m7UBIla+xKhrJulRksV5+jz1hNCgvdChYuMCzWyUbS+6PyL8uYBR4yPByyDOx1GG+RFyyCHBJ9/kgo5nDnXHpA/G4JBbvRfat5fKr0uqu8WmRvykIcAxZTwbeynupXnfA+2zGEziKBChs75kuxxyMtaHpFUmaKxg= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: ba94cb3a-ec6d-4c73-5b2c-08d6f8b5ed60 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jun 2019 15:09:17.7086 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: rrichter@marvell.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR18MB3197 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-24_10:, , signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rework edac_raw_mc_handle_error() to use struct dimm_info. Signed-off-by: Robert Richter --- drivers/edac/edac_mc.c | 28 +++++++++++++--------------- drivers/edac/edac_mc.h | 2 ++ drivers/edac/ghes_edac.c | 5 ++++- 3 files changed, 19 insertions(+), 16 deletions(-) -- 2.20.1 diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index bce39b2e10c9..a8d4471e238c 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c @@ -889,11 +889,9 @@ const char *edac_layer_name[] = { EXPORT_SYMBOL_GPL(edac_layer_name); static void edac_inc_ce_error(struct mem_ctl_info *mci, - const int pos[EDAC_MAX_LAYERS], + struct dimm_info *dimm, const u16 count) { - struct dimm_info *dimm = edac_get_dimm(mci, pos[0], pos[1], pos[2]); - mci->ce_mc += count; if (dimm) @@ -903,11 +901,9 @@ static void edac_inc_ce_error(struct mem_ctl_info *mci, } static void edac_inc_ue_error(struct mem_ctl_info *mci, - const int pos[EDAC_MAX_LAYERS], - const u16 count) + struct dimm_info *dimm, + const u16 count) { - struct dimm_info *dimm = edac_get_dimm(mci, pos[0], pos[1], pos[2]); - mci->ue_mc += count; if (dimm) @@ -917,8 +913,8 @@ static void edac_inc_ue_error(struct mem_ctl_info *mci, } static void edac_ce_error(struct mem_ctl_info *mci, + struct dimm_info *dimm, const u16 error_count, - const int pos[EDAC_MAX_LAYERS], const char *msg, const char *location, const char *label, @@ -946,7 +942,7 @@ static void edac_ce_error(struct mem_ctl_info *mci, error_count, msg, msg_aux, label, location, detail); } - edac_inc_ce_error(mci, pos, error_count); + edac_inc_ce_error(mci, dimm, error_count); if (mci->scrub_mode == SCRUB_SW_SRC) { /* @@ -970,8 +966,8 @@ static void edac_ce_error(struct mem_ctl_info *mci, } static void edac_ue_error(struct mem_ctl_info *mci, + struct dimm_info *dimm, const u16 error_count, - const int pos[EDAC_MAX_LAYERS], const char *msg, const char *location, const char *label, @@ -1005,15 +1001,15 @@ static void edac_ue_error(struct mem_ctl_info *mci, msg, msg_aux, label, location, detail); } - edac_inc_ue_error(mci, pos, error_count); + edac_inc_ue_error(mci, dimm, error_count); } void edac_raw_mc_handle_error(const enum hw_event_mc_err_type type, struct mem_ctl_info *mci, + struct dimm_info *dimm, struct edac_raw_error_desc *e) { char detail[80]; - int pos[EDAC_MAX_LAYERS] = { e->top_layer, e->mid_layer, e->low_layer }; u8 grain_bits; /* @@ -1038,7 +1034,7 @@ void edac_raw_mc_handle_error(const enum hw_event_mc_err_type type, "page:0x%lx offset:0x%lx grain:%ld syndrome:0x%lx", e->page_frame_number, e->offset_in_page, e->grain, e->syndrome); - edac_ce_error(mci, e->error_count, pos, e->msg, e->location, + edac_ce_error(mci, dimm, e->error_count, e->msg, e->location, e->label, detail, e->other_detail, e->page_frame_number, e->offset_in_page, e->grain); } else { @@ -1046,7 +1042,7 @@ void edac_raw_mc_handle_error(const enum hw_event_mc_err_type type, "page:0x%lx offset:0x%lx grain:%ld", e->page_frame_number, e->offset_in_page, e->grain); - edac_ue_error(mci, e->error_count, pos, e->msg, e->location, + edac_ue_error(mci, dimm, e->error_count, e->msg, e->location, e->label, detail, e->other_detail); } @@ -1212,6 +1208,8 @@ void edac_mc_handle_error(const enum hw_event_mc_err_type type, if (p > e->location) *(p - 1) = '\0'; - edac_raw_mc_handle_error(type, mci, e); + dimm = edac_get_dimm(mci, top_layer, mid_layer, low_layer); + + edac_raw_mc_handle_error(type, mci, dimm, e); } EXPORT_SYMBOL_GPL(edac_mc_handle_error); diff --git a/drivers/edac/edac_mc.h b/drivers/edac/edac_mc.h index 4165e15995ad..b816cf3caaee 100644 --- a/drivers/edac/edac_mc.h +++ b/drivers/edac/edac_mc.h @@ -214,6 +214,7 @@ extern int edac_mc_find_csrow_by_page(struct mem_ctl_info *mci, * * @type: severity of the error (CE/UE/Fatal) * @mci: a struct mem_ctl_info pointer + * @dimm: a struct dimm_info pointer * @e: error description * * This raw function is used internally by edac_mc_handle_error(). It should @@ -222,6 +223,7 @@ extern int edac_mc_find_csrow_by_page(struct mem_ctl_info *mci, */ void edac_raw_mc_handle_error(const enum hw_event_mc_err_type type, struct mem_ctl_info *mci, + struct dimm_info *dimm, struct edac_raw_error_desc *e); /** diff --git a/drivers/edac/ghes_edac.c b/drivers/edac/ghes_edac.c index 757a02f2ce49..786f1b32eee1 100644 --- a/drivers/edac/ghes_edac.c +++ b/drivers/edac/ghes_edac.c @@ -193,6 +193,7 @@ static void ghes_edac_dmidecode(const struct dmi_header *dh, void *arg) void ghes_edac_report_mem_error(int sev, struct cper_sec_mem_err *mem_err) { + struct dimm_info *dimm_info; enum hw_event_mc_err_type type; struct edac_raw_error_desc *e; struct mem_ctl_info *mci; @@ -431,7 +432,9 @@ void ghes_edac_report_mem_error(int sev, struct cper_sec_mem_err *mem_err) if (p > pvt->other_detail) *(p - 1) = '\0'; - edac_raw_mc_handle_error(type, mci, e); + dimm_info = edac_get_dimm_by_index(mci, e->top_layer); + + edac_raw_mc_handle_error(type, mci, dimm_info, e); spin_unlock_irqrestore(&ghes_lock, flags); }