From patchwork Mon Jun 24 15:09:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 167617 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4348320ilk; Mon, 24 Jun 2019 08:10:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqwSiGx+YEmEv07hD4nmDRu41daEy96MI7qeGYJW73rPBcuc2tfDDJK+tbCSMz+H3VV/6pdj X-Received: by 2002:a65:4009:: with SMTP id f9mr33326999pgp.110.1561389006196; Mon, 24 Jun 2019 08:10:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561389006; cv=none; d=google.com; s=arc-20160816; b=qP1mq64YcRZ7lrspeMC5X7h+cD7RKf5AfE7HHmT5Otv4nYSIHQiOLCvDI+7r2bwaUq LVblCGtvWsJwYfhv6v2qwJZ60Ef2FzVaZCheCFpaUBiib+ZjS2NSXD2pqgQ3rkLCc8T9 ZVisX+zUxySjrOa6n04DTj0+qWkdNKQMktq7ErWoqZZYl+yFeMT+aucKdiijbDveMRjv rW8AbSr5Nk+6ef4ixB01WbW2o4CXY7T6uipAbRK6U1AO/iehcLiUJX8zhkcZ9DpIdxmn c3DSx0+bfekSFUP1eF2+0DrnyhxAWAbOE/iuzRyq08w3lUcWv6xnazcvd35oe5gNLU26 rpXA== 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=Ikk2ij3rACKTpnbrxZ4dsUrvelonDMRzq529ZdMkYY8=; b=TF4q8R01SbjZpR4XhVySLhYNMDfXteNCxBCK3zO5/A2psASPOUeqKopuCGa5KfBZOx /wvaDyn6c+G08JLJJ9vsrOuRhJD8NowIskWnePBpSd8RY0+lHfpc8ZipCobRq4y9LTeI 7x7WHhinlt37vRGrY4OJ4TS2Q8zTvO63ppIbvtKRNBqyf2QlhrGLjQV4XjTyfdOaZo8K Q6Ir2xcG5X609SdhtXKEeuVG6UYEUdzLwFZaZPV50TFakP3l9ijYb1pZbkHloLeGVuf+ HJhA5HZh8cJHgzkxyTz+EoJ7fYxn/i2zYU2OR2OI8e9+MTwneLduXAisz3XZ8pbiS8Qb t0vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0818 header.b=WMJfCTsB; dkim=pass header.i=@marvell.onmicrosoft.com header.s=selector2-marvell-onmicrosoft-com header.b=Gzf3dKrd; 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 o5si10466177pjp.77.2019.06.24.08.10.05; Mon, 24 Jun 2019 08:10:06 -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=WMJfCTsB; dkim=pass header.i=@marvell.onmicrosoft.com header.s=selector2-marvell-onmicrosoft-com header.b=Gzf3dKrd; 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 S1730966AbfFXPKE (ORCPT + 30 others); Mon, 24 Jun 2019 11:10:04 -0400 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:37490 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730794AbfFXPJt (ORCPT ); Mon, 24 Jun 2019 11:09:49 -0400 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5OF8Chs025865; Mon, 24 Jun 2019 08:09:42 -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=Ikk2ij3rACKTpnbrxZ4dsUrvelonDMRzq529ZdMkYY8=; b=WMJfCTsBpJOVqT8ro56LPICqx5F7GHIEDSu7iTwjEvoSaiw8Om5d3ht7un2JWWrBFlAq 8M61ZW86D+rdYzJ2ScS/HNchO68TunxUg7llrIsjcVSO74wN7AESr7JTKo3mAZ/gho7G 7leDl45Yoc1SxILZDgFchc4TXAOrKdpKyuDI79Z1vwIdPePGxM7yzBsUC3Oq1VlBns5T OyP2WjBPJynxaNTTZBdXxPUOQfZqmxCVqGNJbh4O2iq984RphTXZ29W3Tr0FemI4gR8i O6pf4rUKca5lacPNG2Sr+/q80+5MiV8107+oWxWn58Bwu14En930/Wj0inoNzEO1fFoJ eQ== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 2t9kujf7uw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 24 Jun 2019 08:09:42 -0700 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 24 Jun 2019 08:09:41 -0700 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (104.47.45.53) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Mon, 24 Jun 2019 08:09:41 -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=Ikk2ij3rACKTpnbrxZ4dsUrvelonDMRzq529ZdMkYY8=; b=Gzf3dKrdyLKuRTqV4kESZvFjYQjbC3fk/KScbxyGw5voMJ/vY2SqoLTgkSaDid+uUc8RKyGEUfSatWqeAUqYHQQyUU0hzwm5lGgSNIFePMLF+8Vjw/ykiLVboNv9hxuN+KgZHeQzVYvhGT3FTigvbx+xx22Kv+Y4Xf2q0JM8NSU= 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:39 +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:39 +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 22/24] EDAC, ghes: Move struct member smbios_handle to struct ghes_dimm_info Thread-Topic: [PATCH v2 22/24] EDAC, ghes: Move struct member smbios_handle to struct ghes_dimm_info Thread-Index: AQHVKp7YEBE65Vw/lk2wmDPTirYKWQ== Date: Mon, 24 Jun 2019 15:09:39 +0000 Message-ID: <20190624150758.6695-23-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: d66ed5c5-e459-43a7-68c5-08d6f8b5fa92 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:466; 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)(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: NT7DT70fQQB7tQa906ijvOhLzx+mdMzLyVJsgo1DIddh5BFyXmPL9JHT1Nl4WEL2yWWJNTwHoGTpdvo/PlgFpQY+uye2Ks05qQ3ZWeEIeriZq4+UcPmoDiMn8+K8Wqa8tysX4o8rkxYZ9tzOR3EjEpsbtLc8bZOUEu/hsb17EN36OqDFZEbGCEQE7vRIiCsww2cmUa4qyEwNCnQ2l064s67Svfkd1YZBcgb2KexNwgCKL3h5MqcR5ihW82zrekXCH76FQh03ZwerZcEInXZIeFilIxR8u7+H9dWkWr7Jn9sy2F1MZdbhl+WzFdYtE2zBiLE99f3hd5FFrDxk0iKSX1gMjzExWAP2Cx5WtYLQc3kJ6HrGgZkJDf12qiQSgW/z6UwlJTrrC7eW4ET2Mj7kVXfIzTfCmalpRK51/tffn3A= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: d66ed5c5-e459-43a7-68c5-08d6f8b5fa92 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jun 2019 15:09:39.8800 (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 This is private to the ghes_edac driver, so better keep that data in the struct ghes_dimm_info. Signed-off-by: Robert Richter --- drivers/edac/ghes_edac.c | 15 +++++++-------- include/linux/edac.h | 2 -- 2 files changed, 7 insertions(+), 10 deletions(-) -- 2.20.1 diff --git a/drivers/edac/ghes_edac.c b/drivers/edac/ghes_edac.c index fb5a54e27917..714623204232 100644 --- a/drivers/edac/ghes_edac.c +++ b/drivers/edac/ghes_edac.c @@ -88,6 +88,7 @@ struct ghes_dimm_info { int module; phys_addr_t start; phys_addr_t end; + u16 smbios_handle; u16 phys_handle; }; @@ -187,6 +188,7 @@ static void ghes_edac_dmidecode(const struct dmi_header *dh, void *arg) struct dimm_info *dimm = &mi->dimm_info; u16 rdr_mask = BIT(7) | BIT(13); + mi->smbios_handle = entry->handle; mi->phys_handle = entry->phys_mem_array_handle; if (entry->size == 0xffff) { @@ -268,8 +270,6 @@ static void ghes_edac_dmidecode(const struct dmi_header *dh, void *arg) entry->total_width, entry->data_width); } - dimm->smbios_handle = entry->handle; - (*idx)++; } } @@ -308,8 +308,7 @@ static int mem_info_setup(void) for_each_dimm(dimm) { bank = device = NULL; - dmi_memdev_name(dimm->dimm_info.smbios_handle, - &bank, &device); + dmi_memdev_name(dimm->smbios_handle, &bank, &device); if (bank && device) { snprintf(dimm->dimm_info.label, sizeof(dimm->dimm_info.label), @@ -325,7 +324,7 @@ static int mem_info_setup(void) edac_dbg(1, "DIMM%i: Found mem range [%pa-%pa] on node %d, handle: 0x%.4x%s%s\n", dimm->idx, &dimm->start, &dimm->end, dimm->numa_node, - dimm->dimm_info.smbios_handle, + dimm->smbios_handle, *dimm->dimm_info.label ? ", label: " : "", dimm->dimm_info.label); } @@ -384,7 +383,6 @@ static void mem_info_prepare_mci(struct mem_ctl_info *mci) mci_dimm->edac_mode = dmi_dimm->edac_mode; mci_dimm->dtype = dmi_dimm->dtype; mci_dimm->grain = dmi_dimm->grain; - mci_dimm->smbios_handle = dmi_dimm->smbios_handle; if (*dmi_dimm->label) strcpy(mci_dimm->label, dmi_dimm->label); @@ -415,13 +413,14 @@ get_and_prepare_dimm_info(int nid, int card, int module, int handle) * Device Structure that represents the Memory Module) */ for_each_dimm(dimm) { - di = dimm->dimm; - if (di->smbios_handle == handle) + if (dimm->smbios_handle == handle) goto found; } return NULL; found: + di = dimm->dimm; + if (dimm->card < 0 && card >= 0) dimm->card = card; if (dimm->module < 0 && module >= 0) diff --git a/include/linux/edac.h b/include/linux/edac.h index 40e7da735e48..32ad882bea15 100644 --- a/include/linux/edac.h +++ b/include/linux/edac.h @@ -384,8 +384,6 @@ struct dimm_info { unsigned csrow, cschannel; /* Points to the old API data */ - u16 smbios_handle; /* Handle for SMBIOS type 17 */ - u32 ce_count; u32 ue_count; };