Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1840272pxb; Mon, 13 Sep 2021 06:42:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBs2QFawo/2khGHVLLDdhNax/NQTssaG5WRwL+yIG16Fn27uHmrVz8WSipo1KE0+HtK3Qj X-Received: by 2002:a92:dd03:: with SMTP id n3mr5432536ilm.76.1631540547116; Mon, 13 Sep 2021 06:42:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631540547; cv=none; d=google.com; s=arc-20160816; b=xRUycgDqaRuFSEMJmyT2HHWu4EA3/61AcKOmpQ5ygKUtDsJuK3d7lao2JIQN7vusgm xy/Ki5tNKgp+1GfcpPpBCVK09MY9C75liOqO6O/xetlvN2gNou1wfBX7Pn9bVp79vOSU Y3SGqd3DrL7Bx5GsDb8/HBNzICfKOE0hKe4R38zzQ6l8w7ljVJhknl+RD4D/ZPQXAoNB YKxo2xFBJc3vz5fbughraq5OjCD6/3BBHv3mQ4V1NCFop+qjX/PyRZSOYYqnCmP2X1Am Ecndr4pQ5fB6n6chSTOHLLj5fmheq2hmy8iZsymF+p2/Syt0+4uvqG6s0KBMhQG7iLd1 V37Q== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5bVE/Kd+OjiExWddcIuQS4dfJILByyCyj6xscOjossc=; b=d1NvG7ATS3WRQ7AM/Jj+rbbDeNe7zG2Zk/Trab6vLuM2AS7r4uxf9L+DGTRwABsJKu P19582zr7cplWnMlqwpkrWKagDvCga5d4GGQxZlSpqlOPTBjTQ60JmlJO8SxPQHo8HD5 IGO9vzHVuoTXxXBc0FxtcioGibGp762T8QRNPkxn/SgS8V4Ry6PrqeWKfFaggqOdVFik o202Wu5gJBXTmyvr7/Kw/bGKOt7Hdf0A5Cs1YC5wMW+bkJ+yLm2ioCXEa6p+EuE1Ne2X 967qIkyVBPf97dEtrY0Wc67DSmQQOV9eiNUo2uRFsLcVRGT2AGHqoeBkZIu88+ybjsf3 4S6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="AB/ThmBH"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i17si6816353ila.149.2021.09.13.06.42.14; Mon, 13 Sep 2021 06:42:27 -0700 (PDT) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="AB/ThmBH"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242932AbhIMNlN (ORCPT + 99 others); Mon, 13 Sep 2021 09:41:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:34856 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243292AbhIMNfM (ORCPT ); Mon, 13 Sep 2021 09:35:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8834361151; Mon, 13 Sep 2021 13:27:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539638; bh=40GgfemtsnmcKgr6vVRvSPiq06fZNRjZCrItBHowMAY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AB/ThmBHxC5doTnoon5c4NDqqoNL6CuQEq3teAJQCqHb6S+OGW8FVgtczOZ8FTf9B MPtAosQzpD3bKhQf/OBkxvIXo2bh/5COeiqJJHFt9qWtVLXMW9mQX7PZ2bZEAe3EvL gDrN1nZhPdoEViWOtxsqNB3oXPDmcs0I3mFHE2/A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Fan Du , Wen Jin , Qiuxu Zhuo , Tony Luck , Sasha Levin Subject: [PATCH 5.10 068/236] EDAC/i10nm: Fix NVDIMM detection Date: Mon, 13 Sep 2021 15:12:53 +0200 Message-Id: <20210913131102.671493565@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131100.316353015@linuxfoundation.org> References: <20210913131100.316353015@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Qiuxu Zhuo [ Upstream commit 2294a7299f5e51667b841f63c6d69474491753fb ] MCDDRCFG is a per-channel register and uses bit{0,1} to indicate the NVDIMM presence on DIMM slot{0,1}. Current i10nm_edac driver wrongly uses MCDDRCFG as per-DIMM register and fails to detect the NVDIMM. Fix it by reading MCDDRCFG as per-channel register and using its bit{0,1} to check whether the NVDIMM is populated on DIMM slot{0,1}. Fixes: d4dc89d069aa ("EDAC, i10nm: Add a driver for Intel 10nm server processors") Reported-by: Fan Du Tested-by: Wen Jin Signed-off-by: Qiuxu Zhuo Signed-off-by: Tony Luck Link: https://lore.kernel.org/r/20210818175701.1611513-2-tony.luck@intel.com Signed-off-by: Sasha Levin --- drivers/edac/i10nm_base.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/edac/i10nm_base.c b/drivers/edac/i10nm_base.c index 4912a7b88380..3a7362f968c9 100644 --- a/drivers/edac/i10nm_base.c +++ b/drivers/edac/i10nm_base.c @@ -26,8 +26,8 @@ pci_read_config_dword((d)->uracu, 0xd8 + (i) * 4, &(reg)) #define I10NM_GET_DIMMMTR(m, i, j) \ readl((m)->mbase + 0x2080c + (i) * 0x4000 + (j) * 4) -#define I10NM_GET_MCDDRTCFG(m, i, j) \ - readl((m)->mbase + 0x20970 + (i) * 0x4000 + (j) * 4) +#define I10NM_GET_MCDDRTCFG(m, i) \ + readl((m)->mbase + 0x20970 + (i) * 0x4000) #define I10NM_GET_MCMTR(m, i) \ readl((m)->mbase + 0x20ef8 + (i) * 0x4000) @@ -170,10 +170,10 @@ static int i10nm_get_dimm_config(struct mem_ctl_info *mci) continue; ndimms = 0; + mcddrtcfg = I10NM_GET_MCDDRTCFG(imc, i); for (j = 0; j < I10NM_NUM_DIMMS; j++) { dimm = edac_get_dimm(mci, i, j, 0); mtr = I10NM_GET_DIMMMTR(imc, i, j); - mcddrtcfg = I10NM_GET_MCDDRTCFG(imc, i, j); edac_dbg(1, "dimmmtr 0x%x mcddrtcfg 0x%x (mc%d ch%d dimm%d)\n", mtr, mcddrtcfg, imc->mc, i, j); -- 2.30.2