From patchwork Thu Feb 22 18:12:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 13567859 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 E3BB8C48BF8 for ; Thu, 22 Feb 2024 18:16:10 +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=yFW7YYopqdoHQ3JtB+kmaOyNtFBQXo7e1+ObftyjW08=; b=vL6EBNZ2krwgN4 nRmt2o/7dOJ4U4/4Yz0Gspz8I818rp0kNa0tITAJNwvbyVBdEshnK3VJLmaiQ0M8rAkKiZjHRRwVp uRTvf34GBFex20t00XFTtNDZIzC5ZQOcPNAsVO3dQ9qzAjTVl9XFz9vE8j7npMYXNU5NgQt1EyXO+ s6BURNwyhQigM51XP2AwurlSizMq0EVGD5hybfzPedUswWhfVpFIgU4wvB6o7deFZUe+A6vWFicfL 4NFy3ixe/6EtpGSQ/jsRPs8YlKh+WzkJZxMpOBHkTOHln1fOHJDKELk7YoXDt1uGxiTKmPY5DdfaF 1pJnqwnt2HKoCmqw78CQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rdDba-00000005xYo-18A5; Thu, 22 Feb 2024 18:15:34 +0000 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rdDai-00000005x3z-3ZAo for linux-arm-kernel@lists.infradead.org; Thu, 22 Feb 2024 18:14:46 +0000 Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-5129e5b8cecso97994e87.3 for ; Thu, 22 Feb 2024 10:14:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708625670; x=1709230470; 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=WbPuoFHthQO7fGdQQUUYWZPA9hiREThQLMfvHVCy2ro=; b=ONe/z6ddw94n9dBjRdJ4Vs+1zkO87WSKR1996qCgWlvkoTqLhS9Tj0dj7UhJ3Eu0li jMA0yWkSkH+Yfxdz6zDCQLkRH23fc2h+esvbgJJLwrvWATIQ6uV+LIy1WiOpSgmiQP38 YPk1oxjpltXo5U0TU22gTp6HzH1sPVtqbrFdghw2GmXabxtsQIaSsq/u27ekb5wf72dj SMQ/Iht/dfvToklJtMOovcE3YGjH04+O7fMDLGeoKNke6QFOal9y/HDOdZMU5QQ13nPn kGMxqYa8NcuW10hGkveMZZ65y8qVM92+NkjDATy3m09CfowES9vAU6PJF82CHuJbv5Vx MZCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708625670; x=1709230470; 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=WbPuoFHthQO7fGdQQUUYWZPA9hiREThQLMfvHVCy2ro=; b=D0FJvOt1/YH5IHeiqp7wf3EmM3d9lPWNAAAyJowA0+GomBhg9QQO5mfESkLe+oA4hv ASjMEnWtnImpNr1pDio7ajMYxDloWyPpi5xy/9BnA1KI0GgGILOZIVdwJELA0XhwwzfT N9WM3MJw60bbTKh5f54+erlweGCppy4iPVBz/I5XDwJoG+DX6BxOWQc6/I9n91I09XC/ EpHIPR+zvVPBhbwBgtpMHE4+2Fown3y9043GpVLFdfPiCabpa0yRxlof8b3l79QQeeFi rjAmiOP5zMSSuwQtnPBiJUNl3pKFnKe6SQYJxApt8dn8uzZgLv2ree7oUIZlfkWJupBs l5WQ== X-Forwarded-Encrypted: i=1; AJvYcCWKdX1KPX3VB4GQSFbyRkunnzexDx/LuEopBwMd2graQNNWFfqiOxYgA7D/vNum/QOFSIb7e8rItlhBJtwg3xYu5yaBf6nJEFyqTLsOO1yglVHlzA4= X-Gm-Message-State: AOJu0Yw/ZwJwg53NSV+RRafs3TNSRQ3pFEctqoGcCjJ6dGhPvoeSQC9X Cc6E9pd3VjniBHqeHT+na3bmbWgnFPTOjdEJ6oj/ws6q+vI1qrq1 X-Google-Smtp-Source: AGHT+IGub+R7lksw83N6+DHfltE4tBIGvnJJIwOUCUdGcZp49D75S0w8KHqmr2FCPWTC9/SRdqNmdg== X-Received: by 2002:a05:6512:31d6:b0:512:a9a4:d933 with SMTP id j22-20020a05651231d600b00512a9a4d933mr12295115lfe.69.1708625670043; Thu, 22 Feb 2024 10:14:30 -0800 (PST) Received: from localhost ([178.176.56.174]) by smtp.gmail.com with ESMTPSA id t4-20020ac24c04000000b00512acc62388sm1837562lfq.237.2024.02.22.10.14.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 10:14:29 -0800 (PST) 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 v5 05/20] EDAC/synopsys: Fix reading errors count before ECC status Date: Thu, 22 Feb 2024 21:12:50 +0300 Message-ID: <20240222181324.28242-6-fancer.lancer@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240222181324.28242-1-fancer.lancer@gmail.com> References: <20240222181324.28242-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-20240222_101441_549369_64A560F6 X-CRM114-Status: GOOD ( 15.33 ) 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 bd6e52db68bc..fbaf3d9ad517 100644 --- a/drivers/edac/synopsys_edac.c +++ b/drivers/edac/synopsys_edac.c @@ -418,18 +418,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);