Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp1958675imn; Mon, 1 Aug 2022 06:19:32 -0700 (PDT) X-Google-Smtp-Source: AA6agR5lePAmuw6lKeMyEmMv9wNuHY9I4PniCSwHIEjnSY/KW/pLC3dK+slFtxA9ZyAXennaBfOA X-Received: by 2002:a17:902:ce04:b0:16c:e142:5dd7 with SMTP id k4-20020a170902ce0400b0016ce1425dd7mr16785365plg.173.1659359972509; Mon, 01 Aug 2022 06:19:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659359972; cv=none; d=google.com; s=arc-20160816; b=N+mMsEP89ZQ6GtgxuXivjuYmc0VnnzshBX26PPoOI7VOBP6+Nezjw1Z5tKliBYNzPX 5Db2yay3p9M/WVPMPSiAjfB30OuKfcoifR8N5+H5aRwQHsPQvn3VcpQplu5AsXnbstGu 2SAYmk4nLhFcBHPU4rv1YxFcAwFrL/DQOQbffSwEmcRwjpd+LDmyJJIXzNIpPK2E7AiW ifiMsZbtxByAXPPaqSZnQJ0tVoMINN7+GQa/MS8wWnZozuS/VYHgEc2WKaNF9czeudTL QNwPhyNA7yqBCtXifmxqRRuLmqES39ED+UGg7Wdg299QF3+vf/2Hc+ZKLIZYRA1aKj9g oQWw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rCeMJjdG1pddtZmmHizFnwrtymYqcLebzFJPQkMQqFM=; b=UYkMOQrl+txRO2uEYYXA+Z4OHuJZEQKttol3CQySZxzqnSHS0xBYw8LwpNHrUriR3B JluBpc3z473s2eqX9rS660qNMGtcm9zMUCMUXwNIfKa5Mm4NMZog3imbKvy4O1yje8uC 9d7cX3dLw/hddOcMmI3b/+vkQizRD5KoonSiS2hSQ7F/IB6zh9nYrNv7HM+Eof3X3SSS ADv3DnuK4rn0jyh0SV826FTf2ucyDGeAPsg7t3C1NPYasWT7JRe31C7t5aim98Y3s/+M 83bJaEbWg/KaDGmb7EaARKdW8PGv3/zoaBrKGtjyJjsMN9jYzE3wBP0U78odStWnWi3p e3IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=L2K1O2AM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f11-20020a63554b000000b0040cf2e6f0e7si12446910pgm.497.2022.08.01.06.19.07; Mon, 01 Aug 2022 06:19:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=L2K1O2AM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231546AbiHAMTM (ORCPT + 99 others); Mon, 1 Aug 2022 08:19:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234617AbiHAMSX (ORCPT ); Mon, 1 Aug 2022 08:18:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C4ED80514; Mon, 1 Aug 2022 04:59:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 19000601BF; Mon, 1 Aug 2022 11:59:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2288DC433D6; Mon, 1 Aug 2022 11:59:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1659355162; bh=wxbH+q2Pobfj5UXnhBSG3TNyWcwBbthQ+A8yPvgXBGc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L2K1O2AMTyK1hV8GQCNL6AGqMmlswWHb8ip2x/VWPm/8uD0pK85JFf6vsgyUcEeVE 2CcXPOvJY75wH5fwnNFxQ37oSZDAe9V4SsDpov2CYG9F5nQWRGED4o3bapOicyuavT KbdcQOm0e5TBpsMdoL8+vj72kb6Z3LpaZlpskGfo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sherry Sun , Borislav Petkov , Shubhrajyoti Datta , Michal Simek Subject: [PATCH 5.18 85/88] EDAC/synopsys: Re-enable the error interrupts on v3 hw Date: Mon, 1 Aug 2022 13:47:39 +0200 Message-Id: <20220801114141.858015802@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220801114138.041018499@linuxfoundation.org> References: <20220801114138.041018499@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sherry Sun commit 4bcffe941758ee17becb43af3b25487f848f6512 upstream. 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. Fixes: f7824ded4149 ("EDAC/synopsys: Add support for version 3 of the Synopsys EDAC DDR") Signed-off-by: Sherry Sun Signed-off-by: Borislav Petkov Reviewed-by: Shubhrajyoti Datta Acked-by: Michal Simek Cc: Link: https://lore.kernel.org/r/20220427015137.8406-3-sherry.sun@nxp.com Signed-off-by: Greg Kroah-Hartman --- drivers/edac/synopsys_edac.c | 47 ++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 22 deletions(-) --- a/drivers/edac/synopsys_edac.c +++ b/drivers/edac/synopsys_edac.c @@ -527,6 +527,28 @@ static void handle_error(struct mem_ctl_ 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, /* 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 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) {