Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4906104pxb; Tue, 28 Sep 2021 06:41:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbLcusr/OBXrPCizUbDkwypekGrhZcoySahqo87vn6AdALYaanwiPSpIjtVGYO7h6a/lN1 X-Received: by 2002:a05:6402:21c2:: with SMTP id bi2mr537574edb.278.1632836491810; Tue, 28 Sep 2021 06:41:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632836491; cv=none; d=google.com; s=arc-20160816; b=UL0Yp9kfHv48LFN0JwaHHvOlCyDg+G75fIZKJ5Zm3oeOGxDAaMossbBOeDZFIt/01Z iEq1t3omUbooMxcrpDVOZhMiRa/4xyvxuK1XoaO1zDyjtmD+KypVl5cB48tyg5Sd8HIx dJiCs7+E5O1k5rsBSxz3pOw/Xd3bGkPLdgD6bbqqfGpN3Z6gt7zRwyIqpTi1xUXPnsVw NLCVa1PrinqoVKEY5E0lXAnBgqj8erMNURAIqU3kVSbcpN2fH3+Q8zBXC1FfmAw54csG ArUSnqd4HX1Hj6fQMmuG+JUnlxyZ3LYQ7Wm7WgP5rIyaemZgTXjdoKQPfNSS/QLImg3I GHQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=kflhPY92oOYkyQU6tOUyrZ0FUqvrs6yMXvQdqjjeuhM=; b=c/VWhAWTyRa2/dYcppK5HxAO6iGdB5bsSZfGJh64pdIcYlCUKovExp9xFud0VAKCU5 HtQGfsG9PZqi2NIqH1+GdUpSWPcx0kvF0PWjFs48ULH2XOWt6r1mj2r/lXFkP+0NWOkE bnv7yPbxIOmeHqOA+8YcwMU4s1NKr8JQGDq3ZivU754ZzjuTJeTmrRLXUQLCxSUZoaaG pClVf3+3H1xWu7RpfUCWU6QD4aMFgo7+1V4QR7WMjlpuX5lcB2AC11DZZqc20XMzRjpD He0/Ozrm8PibvE68jqsDBG0ZdhuDyD2xH+O++rJirpIVWOsOAsStAjQsp0ZwlwQJwTzn OaWQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bu11si21351670ejb.202.2021.09.28.06.41.04; Tue, 28 Sep 2021 06:41:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240917AbhI1NlV (ORCPT + 99 others); Tue, 28 Sep 2021 09:41:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233878AbhI1NlU (ORCPT ); Tue, 28 Sep 2021 09:41:20 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA01DC061575 for ; Tue, 28 Sep 2021 06:39:40 -0700 (PDT) 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-Type: text/plain; charset=utf-8 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 |