linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Peng Fan <peng.fan@nxp.com>
To: Kohji Okuno <okuno.kohji@jp.panasonic.com>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>
Cc: "s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"festevam@gmail.com" <festevam@gmail.com>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	dl-linux-imx <linux-imx@nxp.com>
Subject: RE: [PATCH] ARM: imx6: cpuidle: omit the unnecessary unmask of GINT
Date: Wed, 20 Mar 2019 01:12:01 +0000	[thread overview]
Message-ID: <AM0PR04MB44816B05EB54BFB88B97E91F88410@AM0PR04MB4481.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20190320.090707.1700756583765376970.okuno.kohji@jp.panasonic.com>



> -----Original Message-----
> From: Kohji Okuno [mailto:okuno.kohji@jp.panasonic.com]
> Sent: 2019年3月20日 8:07
> To: shawnguo@kernel.org; Peng Fan <peng.fan@nxp.com>
> Cc: linux-arm-kernel@lists.infradead.org; s.hauer@pengutronix.de;
> kernel@pengutronix.de; festevam@gmail.com; dl-linux-imx
> <linux-imx@nxp.com>; Peng Fan <peng.fan@nxp.com>;
> okuno.kohji@jp.panasonic.com
> Subject: Re: [PATCH] ARM: imx6: cpuidle: omit the unnecessary unmask of
> GINT
> 
> Hi Peng and Shawn,
> 
> This patch was made by Peng. Peng, could you explain about this?
> My guess is that the patch is to eliminate the unnecessary processing.

Yes. This is optimization, there is no need to unmask/mask when
WAIT_CLOCKED. See the errata description.
	/*
	 * ERR007265: CCM: When improper low-power sequence is used,
	 * the SoC enters low power mode before the ARM core executes WFI.
	 *
	 * Software workaround:
	 * 1) Software should trigger IRQ #32 (IOMUX) to be always pending
	 *    by setting IOMUX_GPR1_GINT.
	 * 2) Software should then unmask IRQ #32 in GPC before setting CCM
	 *    Low-Power mode.
	 * 3) Software should mask IRQ #32 right after CCM Low-Power mode
	 *    is set (set bits 0-1 of CCM_CLPCR).
	 *
	 * Note that IRQ #32 is GIC SPI #0.
	 */
Regards,
Peng.

> 
> Best regards,
>  Kohji Okuno
> 
> Shawn Guo <shawnguo@kernel.org> wrote:
> > On Wed, Mar 06, 2019 at 01:30:42PM +0900, Kohji Okuno wrote:
> >> In imx6_set_lpm, we only need to unmask GINT when not
> WAIT_CLOCKED,
> >> so add a check condition.
> >
> > Can you elaborate the problem we have without this code change?
> >
> > Shawn
> >
> >>
> >> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> >> Signed-off-by: Kohji Okuno <okuno.kohji@jp.panasonic.com>
> >> ---
> >>  arch/arm/mach-imx/pm-imx6.c | 6 ++++--
> >>  1 file changed, 4 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/arch/arm/mach-imx/pm-imx6.c
> >> b/arch/arm/mach-imx/pm-imx6.c index 87f45b926c78..54add0178b96
> 100644
> >> --- a/arch/arm/mach-imx/pm-imx6.c
> >> +++ b/arch/arm/mach-imx/pm-imx6.c
> >> @@ -354,9 +354,11 @@ int imx6_set_lpm(enum mxc_cpu_pwr_mode
> mode)
> >>  	 *
> >>  	 * Note that IRQ #32 is GIC SPI #0.
> >>  	 */
> >> -	imx_gpc_hwirq_unmask(0);
> >> +	if (mode != WAIT_CLOCKED)
> >> +		imx_gpc_hwirq_unmask(0);
> >>  	writel_relaxed(val, ccm_base + CLPCR);
> >> -	imx_gpc_hwirq_mask(0);
> >> +	if (mode != WAIT_CLOCKED)
> >> +		imx_gpc_hwirq_mask(0);
> >>
> >>  	return 0;
> >>  }
> >> --
> >> 2.17.1
> >>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-03-20  1:15 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-22  8:49 [PATCH] ARM: imx6q: cpuidle: fix bug that CPU may not wake up Kohji Okuno
2019-02-22  9:14 ` Lucas Stach
2019-02-22 12:25   ` Fabio Estevam
2019-02-26  2:06 ` [PATCH v2] ARM: imx6q: cpuidle: fix bug that CPU might not wake up at expected time Kohji Okuno
2019-02-26  2:12   ` Fabio Estevam
2019-02-26  2:19     ` Kohji Okuno
2019-02-26  2:22       ` Fabio Estevam
2019-02-26  2:23       ` Kohji Okuno
2019-02-26  2:34 ` [PATCH v3] " Kohji Okuno
2019-03-01  9:23   ` Shawn Guo
2019-03-04  1:28     ` Kohji Okuno
2019-03-04  7:00       ` Shawn Guo
2019-03-04  7:06   ` Shawn Guo
2019-03-04  7:38     ` Kohji Okuno
2019-03-05 10:38     ` Kohji Okuno
2019-03-06  3:21       ` Shawn Guo
2019-03-06  4:30         ` [PATCH] ARM: imx6: cpuidle: omit the unnecessary unmask of GINT Kohji Okuno
2019-03-19 12:51           ` Shawn Guo
2019-03-20  0:07             ` Kohji Okuno
2019-03-20  1:12               ` Peng Fan [this message]
2019-03-20  3:08                 ` Aisheng Dong
2019-03-20  7:44                 ` Shawn Guo
2019-03-20  7:59                   ` Peng Fan
2019-03-20 14:28                     ` Shawn Guo
2019-03-20 14:35           ` Shawn Guo
2019-03-06 14:36       ` [PATCH v3] ARM: imx6q: cpuidle: fix bug that CPU might not wake up at expected time Peng Fan
2019-03-07  0:06         ` Kohji Okuno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM0PR04MB44816B05EB54BFB88B97E91F88410@AM0PR04MB4481.eurprd04.prod.outlook.com \
    --to=peng.fan@nxp.com \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=okuno.kohji@jp.panasonic.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).