Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4452188ioa; Wed, 27 Apr 2022 04:18:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPWiqBEV73pfj7Hu3XzNWSLtGsD0fxUKUm7f7NJBJrR5oBHerGnorUzN9RBofF3+AMOWWz X-Received: by 2002:a17:90a:5d08:b0:1d7:9587:9288 with SMTP id s8-20020a17090a5d0800b001d795879288mr32430714pji.204.1651058288555; Wed, 27 Apr 2022 04:18:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651058288; cv=none; d=google.com; s=arc-20160816; b=GT7TH/Y5VDqMSQPDpHC45A+NvZ5ithqdeKsYLV68Jg+RHVUHqDKaiFCc0w86yIWpNR 5YThrOMz8qXQ9k79fE0Lgcm7f+y2vyzzuE+j5Rzu5CTiNMJWfyOMYadHXZyZLrdO9UyL RzvgxQwZagmiLJZFgD4Nd73fOG4OKJmQy9ck2ylHGAmI8oqohhZpt4FO3sBSH4qBcUEC L870NYVZLWFjcPyxLlYhbWeV21uqt2TdTrK9i1UKxW6tZwzyduXbjwVWW6O/Bf6QQWTZ o1mZK90MNUH7jA/4Doq82Ck1D3UMYFLo6JmsMsradIMfCOTp2AhFzjD85jUzb5aNl/1B U4ig== 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=rur+2nhxwgobwetgR5G0xULXgFfdkgCqsG8NptLuG1s=; b=TMT+meKyFs59eRbbOkyBxQKfLHHn9FBdST80vbmpKx0YI8uzTlKQ96PlusJ+fkU5pV o8JcQTWPcD5oAUvS/thL9SAQQVZkXd/835jlpi7Xg6SvEDQ6SvrvyK2D2eAsPDFePp1F TMmWLAuTV5T++WtuvHmTchuk0Z4gIfVmx3e+ykdWTh+JBVucNY+xxJytonabWHaZqvc8 meAh3liCk2R4bEJsiWU6epj142EBaWotOFjSbh8LS8/oBfAevnSqv7v2ngFYwwEyAbBR JF1soTNcZ0RXZp2bAh4SkPkmw+FfQ+Pcq46MQkv7b0qOOPFoTSV80geu0nHJTzF32rNx muCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PpS5chCj; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id r28-20020a638f5c000000b003ab5074621dsi1274807pgn.214.2022.04.27.04.18.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 04:18:08 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PpS5chCj; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 06B00464506; Wed, 27 Apr 2022 03:12:04 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347728AbiDZJd7 (ORCPT + 99 others); Tue, 26 Apr 2022 05:33:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347868AbiDZJGT (ORCPT ); Tue, 26 Apr 2022 05:06:19 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 889B2169413; Tue, 26 Apr 2022 01:46:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 2057AB81CB3; Tue, 26 Apr 2022 08:46:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8950EC385A0; Tue, 26 Apr 2022 08:46:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650962786; bh=rq5FHE9UfEIhmfpoeDO2X6VA78krI4zQucUGitHhanY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PpS5chCj2hzqkDCGtJFe+7wimUE4h3m0xjucToK8NUW3Tr+KIriCtJU1L1X11QFfa IobXDFnq+6dVXeBtHVwK+KqPdfortIB7SpcA5fiObFVScE8A1+KRHsR0113Efdoh5b 1JBVIXsrbWexYltkBRGV+QhUCxVEmqS8plwm2uz8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shubhrajyoti Datta , Borislav Petkov , Michal Simek Subject: [PATCH 5.17 088/146] EDAC/synopsys: Read the error count from the correct register Date: Tue, 26 Apr 2022 10:21:23 +0200 Message-Id: <20220426081752.532823717@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220426081750.051179617@linuxfoundation.org> References: <20220426081750.051179617@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=unavailable 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 From: Shubhrajyoti Datta commit e2932d1f6f055b2af2114c7e64a26dc1b5593d0c upstream. Currently, the error count is read wrongly from the status register. Read the count from the proper error count register (ERRCNT). [ bp: Massage. ] Fixes: b500b4a029d5 ("EDAC, synopsys: Add ECC support for ZynqMP DDR controller") Signed-off-by: Shubhrajyoti Datta Signed-off-by: Borislav Petkov Acked-by: Michal Simek Cc: Link: https://lore.kernel.org/r/20220414102813.4468-1-shubhrajyoti.datta@xilinx.com Signed-off-by: Greg Kroah-Hartman --- drivers/edac/synopsys_edac.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) --- a/drivers/edac/synopsys_edac.c +++ b/drivers/edac/synopsys_edac.c @@ -164,6 +164,11 @@ #define ECC_STAT_CECNT_SHIFT 8 #define ECC_STAT_BITNUM_MASK 0x7F +/* ECC error count register definitions */ +#define ECC_ERRCNT_UECNT_MASK 0xFFFF0000 +#define ECC_ERRCNT_UECNT_SHIFT 16 +#define ECC_ERRCNT_CECNT_MASK 0xFFFF + /* DDR QOS Interrupt register definitions */ #define DDR_QOS_IRQ_STAT_OFST 0x20200 #define DDR_QOSUE_MASK 0x4 @@ -423,15 +428,16 @@ static int zynqmp_get_error_info(struct base = priv->baseaddr; p = &priv->stat; + regval = readl(base + ECC_ERRCNT_OFST); + p->ce_cnt = regval & ECC_ERRCNT_CECNT_MASK; + p->ue_cnt = (regval & ECC_ERRCNT_UECNT_MASK) >> ECC_ERRCNT_UECNT_SHIFT; + if (!p->ce_cnt) + goto ue_err; + regval = readl(base + ECC_STAT_OFST); if (!regval) return 1; - p->ce_cnt = (regval & ECC_STAT_CECNT_MASK) >> ECC_STAT_CECNT_SHIFT; - p->ue_cnt = (regval & ECC_STAT_UECNT_MASK) >> ECC_STAT_UECNT_SHIFT; - if (!p->ce_cnt) - goto ue_err; - p->ceinfo.bitpos = (regval & ECC_STAT_BITNUM_MASK); regval = readl(base + ECC_CEADDR0_OFST);