From patchwork Sun Apr 24 01:33:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sherry Sun X-Patchwork-Id: 12824724 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 860E7C433F5 for ; Sun, 24 Apr 2022 01:36:31 +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=vn4HHnDfou0BQCYA3dahxIRCfpkYC+9/Brs6NSQRKVY=; b=YBWxN0ebfTxB8N ZVoybRESYTHJfOgjoYi2KL8egz71nmN3AwZkPMGgmGFUu+pMqGjeMDqd7xMakUHjMTIiddVWr5YU7 LTNWUvnDMifNWxEUiBA1K/NSIwZ2inDmABJpDLk/Imfdy1Wp47jAf+G7ODtPRIibDorxBA31w0VCX Jfe60Z5yaxeMWEhD8NPVlPjeBpiOSVUOzpj+CNniQItYnx5LgBR/2hdxs00zyAXSiVZjTFI79OsP2 zF8Bu2ZjTejjKw4bLVh//JXJ1dC/KYYvHHrWK48V9nmP8ksNMnmyXNaWw1oyXcHhUy0lh675McMHS jOJEzCSFRZJTPecDwTdQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1niR9W-005UPt-EK; Sun, 24 Apr 2022 01:35:06 +0000 Received: from mail-db8eur05on20606.outbound.protection.outlook.com ([2a01:111:f400:7e1a::606] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1niR9G-005UKy-Ob for linux-arm-kernel@lists.infradead.org; Sun, 24 Apr 2022 01:34:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QwfGDj6GNjU9zqATBF/d/vVrUFIIXlB0nfOEgtX2sKSKvLDXZ0j2vkF+iDCZBIwwnFwLg2k+hZ1s50lX+7epalCMpiY+4ZwF2q+5mrsKM+hikdjtbngjAgU/lE+5cVXqlnJyUY8bEEmgmZyjrPyw/iY8O2+Vid1wQf5pigqjm7/1Z0Y8YydSKTzlWr6wKDo+0egn/WipGK+JEdYGbX5ti1iy40q8faJhnIIproBMkna6uNv7zupX+pZ8hNQH6Nz+VMDAtHqavnLSl4/+9GkNgh1s3QprieBkPaeO+ch7HGWLUjAdiEj05fh7zRbFLQ+Soj2Ictn3lWARAK2fBWTiMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GBHGuiW5vKz2K5ENMsre4dcfvp6lcl/u03OSfuPSQtg=; b=lKmNUlLRYoYDWzKuOJ8vvlMQNFNnBsNJHk9ert3aS8vWZPU6JWjrYHIkQE74RpP5QNllMRA6+u/BfGNX2tc2gFDpUx/Cytk1G8BGJWthpa2LsBJOUeXFRNqlfqI2PpTBA7KTJrcWoAOeNgysshGlhbD5DVILXWxg9n+PPf+Kw9zdqfRhulqVP+oNKxDDI512LxUpeSK2JE5hHd6VGO4SFWTrzMaVHnoGkpWIJEB3+DfbsILo6NRovPjqayUBT/dST0H6eJvFBjd4QUF0vQlvXrNP2NfkjRyuR4HA7EDa5L0SLAeo0no75yzRxLNTc2iZv4RuKE/cBH2HTycYNIhdpA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GBHGuiW5vKz2K5ENMsre4dcfvp6lcl/u03OSfuPSQtg=; b=VgzDz8kR9aqr+rUNXn+2xO8/ZBDHquO/wYlI2jTuasi7StEzPhBU6sV9aTFQPUtRyA35M8YYiA6kjcbbp53rQwT144l+2wWYAVJn+lPbsMyvbzK1RBDi+3TV/kCorht6eTPE2bqx0g4ASC8DV0urCLCGzUUgsroQjX12Ks7HJfo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8404.eurprd04.prod.outlook.com (2603:10a6:20b:3f8::7) by AM9PR04MB8179.eurprd04.prod.outlook.com (2603:10a6:20b:3ec::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.20; Sun, 24 Apr 2022 01:34:47 +0000 Received: from AS8PR04MB8404.eurprd04.prod.outlook.com ([fe80::1cff:564b:c3cf:46e6]) by AS8PR04MB8404.eurprd04.prod.outlook.com ([fe80::1cff:564b:c3cf:46e6%5]) with mapi id 15.20.5186.020; Sun, 24 Apr 2022 01:34:47 +0000 From: Sherry Sun To: michal.simek@xilinx.com, bp@alien8.de, Shubhrajyoti.datta@xilinx.com, mchehab@kernel.org, tony.luck@intel.com, james.morse@arm.com, rric@kernel.org Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com Subject: [PATCH V3 2/2] EDAC/synopsys: Re-enable the interrupts in intr_handler for v3.x Synopsys EDAC DDR Date: Sun, 24 Apr 2022 09:33:45 +0800 Message-Id: <20220424013345.7359-3-sherry.sun@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220424013345.7359-1-sherry.sun@nxp.com> References: <20220424013345.7359-1-sherry.sun@nxp.com> X-ClientProxiedBy: SG2PR03CA0121.apcprd03.prod.outlook.com (2603:1096:4:91::25) To AS8PR04MB8404.eurprd04.prod.outlook.com (2603:10a6:20b:3f8::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 95dac565-f69e-49fc-9ffc-08da25929dec X-MS-TrafficTypeDiagnostic: AM9PR04MB8179:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PZ9IslbNCtHp9pqdJEsoY4BLK4X78jHxk/pqg2Yx0nUZf2K3FY8Jn6Dtr/v3X9En5s/kQY1UGr1lkNKCqikGwqXxl8OElMfLHmiIrs45pH87rinKd/uve1EcruO+yjoo6mA8DOYF00JiMFmwq7cNm4O6upJGiqgJaTzYtaSsjw2pVpls+lv5tYQf+cxsiBuYfeUlWDAzshxuFcXIS/tkdXBwfj2XyOhdMG0Hp+teSn8LyxiEM20WFk3kgr+0pKu2EceFIdSTWG9sRCcyFaFh/aJvv6XKXT2M0n7z9CauUlhp2POFE3iS3lkc/b2mx2vTwElx694KMP4qyTrJ+Cxtjd2yu1j2oZCKrGPrX5XdE9DunBBVz7aumY3Xc8ZWfYnOcqpJWjoBFy2qSIf0GHMEyuPH4eOxX2jZBTnMo0ktSImBTvKXTL6dSeEEOFAO+ZMdGyzzit941+49NHEjxboUa2ZkEloeHXInmTzmYyDCSY/M4u4izhexXyOIjSLUul1FKOyc8g2q6lIGAH468x6JYOw4haATK5hTdUFYTEY1gwre7RpicNE5kKCVcit87xNQYpebDzcTatRgE5WmqM015gwl4Bc1Y2wgVvVGIFLLpSL0ksgafZtoW7A6B5/Oi1ZF16BH6Jzn5kwJdu98Z0KJ+ph7DA46ViixkHbSNxNoD0YYO1f71vVhaqWIFc2xirfBAt6bKxD6YCh+rQLyOVuWAg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8404.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(38350700002)(38100700002)(5660300002)(8936002)(7416002)(6486002)(508600001)(66556008)(316002)(8676002)(4326008)(66476007)(66946007)(26005)(186003)(83380400001)(2906002)(1076003)(2616005)(52116002)(44832011)(6506007)(86362001)(6512007)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qi3bYsAaaQP+Yk8Dz+pSalSqnd/ej4aySd4c0ptN38IOMezrEx70Li4GN5mMn+dIqKbEsMo3yneFZofQeW0vMLUxYszCsuR1dkVk2VuNuY5gT9Zbs8pMsl2yhsSmQWy6nMi5AeQK9dM/WLAXfogr+d6+4s9wJN2es4o00IQSRSU5sg67wydUfGX62c7SNT1X0J09bWv+QRIfnMh9KsmWm3LMkvMJSNujFOL1Z8UbiF8CyoL5jPJ/KgrQJWKcdf4bE9M0Ac0t3PXg1BK02I0bRJVyFoZZx4ZKiLc7+O/Vj0b98mfcxNau7y/HLbRbtscWSuSSoQuw8ZGVrPzuJ0WlI0M8OaKDAuJMs/mhu9j+Ko/dz6BfcwJCBeFfOix4wBbPv1RQ7g8s0nS576R8HT/GMMIx8Tzy3FZVR70WoauQNVAHrnZVPjdCyMDBjf/FNzYW42pD2xBSMxNFzRtsF3tMMA8bWXX3pT8gTNWKQ9JtLxl8Yw7CngGNR1QPiRzhbwqQxSlXxR3L3kPd52BqIzoZR62yEW75qXja9lAjrV5lbciogQ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m4YuzTRuRq3uJ9XkdVRQEREZu750Nlsa3Ff0jxOINvifyi5vpKEUa5pxufKY47N0qFXlHas9EQ5EQBbtz3R567BTAcORyKjlw5WR4478fMQIXqAw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 95dac565-f69e-49fc-9ffc-08da25929dec X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8404.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2022 01:34:47.3360 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wetpHt+Z+npMFZRxE6s5bgoJyT56UeJH/yq8iORP2TUlBmJGyJpHCl0xla9eIg4oP9Wvk2wIXx5IHurThScEnA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8179 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220423_183450_876553_38FA6FAA X-CRM114-Status: GOOD ( 14.18 ) 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 zynqmp_get_error_info() writes 0 to the ECC_CLR_OFST register after an interrupt for a {un-,}correctable error is raised, which disables the error interrupts, then the interrupt handler will be called only once. Therefore, re-enable the error interrupt line at the end of intr_handler for v3.x Synopsys EDAC DDR. Signed-off-by: Sherry Sun Reviewed-by: Shubhrajyoti Datta Acked-by: Michal Simek --- Changes in V3: 1. Improve the patch title and commit message as Borislav suggested. 2. Simply move {enable,disable}_intr() upwards instead of the enable_intr() forward declaration. --- drivers/edac/synopsys_edac.c | 47 +++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/drivers/edac/synopsys_edac.c b/drivers/edac/synopsys_edac.c index 88a481043d4c..a14baeca6400 100644 --- a/drivers/edac/synopsys_edac.c +++ b/drivers/edac/synopsys_edac.c @@ -527,6 +527,28 @@ static void handle_error(struct mem_ctl_info *mci, struct synps_ecc_status *p) memset(p, 0, sizeof(*p)); } +static void enable_intr(struct synps_edac_priv *priv) +{ + /* Enable UE/CE Interrupts */ + if (priv->p_data->quirks & DDR_ECC_INTR_SELF_CLEAR) + writel(DDR_UE_MASK | DDR_CE_MASK, + priv->baseaddr + ECC_CLR_OFST); + else + writel(DDR_QOSUE_MASK | DDR_QOSCE_MASK, + priv->baseaddr + DDR_QOS_IRQ_EN_OFST); + +} + +static void disable_intr(struct synps_edac_priv *priv) +{ + /* Disable UE/CE Interrupts */ + if (priv->p_data->quirks & DDR_ECC_INTR_SELF_CLEAR) + writel(0x0, priv->baseaddr + ECC_CLR_OFST); + else + writel(DDR_QOSUE_MASK | DDR_QOSCE_MASK, + priv->baseaddr + DDR_QOS_IRQ_DB_OFST); +} + /** * intr_handler - Interrupt Handler for ECC interrupts. * @irq: IRQ number. @@ -568,6 +590,9 @@ static irqreturn_t intr_handler(int irq, void *dev_id) /* v3.0 of the controller does not have this register */ if (!(priv->p_data->quirks & DDR_ECC_INTR_SELF_CLEAR)) writel(regval, priv->baseaddr + DDR_QOS_IRQ_STAT_OFST); + else + enable_intr(priv); + return IRQ_HANDLED; } @@ -850,28 +875,6 @@ static void mc_init(struct mem_ctl_info *mci, struct platform_device *pdev) init_csrows(mci); } -static void enable_intr(struct synps_edac_priv *priv) -{ - /* Enable UE/CE Interrupts */ - if (priv->p_data->quirks & DDR_ECC_INTR_SELF_CLEAR) - writel(DDR_UE_MASK | DDR_CE_MASK, - priv->baseaddr + ECC_CLR_OFST); - else - writel(DDR_QOSUE_MASK | DDR_QOSCE_MASK, - priv->baseaddr + DDR_QOS_IRQ_EN_OFST); - -} - -static void disable_intr(struct synps_edac_priv *priv) -{ - /* Disable UE/CE Interrupts */ - if (priv->p_data->quirks & DDR_ECC_INTR_SELF_CLEAR) - writel(0x0, priv->baseaddr + ECC_CLR_OFST); - else - writel(DDR_QOSUE_MASK | DDR_QOSCE_MASK, - priv->baseaddr + DDR_QOS_IRQ_DB_OFST); -} - static int setup_irq(struct mem_ctl_info *mci, struct platform_device *pdev) {