From patchwork Wed May 29 08:44:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 165334 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp9579983ili; Wed, 29 May 2019 01:44:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqwsV4u8bim3Yre88qWeZ0XfbgCFsUCorReGiUTYZmsbgaMTwKWOQoYPVt6pwaEr9PplnDY3 X-Received: by 2002:aa7:880f:: with SMTP id c15mr53373869pfo.100.1559119485534; Wed, 29 May 2019 01:44:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559119485; cv=none; d=google.com; s=arc-20160816; b=g88XWkFpHM7AgfyEvnkgEbiYV02wuKWDi+nOXEPbehhcZk1nJZD9+MOPU6Uk4WCNo6 taPE8LMBXhXnp5Hke70JyPUkZz5H+7zvILgicXlwuApnq3mWWw8ZCHs/m/oUSzGmnKOg 6sE1vdUQe97MWO/G3CJu3x+6EQRKDhiGfpDBFK+PIVF0ui++75ToFC/AAYrI/SbfvwbU gD7bv33vBsAFJxtv8B19D6v36Ywko8Kzuu2aiE2F/GfE3ijZm9B2Z9/DbQhbM2KKLjbv uFStLaMcqdOp1kIzF2vtrcDL1wjF6DZd7gxqW9cjx+LI57ck24pU8/n/Ds3HOx3nN0Au j7tw== 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=D+Hh1I02195DBSaaVB19Bw/6l1Ypo9lTWFbg/cO3BOM=; b=NngSGTd33hrMj042zTsjs9RoUA/ED4T61Nx/rW5WDv5/B72u0Agscn8MrzHsZM53YV bDOGOZW9IgfkyWlLUgOOrQd5tuykxCjR3d0u0ymgxnVpVcrxjiWfkHQqRwZwQRKlaqQH wHxNlk+dVvovKgxGiX5LIgSxphtel/WrVPZxjmVx1BbAiqhmuMAzT0JJFWE0Z1OGvgyt ChThyKFLUsgiG5cAKKtXe9NUeJ3DW6t+KsM+ebGmRFaI/XVcXw8r694QP9RhZDg5pyGB IGukqpwMyY3Br6ogwoJZ9i49lq/CbmRMpEjlvwYbOwLiVrPKCysSX6S2/agveYqNf80B HxGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0818 header.b="HQFp/8Rh"; dkim=pass header.i=@marvell.onmicrosoft.com header.s=selector2-marvell-onmicrosoft-com header.b=Y9x4sspU; 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 s36si24801212pld.278.2019.05.29.01.44.45; Wed, 29 May 2019 01:44:45 -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="HQFp/8Rh"; dkim=pass header.i=@marvell.onmicrosoft.com header.s=selector2-marvell-onmicrosoft-com header.b=Y9x4sspU; 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 S1726787AbfE2Ioo (ORCPT + 30 others); Wed, 29 May 2019 04:44:44 -0400 Received: from mx0a-0016f401.pphosted.com ([67.231.148.174]:35388 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726599AbfE2Ioi (ORCPT ); Wed, 29 May 2019 04:44:38 -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 x4T8fJFb023313; Wed, 29 May 2019 01:44:29 -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=D+Hh1I02195DBSaaVB19Bw/6l1Ypo9lTWFbg/cO3BOM=; b=HQFp/8Rhxh+/Hz9ndj7ZnpH3M6AggYaCJmYCr8oUiIgdCJCmC1t9cwZzBP7qhluPkA1y 217tHqJ6t5yk6fVRBBW5e7n1CTmLu/pTxKJ/aUYvJ2YaUnpZZ69G5jz0RO7vlDssUdux aailovd3F5XzPAxr05FaNKKVKPymLHo7ILZQ4FmtFKNm7UiWQyofjRBmB+4iakqJIjnj t33Ox0vFerX6YuhCTpAZWb0eZdWlU/SjYIihAds1y6BwgngZrjG8TFKG8ktMCB3lWpWs xEeEjlT93uMcI0H//KtpkQ4vRIAzq47Q2OEKmGjYcFykHyv+GL51Shg3nizd0pzYjel5 uw== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0a-0016f401.pphosted.com with ESMTP id 2sspkpg1ps-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 29 May 2019 01:44:29 -0700 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 29 May 2019 01:44:28 -0700 Received: from NAM03-CO1-obe.outbound.protection.outlook.com (104.47.40.55) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Wed, 29 May 2019 01:44:28 -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=D+Hh1I02195DBSaaVB19Bw/6l1Ypo9lTWFbg/cO3BOM=; b=Y9x4sspU2jJyhKxMRo2NFLBWbLUrWYRI1uSlnulEG7k0buyrrWFTvVAFAniyG/OwgxS72EkRlL6Nk0fnsCYE4IfTb76Ogk/a4PsflW9dgPdSnq+gXthMDKWfXMja8JMdufHt+uiXTtuLV21Dd4+n9RMAjnszbY4/ztfLSUox3k0= Received: from MN2PR18MB3408.namprd18.prod.outlook.com (10.255.238.217) by MN2PR18MB3437.namprd18.prod.outlook.com (10.255.239.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1922.20; Wed, 29 May 2019 08:44:26 +0000 Received: from MN2PR18MB3408.namprd18.prod.outlook.com ([fe80::7c9a:f3bf:fe2e:fe4a]) by MN2PR18MB3408.namprd18.prod.outlook.com ([fe80::7c9a:f3bf:fe2e:fe4a%4]) with mapi id 15.20.1922.021; Wed, 29 May 2019 08:44:26 +0000 From: Robert Richter To: Borislav Petkov , Tony Luck , "James Morse" , Mauro Carvalho Chehab CC: "linux-edac@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Robert Richter Subject: [PATCH 10/21] EDAC, ghes: Remove pvt->detail_location string Thread-Topic: [PATCH 10/21] EDAC, ghes: Remove pvt->detail_location string Thread-Index: AQHVFfq4sJ/kBdA4SEWzCHEasvaD/g== Date: Wed, 29 May 2019 08:44:26 +0000 Message-ID: <20190529084344.28562-11-rrichter@marvell.com> References: <20190529084344.28562-1-rrichter@marvell.com> In-Reply-To: <20190529084344.28562-1-rrichter@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6PR01CA0046.eurprd01.prod.exchangelabs.com (2603:10a6:20b:e0::23) 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: [78.54.13.57] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: fdb97f67-9b3d-43ec-224b-08d6e411db2a x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:MN2PR18MB3437; x-ms-traffictypediagnostic: MN2PR18MB3437: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:758; x-forefront-prvs: 0052308DC6 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(346002)(396003)(376002)(39860400002)(136003)(189003)(199004)(8936002)(4326008)(53936002)(50226002)(110136005)(107886003)(68736007)(36756003)(5660300002)(54906003)(11346002)(26005)(186003)(52116002)(2906002)(2616005)(476003)(446003)(6506007)(14454004)(66476007)(25786009)(478600001)(386003)(86362001)(486006)(81166006)(81156014)(8676002)(305945005)(316002)(7736002)(256004)(99286004)(76176011)(6512007)(6436002)(73956011)(64756008)(66446008)(66556008)(66066001)(3846002)(66946007)(1076003)(6486002)(102836004)(71190400001)(71200400001)(6116002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR18MB3437; H:MN2PR18MB3408.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: HPUbDVvqvHYkKiwxI6UOkB+QXMt1At4nsJjuNs8E9VFi02BGlMGpkObRNNfatPnYItpsHMBjEWoFol2wJ/0rzxnGyqUY6raQRUkq4vP/N/wJaRWBwf1uGOowPa+eiebUJ/36OnSN5qKhBYJGnScdlrUIh4M/zcWBypvqlZL3PXkZXvCMFMiyhk1AspVfWveUUr7EFKjiBAbL1Qs94R9KRh6FAbI2XTBQYWbgnCH7PKbNu+w5HmxR3UM00/THahwX3oEdt2US6hVjNE88E6lbDupyZJq/2xDlFPgW7hu++Swc4TNu8X75/16IrHT8DuWvTH7oIWd8jyN9clQqKZdZfYqP8+Fa+CE7JojnlIqVsCQ7D4Km4UCPDMY406mEp/MZNWuRXE1urdjgtkPpm63a29fdmtaLipJhV8DsvDcUw+0= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: fdb97f67-9b3d-43ec-224b-08d6e411db2a X-MS-Exchange-CrossTenant-originalarrivaltime: 29 May 2019 08:44:26.4914 (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: MN2PR18MB3437 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-29_05:, , signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The detail_location[] string in struct ghes_edac_pvt is complete useless and data is just copied around. Put everything into e->other_detail from the beginning. Signed-off-by: Robert Richter --- drivers/edac/ghes_edac.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) -- 2.20.1 Reviewed-by: James Morse diff --git a/drivers/edac/ghes_edac.c b/drivers/edac/ghes_edac.c index 39702bac5eaf..c18f16bc9e4d 100644 --- a/drivers/edac/ghes_edac.c +++ b/drivers/edac/ghes_edac.c @@ -23,8 +23,7 @@ struct ghes_edac_pvt { struct mem_ctl_info *mci; /* Buffers for the error handling routine */ - char detail_location[240]; - char other_detail[160]; + char other_detail[400]; char msg[80]; }; @@ -225,13 +224,14 @@ void ghes_edac_report_mem_error(int sev, struct cper_sec_mem_err *mem_err) memset(e, 0, sizeof (*e)); e->error_count = 1; strcpy(e->label, "unknown label"); - e->msg = pvt->msg; - e->other_detail = pvt->other_detail; e->top_layer = -1; e->mid_layer = -1; e->low_layer = -1; - *pvt->other_detail = '\0'; + e->msg = pvt->msg; + e->other_detail = pvt->other_detail; + *pvt->msg = '\0'; + *pvt->other_detail = '\0'; switch (sev) { case GHES_SEV_CORRECTED: @@ -359,6 +359,8 @@ void ghes_edac_report_mem_error(int sev, struct cper_sec_mem_err *mem_err) /* All other fields are mapped on e->other_detail */ p = pvt->other_detail; + p += snprintf(p, sizeof(pvt->other_detail), + "APEI location: %s ", e->location); if (mem_err->validation_bits & CPER_MEM_VALID_ERROR_STATUS) { u64 status = mem_err->error_status; @@ -434,12 +436,11 @@ void ghes_edac_report_mem_error(int sev, struct cper_sec_mem_err *mem_err) /* Generate the trace event */ grain_bits = fls_long(e->grain); - snprintf(pvt->detail_location, sizeof(pvt->detail_location), - "APEI location: %s %s", e->location, e->other_detail); + trace_mc_event(type, e->msg, e->label, e->error_count, mci->mc_idx, e->top_layer, e->mid_layer, e->low_layer, (e->page_frame_number << PAGE_SHIFT) | e->offset_in_page, - grain_bits, e->syndrome, pvt->detail_location); + grain_bits, e->syndrome, e->other_detail); dimm_info = edac_get_dimm_by_index(mci, e->top_layer);