Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4392952ioa; Wed, 27 Apr 2022 02:52:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzuGSWzY3rI2BBkc0HWRkyLL1DL+vQoHGrKitY2PvUbBZakpn7KicqfWqVuD5ha/KlhgtWg X-Received: by 2002:a17:902:e38c:b0:15b:40ca:37c8 with SMTP id g12-20020a170902e38c00b0015b40ca37c8mr27895374ple.23.1651053141406; Wed, 27 Apr 2022 02:52:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651053141; cv=none; d=google.com; s=arc-20160816; b=RwEMG25NJAAl9GAOZgy9AUSDvOjb06s2nxLfKrE4FKH6oSOzxiG4LqF4TXuA5v9NmT N1HRa04MkaNdg+CRt2X8Ynr1mEZh7ie+TMLPHr2x9JWKKN79tEcAhagt5hSYC9pi9yOv qvObQfT7P73C5m5+ydJJpGt0XKHOuPyRD2ArX/c6wrb6bsQrLxMggeYg7garhLUDcrLB CrkDv49EQfqk7t+B6Wd3lTjK/oikhXmpS/qSadlVGCspo5kuheRoR6UEKjNOlHm3mRd+ kOFEMDUJSu3lmfggXyZ46FbWM4eGJ/N62uczUf6giXo6y7Db7ZxrrRNxg+taymtAZ9t3 Ytdw== 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=0uHUPjpOk2bO1gyWF6M+t/rYKscovOGkJNipKp6BPFo=; b=FE1J3L4YCk+i6gwZpLw5EEwu839nZQ450r8hGTvCmLKkYRLUvQuWcAm5giQeavgv3B 369P97tBfTjyR3bBuU1Nyeq6Sg8aoG0tYmFH+XTTDpLWtMG9ozMg+cnHeKRc0X6JAveC S/2ynOFIHc2tg2o9P+R0I0S+P8ZmzxnqzwyGfj1WAYuKxRyOmdyPqHqrewLipoWbGhDa E++yDHBc2InHESGNoLtC2/e8tc1FCvvZzFu+eYT2GtIzG0BsLzN1KNOOH9KGcneajge6 4Ta7kzyPKu25GptIE1fSHscmzdOMTLW8SvD3GXXR9yFPTZnnvwOKPN+/Tiy9TJN9shpE lDsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Kdy3rqM1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k129-20020a632487000000b0039e45222007si1103957pgk.227.2022.04.27.02.52.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 02:52:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Kdy3rqM1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0486929D277; Wed, 27 Apr 2022 02:23:31 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234876AbiDZJQz (ORCPT + 99 others); Tue, 26 Apr 2022 05:16:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347217AbiDZIvO (ORCPT ); Tue, 26 Apr 2022 04:51:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2B99158F49; Tue, 26 Apr 2022 01:39:48 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 41C1760C4A; Tue, 26 Apr 2022 08:39:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4E06BC385A0; Tue, 26 Apr 2022 08:39:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650962387; bh=/BAm5NTJdX2tMlaApiM7QAkYP88sHZe13rGjL+RUOcg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Kdy3rqM1aiICZ5CqrE4flk7BTsjD9Ff9g1K2xpnt5AzVo1vNSUP4XMIzvgAL4qQO0 /ihmDbFHCusFBk1bUl14FEoR9APuNcnJVyBcFtvN7KCoE98+9MuS/7wnD2GpocfA87 mO00UFUgZhCH9FZU0gAwRyF0AkUegRzwc8u8mLt4= 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.15 077/124] EDAC/synopsys: Read the error count from the correct register Date: Tue, 26 Apr 2022 10:21:18 +0200 Message-Id: <20220426081749.489594896@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220426081747.286685339@linuxfoundation.org> References: <20220426081747.286685339@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 @@ -163,6 +163,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 @@ -418,15 +423,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);