From patchwork Wed May 20 20:34:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 6448981 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B61D59F1C1 for ; Wed, 20 May 2015 20:38:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CD0AE20395 for ; Wed, 20 May 2015 20:38:15 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CE67E20394 for ; Wed, 20 May 2015 20:38:14 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YvAhQ-0001nq-O6; Wed, 20 May 2015 20:34:44 +0000 Received: from mail-ig0-x22a.google.com ([2607:f8b0:4001:c05::22a]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YvAhJ-0001ib-Vd for linux-arm-kernel@lists.infradead.org; Wed, 20 May 2015 20:34:38 +0000 Received: by igbyr2 with SMTP id yr2so112771922igb.0 for ; Wed, 20 May 2015 13:34:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=nMRycu5ygGIjn8VQqqmX8jLtJMxxulaDvz/QmOWEeac=; b=MXIYLZKvb6glWpzQzNSpG4QVepFE7Lf05IIweyQOUDfPKwrNYtcvaRjNFheJnVHP/1 xntNlMz9lmFQgTqfHQMXrdL5ldcQjdjDxm08DfycNAKcO/f88wcyptXMMf1MjD2hN9mX /R42zK60kgP/eo7PAjKx0laBb7Vee+KWIAFHg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=nMRycu5ygGIjn8VQqqmX8jLtJMxxulaDvz/QmOWEeac=; b=lDNU3cGxRiGMUyUpv+kcENshQNKC2tBx9dJO+ossAd4frwhM4r0ctstszweDvlAKUN WpgCbGQBLNaK/Is88BeGnLKiVpVqox+9OhrVi8W5hk4jXVz+VbZuDfjA9ySeyY/SPiYj sLt5GwBHv7PXrv6PjBdm09pD9OHV5g/ZpKKdRN9LcZLfLA6zSLH1MZNNkUM5PqklWG/g e3o4CVetsfQcUVWz3Z3aAkd/ky7oY0ixti31YtFJ9wNBj6xOPxOAg833Tle0Iswrxmnd Jl96s7gJVnQeAtYicW9l+RPYEUci+yVrmrGwTCZkEh7vaw+AudoDCOuRgIwR5uCn6Q/E PiDQ== X-Gm-Message-State: ALoCoQmFyu4BSh71TKW6c1b0NEhhejWAE/VhjJmOsvY38IoPvZx3zSy5S2YIq98cICgOaso2Xd7Z X-Received: by 10.43.171.202 with SMTP id nv10mr48296001icc.30.1432154055492; Wed, 20 May 2015 13:34:15 -0700 (PDT) Received: from tictac.mtv.corp.google.com ([172.22.65.76]) by mx.google.com with ESMTPSA id cy11sm2379799igc.14.2015.05.20.13.34.14 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 May 2015 13:34:14 -0700 (PDT) From: Doug Anderson To: Heiko Stuebner Subject: [PATCH] ARM: rockchip: restore dapswjdp after suspend Date: Wed, 20 May 2015 13:34:08 -0700 Message-Id: <1432154048-19126-1-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 2.2.0.rc0.207.ga3a616c X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150520_133438_109829_7B8E1C6D X-CRM114-Status: GOOD ( 10.05 ) X-Spam-Score: -0.8 (/) Cc: linux@arm.linux.org.uk, Doug Anderson , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Chris Zhong , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Chris Zhong --- 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);