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: 204938 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp122472dyb; Thu, 22 Feb 2024 10:17:32 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUnmfD4tomLvw0wwxh48517WSsDTtSxmTtEwPyF05ZLuXYMv6emp8T4d8forTS5FiXmrxG465257fjVklU+iORTBLjUSA== X-Google-Smtp-Source: AGHT+IEH8yMYwbfsP+bqerk5cPwaR9nvjiAXGhIkWW61zMzsND3F8C85OrXHqbKkrkWRFt4+UTHr X-Received: by 2002:a05:6402:1647:b0:564:aac9:840e with SMTP id s7-20020a056402164700b00564aac9840emr7208194edx.11.1708625852349; Thu, 22 Feb 2024 10:17:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708625852; cv=pass; d=google.com; s=arc-20160816; b=j5K0uICvs7uVuGCZwarHcTfn2XgNCZ0+eawc8t20MqDXzc9soVSJ4jvJvgVWwFKYi1 T8g9RWdvas4XC3gAGlhtbhg17efm6zq+Yf2pImzyCcOPqTBr5PF3jAIzOfdeoGmX6CbS oBcC4Rk4DbJwGfZKi0NblPHJSDtdiqzYZDVKORS1eEPeunmi8qW9gUcvIgcWQYgM2/nb sFHTvbQun8B5NVHYvymWtiWTqo49UGap8pr19ZFYNsZ2xpeN1TLBs9jlKX68t3fDLwTL UwfHmFh3I2xiWMow0TrupHsu3FkrlYitKjwPL7Sj0xET9xrPqOYMMIYgtX1rmKZEKmQy O8bw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=WbPuoFHthQO7fGdQQUUYWZPA9hiREThQLMfvHVCy2ro=; fh=HU4sW2/iAWQyVwQa1Er4SiS6bA+R8i6ee0cY4pL7N9Q=; b=MyQ+vtIzPsPhQBkpLLNf6yo32EDoEapa5p3ZnL/4EgMVB7B5NMprJyBV4TsS1S2Ctr ENpGPLvxe9s/brMN3qebFp7QOS9G8so0fN+OXiMh6QjxSXCTMF2CMKTYG1FcgChGkO7w rie1uFhQ+1V/29RuhtgFXh74mdo0rEL9F+SDSaC3PT6EiPz4sS6RpNHeUgJWoZWJ8esf CQoYTN9qWlpj81001hDgeRo6vtD3NXCR7DvJnJZtGOq6m4OouiObFE5focMMp8Xv+VKx KVFjFcpJoc651fOw164gXc74bgq+skApnGtzALhdnjHmQN2yQ78gB2P8TVEpf+LF3kQO c0ag==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="Ue0/3Pe+"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-77063-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77063-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id g35-20020a056402322300b005642642c521si5430140eda.633.2024.02.22.10.17.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 10:17:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77063-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="Ue0/3Pe+"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-77063-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77063-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 5D0741F24F46 for ; Thu, 22 Feb 2024 18:16:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6037E15B0ED; Thu, 22 Feb 2024 18:14:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ue0/3Pe+" Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DEC1215959E; Thu, 22 Feb 2024 18:14:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708625673; cv=none; b=asCFZHCESruGdYSwV9//BgYvDCXG655Sk2eDC+bt5u0VnxWCrRjUn+j+AXBksfr5u1/KJxQb2Btd15G7z/0r7mSGUP9XPcm0Pj/Ub9c+NpP0OIrRWq7cUiyDrtTrjmh/0Pzpivn0IxomyCbUPJTh6rVkTtLHHtaWma6IxzZjgnU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708625673; c=relaxed/simple; bh=oGXJR8OhoCabOTPanO1K+l2Sjh3ownabZ5/7tEogxag=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dI/R3j/tVC79j51ti5T5V+vMEoibYXi1PO/XjzEhL15vdFLhPok1k4x3x/OWfQ1b2784r6011kg4ZmT4L5nH4dDvO1IwXJYZ3JWq4mxviRv2nLsiATcHXJ+AwJ4JxCOuGSSvK4uV+8utmJoCeTjGBeoKrzZkMztoh+RnFal+Pnk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Ue0/3Pe+; arc=none smtp.client-ip=209.85.167.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-512b700c8ebso117215e87.0; 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=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=WbPuoFHthQO7fGdQQUUYWZPA9hiREThQLMfvHVCy2ro=; b=Ue0/3Pe+98cA6Dx8aXaNIy1267GfazE0vHHCY9ei5ADgtMhWGXUttPRDFJreOOcep/ jVWKh0Hgc4QgSLyT/Nx5Vd26iOhPhrV1xUOnigRkur67vXrKmhkX8BxdvDjvnPviLnvH AD7apUbirr/QN80LsxgoH9ry/uMI87xDuyBLFhH8xYp7NBxmGWkX6tBqjbbDBAORgm9O RmPQ/2SazPu+xBKZFgZ1GPVJHurljQegMSau0NP4/90oFSjTjo5kfyYivpsh2Id+RgXf jNPcWGU4kex+zqgC2G7gNBTRJhpJe3RpMAiMAVxDMY1zHF0rkUn61nuJPRaSAkp1Kh8t OdxQ== 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=GulIygj5WUKCmGVQq8hTV533J5L1ogafeXVXlkfLrPxVvfvhe9JHNCKi/4CHJf7bwz 2a+l1Usq9/e4nXsF/Gg6uvP1aXJxk7nlDNx7Im9rtZsa1vz2oUtSldWY9Bm5sqJ18vES OfobTogfp1Kvq0JE/8r3OPeyWDIcYzSd0V+Q7dZ0+q4sfdGovloRVT/kj06ZiiYQAsAB rec38Wl1rjIbK4JdBxZW5R2f5YOSpOxdqhzinOAYYqEBzcWWVnNoECKUs8Pr9quGW8l3 quY+NXkQt/4eYPcB0LNsl99AGDG4otVhwZM089SVUpBUK6P/XLOJDFtJZ087iwuYus5U AfWg== X-Forwarded-Encrypted: i=1; AJvYcCXRgM7vyQaMi6GYcy4BgUTFFo7CHW9QVG2FK7JM2bzBZcbhHl0NVZz5V7i18alsV+l+I6RHR2Ha+ne3Eu3TpXX1LRJLMnSTxfj1QV2uX18zlBZNKRVjKe3s3ppSEgJn4/G7fgHgsZ6LYw== X-Gm-Message-State: AOJu0YwFOejWtaqBUBayIMVGGlB6lTqdoNmG7HUpGnnCf+QdcA1Fdke6 5twace8Fj2SW/AxzR+Rrls2ptPCyBaHf50z2GtCkKZbZYAkVZuGb 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791624061695048161 X-GMAIL-MSGID: 1791624061695048161 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);