Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1662747rdb; Wed, 20 Sep 2023 16:14:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEu3vKcb+1jhmMZMa2XWH/UL7whpVkCllNqkmMtP/Gvtf6YWxVXhsYtsXmcP26AI2LOjdwg X-Received: by 2002:a05:6a20:3c8a:b0:158:143d:e215 with SMTP id b10-20020a056a203c8a00b00158143de215mr9957563pzj.1.1695251643112; Wed, 20 Sep 2023 16:14:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695251643; cv=none; d=google.com; s=arc-20160816; b=rzFbu63NyyiWp7dwkl6dIh2cuSbvOzmArVKPAWRODS+fJiZdNL7KosG9pCt/xZb3/G 0ov9A4yVYe2fw6EE/mrfuoSc2eX62FxdGKAbIGxwQrG8htYbbmBJJipPgCj41AhKC3xp JFxAkzEiIsZg2I42Eoxx3c+Nf1WbYyB4FMGY903Y9qDogDnz5YQRokqJxZ0o6qN8jw2l nyFmamp2HkA9k/DXpqk8SoSLSJK7lAhD3jgU5qQc1cQsWqmSa7XM+OwNnNPAgQeMm/1y PppxaXLj9HhkBl/Y0yriJQEaPmSgphiigBkusNzAOjR9AApMBxe7t+oJqqtLGai7qNjN ureA== 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; bh=osBqvthiVpODVt2c1wzVUJqaUOTaV5YdFAQXjwCgrOg=; fh=RJG5TS5hvLciLIcK4vCQlwfT5qo5cdcunmEMyeiOMJY=; b=C3QE0q9c7DvgQU2000XmzIBpVX382pjhApsl5J66sAg8hCfU7hRFkblb+S71QPnxuj 5qDdeLrCZZ/m4+B+qsf/qLskAMIY/eqj3CxpSIR+Is4e+bLDg5yd4QB9RdkrDFyv+eNt zvXredexASr61qzsLXE03Vs2sIrWXtnEcnJK1L44jboYOLbaO5HdjJmTY/N1iWjEpgVw BC4sZ9dgXnxJl3gEizGbB5x9T1jxFX2H4Yy4zYW2MyACHynkxiLTaDMgb+FBF97x1hV6 AXFWX1CmkwYJM5fcsr6OkfbnOnXXRkSNs1jrMw8NwNYEPfJni6JyTOucnk+9oEWuERaq sV7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=efQrtZSo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id ea22-20020a056a004c1600b00690f8dfb431si173742pfb.253.2023.09.20.16.14.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 16:14:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=efQrtZSo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 7D26F801D816; Wed, 20 Sep 2023 12:12:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229935AbjITTLw (ORCPT + 99 others); Wed, 20 Sep 2023 15:11:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229921AbjITTLk (ORCPT ); Wed, 20 Sep 2023 15:11:40 -0400 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D552CF; Wed, 20 Sep 2023 12:11:34 -0700 (PDT) Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2c00c0f11b2so2324251fa.1; Wed, 20 Sep 2023 12:11:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695237092; x=1695841892; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=osBqvthiVpODVt2c1wzVUJqaUOTaV5YdFAQXjwCgrOg=; b=efQrtZSoYUf07dKmlWmf2IMo8cT/d1saWXatQZm9jL92dqHnpvALOPPDlztcd5Ey9j oyCgexEa6gcvnbOKUQ1Ee24hbAjCvEWRnZpEdAENydbu650D+6p/WtYENJgujyh98Jln HWrL3ydwQ5IGS29UQvB55KqtGRVthpKg8wKGHDUYUIk0zc8e6MyLSAiK5m15qCeA00p0 RzwuPrRqi4zJebMO+jMKB2FnRK8X8wLZfgFgpx5p9tA7JC5nXDQpKB4q23muOkqseOuA iaTKohFyMmBi3zKv4wZft0DWOgTTGVb2VeRM2FS7fjuo20I0KCMQR/NCfX5hmKATQymX bjgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695237092; x=1695841892; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=osBqvthiVpODVt2c1wzVUJqaUOTaV5YdFAQXjwCgrOg=; b=FwRJNliKwE+YpVsDMz6SqZd7ITh8HSEBFdqQVUWIWney1GQPawms+/dUpHnsz2XqIm 0P8meRtPb4nhN9/63U3TaQ8qrdTdbkY3jWjw8Xnunfx0VxcGkGyNsO562L8N/X4UmbZ3 ScAGDWexaKNkBy7Fp3bhx/5c9QxdcTOr4mm5QWrJRYvrXRzyONEL8mjcPLIcpqVb0Bqc rm6I9QKLGm/hkCrgnI/fY4P2fS1/he4VpvYG5t8rHcvjjgrCVPW1wXH2d7LglnRmrQhm EGq6bgttNui6oAA1T6DlVH4KXSIHxWjFrWlMeyfDhxDnaMkk0SZqhakSVzvqcMoP0g5H 16/w== X-Gm-Message-State: AOJu0Yz6+IWrxTQNdr/NDDb9V2hB9FttY+15WaOL/y5dHYhZFLk6j/SD Kp+eY7fgHwYCg6OGEPdzBro= X-Received: by 2002:a2e:9a97:0:b0:2be:54b4:ff84 with SMTP id p23-20020a2e9a97000000b002be54b4ff84mr2917371lji.51.1695237092303; Wed, 20 Sep 2023 12:11:32 -0700 (PDT) Received: from localhost ([85.26.234.43]) by smtp.gmail.com with ESMTPSA id d10-20020a2e890a000000b002c023d3dadesm1061455lji.113.2023.09.20.12.11.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 12:11:31 -0700 (PDT) From: Serge Semin To: Michal Simek , Alexander Stein , Borislav Petkov , Tony Luck , James Morse , Mauro Carvalho Chehab , Robert Richter , Shubhrajyoti Datta Cc: Serge Semin , Punnaiah Choudary Kalluri , Dinh Nguyen , Arnd Bergmann , Greg Kroah-Hartman , linux-arm-kernel@lists.infradead.org, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, Shubhrajyoti Datta , Borislav Petkov Subject: [PATCH v4 05/20] EDAC/synopsys: Fix reading errors count before ECC status Date: Wed, 20 Sep 2023 22:10:29 +0300 Message-ID: <20230920191059.28395-6-fancer.lancer@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230920191059.28395-1-fancer.lancer@gmail.com> References: <20230920191059.28395-1-fancer.lancer@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_SORBS_WEB, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 20 Sep 2023 12:12:08 -0700 (PDT) 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 sense. Fix that by getting back the correct 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 Reviewed-by: Shubhrajyoti Datta --- 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 308da6f82d3d..fff4b07ff6ac 100644 --- a/drivers/edac/synopsys_edac.c +++ b/drivers/edac/synopsys_edac.c @@ -419,18 +419,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.41.0