Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp3485380rwn; Sat, 10 Sep 2022 12:45:16 -0700 (PDT) X-Google-Smtp-Source: AA6agR5VNB/lbESSsuJpvCERWPx9JquYItyfCV29wZLzoLEBJmjU64C8+dr4eOb7DemLeZUzfISg X-Received: by 2002:a05:6402:4150:b0:44a:ec16:def4 with SMTP id x16-20020a056402415000b0044aec16def4mr16546439eda.21.1662839116767; Sat, 10 Sep 2022 12:45:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662839116; cv=none; d=google.com; s=arc-20160816; b=ay98TlV56ysi0tG9XTffpyINNhD+fGrth4i7PXgQfp02mBZsszYUOkNDE0/hJ8kd8X YHDSWpWOGja84o+MKZPRbmKCOjkys5X+qjbzCrpED45p9EOgpS05skuurLopahA4B9Cb jGNz484uvZM9gfEuKBWU3njqfYYTcvYgshtdF78me7v1OeiRBPb2sCWumXW9tC2f9Qv2 xRnZ2adT4nvB/M6XM39MtivjxAEZf9GXEPFt/7iLRfMteSqPNP8JJhN4j+GnhuYrbMIe uZOkjWcTqkyf+n4VuMGOCGmhfbLV2VGwD20Gt1i8VFTE5KNjClZg0ihfA7apiL3Cwnmu FCcg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=gE9kv3YrzFeBzVnkwDeL/iNcijqP7kKHeYIL2hqIdeY=; b=zOAWLEphR5p5Lrv4bd5wXyhWGetDRPKpkUUKfgVPLzKtPDmpgedrDfCsJwaeSRZZxU QiVWjXcaal7ct/LF4TjP/0ZfMEAxA0QvQzUJAbQqf2yZhc8+kViAG6lhn5yMLEomi+YG haxwxO/XIbdwH8MDf1IvmPx8f+cmngWnjIiuDdXxMvq+z4PtxicB3iXYPhjthgGbVLK8 VodIbhGuSTuY+qrWI7rzOgmCARkfkxbj5MbARe8Jm6FjIb57wxvVxsHZ2iNEmppVEskg n9g7nLCp8nks7N1Kb1kzry4C45nwxB6PLFBoWcpFPS/blN/xhAq4s3PCUl9r+RsAcmfr JIIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baikalelectronics.ru header.s=mail header.b=Hq5RAO+q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=baikalelectronics.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qw10-20020a1709066a0a00b0073d6b849d4fsi4205126ejc.731.2022.09.10.12.44.50; Sat, 10 Sep 2022 12:45:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@baikalelectronics.ru header.s=mail header.b=Hq5RAO+q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=baikalelectronics.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229609AbiIJTnV (ORCPT + 99 others); Sat, 10 Sep 2022 15:43:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229643AbiIJTnP (ORCPT ); Sat, 10 Sep 2022 15:43:15 -0400 Received: from mail.baikalelectronics.com (mail.baikalelectronics.com [87.245.175.230]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 20E5F42AE8; Sat, 10 Sep 2022 12:43:03 -0700 (PDT) Received: from mail (mail.baikal.int [192.168.51.25]) by mail.baikalelectronics.com (Postfix) with ESMTP id 99E11DB9; Sat, 10 Sep 2022 22:46:34 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.baikalelectronics.com 99E11DB9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baikalelectronics.ru; s=mail; t=1662839194; bh=gE9kv3YrzFeBzVnkwDeL/iNcijqP7kKHeYIL2hqIdeY=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=Hq5RAO+qTHGrUwHPW8alBeJ4Vr2sndwAWnvcLUFjLbFNGPENINemwRNePHpGJGo1I fp3DyeZSCvBVHJu+i69xNlWPIqqpK0/55nSswV1rMqF2vsmbnpjyObwUer7BiS7pPP i89/cdq5XeOMkMowRXLwINa0cOI1oXOqXxbH8Cm8= Received: from localhost (192.168.168.10) by mail (192.168.51.25) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Sat, 10 Sep 2022 22:42:43 +0300 From: Serge Semin To: Rob Herring , Krzysztof Kozlowski , Michal Simek , Borislav Petkov , Mauro Carvalho Chehab , Tony Luck , James Morse , Robert Richter , Shubhrajyoti Datta CC: Serge Semin , Serge Semin , Alexey Malahov , Michail Ivanov , Pavel Parkhomenko , Punnaiah Choudary Kalluri , Manish Narani , Dinh Nguyen , Rob Herring , Krzysztof Kozlowski , , , , , Borislav Petkov Subject: [PATCH v2 05/19] EDAC/synopsys: Fix reading errors count before ECC status Date: Sat, 10 Sep 2022 22:42:23 +0300 Message-ID: <20220910194237.10142-6-Sergey.Semin@baikalelectronics.ru> In-Reply-To: <20220910194237.10142-1-Sergey.Semin@baikalelectronics.ru> References: <20220910194237.10142-1-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 Aside with fixing the errors count CSR usage the commit e2932d1f6f05 ("EDAC/synopsys: Read the error count from the correct register") all of the sudden has also changed the order of the errors status check procedure. So now the errors handler method first reads the number of CE and UE and only then makes sure that any of these errors have actually happened. It doesn't make much sense. Let's fix that by getting back the procedures order: first check the ECC status, then read the number of errors. Fixes: e2932d1f6f05 ("EDAC/synopsys: Read the error count from the correct register") Signed-off-by: Serge Semin --- drivers/edac/synopsys_edac.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/edac/synopsys_edac.c b/drivers/edac/synopsys_edac.c index da1d90a87778..558d3b3e6864 100644 --- a/drivers/edac/synopsys_edac.c +++ b/drivers/edac/synopsys_edac.c @@ -423,18 +423,18 @@ static int zynqmp_get_error_info(struct synps_edac_priv *priv) 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->ceinfo.bitpos = (regval & ECC_STAT_BITNUM_MASK); + 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_CEADDR0_OFST); p->ceinfo.row = (regval & ECC_CEADDR0_RW_MASK); regval = readl(base + ECC_CEADDR1_OFST); -- 2.37.2