From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73131C433EF for ; Tue, 28 Sep 2021 13:41:42 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 35C5160FE8 for ; Tue, 28 Sep 2021 13:41:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 35C5160FE8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=z9wQWuKH27dJDMb58/9po4JBb5UZEIObpDd28pGmGxU=; b=UKTdht8a+JF0SH 8fz7B3/c6V7zqBuJ9Ml/bQDt7fz5IBOO66CXEUrL6+WXLmQKXIfT/wWFfqS8fsIXXYSYDpWiUJuWQ shhIvpu7/s60lgXKKoC+Lnxr7KBJWvNo2vbBsrX6/JDKUI0/9YNg3GmDDZwaCmd2uoDuesqbi59Gd AD4wYUthkb7/wJe2sinYPIb6Fd03b9HttSlUG7CR2bOhIGgdp+kCwwWQgYj6cG/G9652t8okuvcQ4 omP7lU3bfi3Kl1MgD54i7joIO10pQlWjgAGzUbLXaFXYHk9zP7LJ+ruhrw7nIHYZ8vPHei8r3iQzT VNgB0bGeEb79osVPIE1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVDKo-007MTZ-HK; Tue, 28 Sep 2021 13:39:50 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVDKk-007MRo-BL for linux-arm-kernel@lists.infradead.org; Tue, 28 Sep 2021 13:39:48 +0000 Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mVDKd-0004QP-7h; Tue, 28 Sep 2021 15:39:39 +0200 Received: from ore by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1mVDKc-0001Ae-Dr; Tue, 28 Sep 2021 15:39:38 +0200 Date: Tue, 28 Sep 2021 15:39:38 +0200 From: Oleksij Rempel To: Florian Fainelli Cc: Shawn Guo , Sascha Hauer , linux-kernel@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, Fabio Estevam , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2] ARM: imx6: mask all interrupts before calling stby-poweroff sequence Message-ID: <20210928133938.GG18181@pengutronix.de> References: <20210817122500.31953-1-o.rempel@pengutronix.de> <20210922023740.GD10217@dragon> <01b708d2-f211-8217-f686-0f7bf9fc8129@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <01b708d2-f211-8217-f686-0f7bf9fc8129@gmail.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 15:39:02 up 222 days, 17:02, 124 users, load average: 0.09, 0.11, 0.12 User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210928_063946_430000_0565CBC8 X-CRM114-Status: GOOD ( 32.63 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Sep 21, 2021 at 07:57:49PM -0700, Florian Fainelli wrote: > > > On 9/21/2021 7:37 PM, Shawn Guo wrote: > > On Tue, Aug 17, 2021 at 02:25:00PM +0200, Oleksij Rempel wrote: > > > Any pending interrupt can prevent entering standby based power off state. > > > To avoid it, mask all interrupts. > > > > > > Fixes: 8148d2136002 ("ARM: imx6: register pm_power_off handler if "fsl,pmic-stby-poweroff" is set") > > > Signed-off-by: Oleksij Rempel > > > --- > > > arch/arm/mach-imx/pm-imx6.c | 23 +++++++++++++++++++++++ > > > 1 file changed, 23 insertions(+) > > > > > > diff --git a/arch/arm/mach-imx/pm-imx6.c b/arch/arm/mach-imx/pm-imx6.c > > > index 9244437cb1b9..63887ade411a 100644 > > > --- a/arch/arm/mach-imx/pm-imx6.c > > > +++ b/arch/arm/mach-imx/pm-imx6.c > > > @@ -59,8 +59,11 @@ > > > #define MX6Q_SUSPEND_OCRAM_SIZE 0x1000 > > > #define MX6_MAX_MMDC_IO_NUM 33 > > > +#define GIC_DIST_ENABLE_CLEAR 0x180 > > > + > > > static void __iomem *ccm_base; > > > static void __iomem *suspend_ocram_base; > > > +static void __iomem *gic_raw_dist_base; > > > static void (*imx6_suspend_in_ocram_fn)(void __iomem *ocram_vbase); > > > /* > > > @@ -592,6 +595,7 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata) > > > static void __init imx6_pm_common_init(const struct imx6_pm_socdata > > > *socdata) > > > { > > > + struct device_node *np; > > > struct regmap *gpr; > > > int ret; > > > @@ -615,10 +619,29 @@ static void __init imx6_pm_common_init(const struct imx6_pm_socdata > > > if (!IS_ERR(gpr)) > > > regmap_update_bits(gpr, IOMUXC_GPR1, IMX6Q_GPR1_GINT, > > > IMX6Q_GPR1_GINT); > > > + > > > + np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-gic"); > > > + gic_raw_dist_base = of_iomap(np, 0); > > > +} > > > + > > > +static void imx_gic_mask_all(void) > > > +{ > > > + int i; > > > + > > > + if (WARN_ON(!gic_raw_dist_base)) > > > + return; > > > + > > > + for (i = 0; i < 4; i++) > > > + writel_relaxed(~0, gic_raw_dist_base + GIC_DIST_ENABLE_CLEAR + 4 * i); > > > > Is it possible to have a helper function in GIC driver, that we can > > simply call into? > > Cannot you call gic_cpu_if_down(0) which would presumably have the same > effect? Good idea, thank you! It works. Regards, Oleksij -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel