All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Zhong <zyw@rock-chips.com>
To: Doug Anderson <dianders@chromium.org>, Heiko Stuebner <heiko@sntech.de>
Cc: linux-rockchip@lists.infradead.org, linux@arm.linux.org.uk,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ARM: rockchip: restore dapswjdp after suspend
Date: Thu, 21 May 2015 08:45:45 +0800	[thread overview]
Message-ID: <555D2AB9.1020903@rock-chips.com> (raw)
In-Reply-To: <1432154048-19126-1-git-send-email-dianders@chromium.org>

Hi Doug

Thank you for pointing out.

Reviewed-by: Chris Zhong <zyw@rock-chips.com>

On 05/21/2015 04:34 AM, Doug Anderson wrote:
> In the commit (0ea001d ARM: rockchip: disable dapswjdp during suspend)
> we made the assumption that we didn't need to restore dapswjdp after
> suspend because "the MASKROM will enable it back".
>
> It turns out that's not a safe assumption.  In some cases (pending
> interrupts) it's possible that the WFI might act as a no-op and the
> MaskROM will never run.  Since we're changing the bit, we should
> restore it ourselves.
>
> Signed-off-by: Doug Anderson <dianders@chromium.org>
> ---
>   arch/arm/mach-rockchip/pm.c | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/arch/arm/mach-rockchip/pm.c b/arch/arm/mach-rockchip/pm.c
> index b0dcbe2..a7be465 100644
> --- a/arch/arm/mach-rockchip/pm.c
> +++ b/arch/arm/mach-rockchip/pm.c
> @@ -48,6 +48,7 @@ static struct regmap *sgrf_regmap;
>   
>   static u32 rk3288_pmu_pwr_mode_con;
>   static u32 rk3288_sgrf_soc_con0;
> +static u32 rk3288_sgrf_cpu_con0;
>   
>   static inline u32 rk3288_l2_config(void)
>   {
> @@ -70,6 +71,7 @@ static void rk3288_slp_mode_set(int level)
>   {
>   	u32 mode_set, mode_set1;
>   
> +	regmap_read(sgrf_regmap, RK3288_SGRF_CPU_CON0, &rk3288_sgrf_cpu_con0);
>   	regmap_read(sgrf_regmap, RK3288_SGRF_SOC_CON0, &rk3288_sgrf_soc_con0);
>   
>   	regmap_read(pmu_regmap, RK3288_PMU_PWRMODE_CON,
> @@ -129,6 +131,9 @@ static void rk3288_slp_mode_set(int level)
>   
>   static void rk3288_slp_mode_set_resume(void)
>   {
> +	regmap_write(sgrf_regmap, RK3288_SGRF_CPU_CON0,
> +		     rk3288_sgrf_cpu_con0 | SGRF_DAPDEVICEEN_WRITE);
> +
>   	regmap_write(pmu_regmap, RK3288_PMU_PWRMODE_CON,
>   		     rk3288_pmu_pwr_mode_con);
>   

WARNING: multiple messages have this Message-ID (diff)
From: zyw@rock-chips.com (Chris Zhong)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: rockchip: restore dapswjdp after suspend
Date: Thu, 21 May 2015 08:45:45 +0800	[thread overview]
Message-ID: <555D2AB9.1020903@rock-chips.com> (raw)
In-Reply-To: <1432154048-19126-1-git-send-email-dianders@chromium.org>

Hi Doug

Thank you for pointing out.

Reviewed-by: Chris Zhong <zyw@rock-chips.com>

On 05/21/2015 04:34 AM, Doug Anderson wrote:
> In the commit (0ea001d ARM: rockchip: disable dapswjdp during suspend)
> we made the assumption that we didn't need to restore dapswjdp after
> suspend because "the MASKROM will enable it back".
>
> It turns out that's not a safe assumption.  In some cases (pending
> interrupts) it's possible that the WFI might act as a no-op and the
> MaskROM will never run.  Since we're changing the bit, we should
> restore it ourselves.
>
> Signed-off-by: Doug Anderson <dianders@chromium.org>
> ---
>   arch/arm/mach-rockchip/pm.c | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/arch/arm/mach-rockchip/pm.c b/arch/arm/mach-rockchip/pm.c
> index b0dcbe2..a7be465 100644
> --- a/arch/arm/mach-rockchip/pm.c
> +++ b/arch/arm/mach-rockchip/pm.c
> @@ -48,6 +48,7 @@ static struct regmap *sgrf_regmap;
>   
>   static u32 rk3288_pmu_pwr_mode_con;
>   static u32 rk3288_sgrf_soc_con0;
> +static u32 rk3288_sgrf_cpu_con0;
>   
>   static inline u32 rk3288_l2_config(void)
>   {
> @@ -70,6 +71,7 @@ static void rk3288_slp_mode_set(int level)
>   {
>   	u32 mode_set, mode_set1;
>   
> +	regmap_read(sgrf_regmap, RK3288_SGRF_CPU_CON0, &rk3288_sgrf_cpu_con0);
>   	regmap_read(sgrf_regmap, RK3288_SGRF_SOC_CON0, &rk3288_sgrf_soc_con0);
>   
>   	regmap_read(pmu_regmap, RK3288_PMU_PWRMODE_CON,
> @@ -129,6 +131,9 @@ static void rk3288_slp_mode_set(int level)
>   
>   static void rk3288_slp_mode_set_resume(void)
>   {
> +	regmap_write(sgrf_regmap, RK3288_SGRF_CPU_CON0,
> +		     rk3288_sgrf_cpu_con0 | SGRF_DAPDEVICEEN_WRITE);
> +
>   	regmap_write(pmu_regmap, RK3288_PMU_PWRMODE_CON,
>   		     rk3288_pmu_pwr_mode_con);
>   

  reply	other threads:[~2015-05-21  0:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-20 20:34 [PATCH] ARM: rockchip: restore dapswjdp after suspend Doug Anderson
2015-05-20 20:34 ` Doug Anderson
2015-05-21  0:45 ` Chris Zhong [this message]
2015-05-21  0:45   ` Chris Zhong
2015-05-21  2:02 ` Huang, Tao
2015-05-21  2:02   ` Huang, Tao
2015-05-21 15:40   ` Doug Anderson
2015-05-21 15:40     ` Doug Anderson
2015-05-21 15:40     ` Doug Anderson
2015-05-21 17:59     ` Heiko Stuebner
2015-05-21 17:59       ` Heiko Stuebner

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=555D2AB9.1020903@rock-chips.com \
    --to=zyw@rock-chips.com \
    --cc=dianders@chromium.org \
    --cc=heiko@sntech.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux@arm.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.