From patchwork Wed Sep 20 19:10:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 13393256 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 464E5C04FEC for ; Wed, 20 Sep 2023 19:12:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qBILS5U+/I5by1d+hdyy7zhKytlKTwBQ7EvEi2xUVyo=; b=cFw2BS2ODhkNqs cGE1vGRcVo8/4JM4sXuaYnS/EoAkUmUKXnYxwQbgXCW9yBjKLS0AKz3fLlAxYFaJp4dnEiUK8q/Ju qh4c38d7QV9UTeYWprgaV2O/H1uCAxK7EwaDGe7DOJvB6c/HUU/wN/2nBlPojZUtYFKf3Wxc0IDAh bhLMWJbh9E62GhUp9mWgOYQH+cZzjkkQkX5fzSSHdvCwKblJRXi8azcYV7fiE5PAgsPt4VpHJQ+rq qRYuwIch4t2iSus/Lp9PG282108iV5l1eInrTbOA/T+N4yie+YfRGUy88SY+MyEjPrZCwUhgcfiqT IbjOL9+cz0yTFzs57HfA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qj2by-003x2w-33; Wed, 20 Sep 2023 19:11:46 +0000 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qj2bn-003wuT-0J for linux-arm-kernel@lists.infradead.org; Wed, 20 Sep 2023 19:11:36 +0000 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2c00c0f11b2so2324261fa.1 for ; Wed, 20 Sep 2023 12:11:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695237092; x=1695841892; darn=lists.infradead.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=RIg7AQoKmOS5oKE3SUIuOky2ZUlD9kF98Bu5xteG+g6UC+U8Ko/GcF0Aphmp78N1px 5ESzdGBHByTag3a0srVZe3j5FnCPCPUbHbo2Bk2Ov/TCM+z7MUZAbkBw+ItGvXHKxxdx Yzwj/95csVKEGkSkbaEI914E+zrAcTl/ime+B3noTrSRDtFKJastsqfc27JN2feBTmEH KqsKOJm0xqw6IHz2fPqFT/ajBCdQgKjndtqLLr0eLTIblVbtJk+DpEiFNEdQA8MuAQsD kktK3klw2VnYmN5SpjD2aw+czFysYGKlvwwuyWHN267o4WvYx3748ATnYK5+6Fmpd7mG OBcw== 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=jv1WMz1nI1Feq7+p1U/kllLZZpFx0IG3mBwxsmfZf28xJgfqGWG6lf/aEU2gjuVNoY RBndyr/h+S764tu3EcXHVvou2sR8QsQH7hTVjXy+xIyFRyWhsxM0pWy+oPtg5OMhKRxf 4vyM5wIE6ayDM0SNOaB2EkNbxvuUmC4L2i4hKK3g1K30M0G/Gu3l7fITP6w9eGVc+UPz 4o9X2NmSD28jcJxZRwvvgqmlUt0qcoXraTxbg1/xwLH6r6GQBm2iz5W3XZiRNfhsCoYh eCokkWUtyViiKGkyI9C1EzVV7uvl2BiIQHzuYUdEaZd6NTUN5s5ngGRjVICCTshMraKO Go7A== X-Gm-Message-State: AOJu0YwEfxEQ0ZgBRTTF7NALONFZIe4tYGnMZjKN7kTovq14li1udV/o tGcxMGBChlzMu8AhApk6N1A= X-Google-Smtp-Source: AGHT+IGnTKjiNhn/9kC3KwPltttCQCu2dvvWsIdie+bvalpNb96ncreNZ221kglbiXEEJnidC8kSNA== 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230920_121135_140042_92D2CBCF X-CRM114-Status: GOOD ( 15.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 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);