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: 6448971 Return-Path: X-Original-To: patchwork-linux-rockchip@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 DF3F69F1C1 for ; Wed, 20 May 2015 20:34:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 01E0A203E5 for ; Wed, 20 May 2015 20:34:44 +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 0063C203B7 for ; Wed, 20 May 2015 20:34:43 +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 1YvAhM-0001ng-TO; Wed, 20 May 2015 20:34:40 +0000 Received: from mail-ie0-x22a.google.com ([2607:f8b0:4001:c03::22a]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YvAhJ-0001iX-Vc for linux-rockchip@lists.infradead.org; Wed, 20 May 2015 20:34:38 +0000 Received: by ieczm2 with SMTP id zm2so48599552iec.1 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=D/U7X5qt+tycV5y4lu9A/63v/XY93ns4kHnpFBwOKLW6OReZhK7y47/cWKPmS0NFm/ +VwVKhxQ/zRl+uXgL1AyDmOEfkqkSdLVLwHbDDAjgiAKNpNU3kHdlItHh3PgJUMGTsUm yXmTTLNsCPSkiZNaRr/QiIOLB1M/MCWPIsqkJklxdDbojG8Jfda9B876CRwKx0D97bLL zzgynVUgd1gQM9v09saZ1HGwZ3TmkjaHldjp3nhFIXnZMw9b22JsSyT6SVj7+GE29aiQ hb2cpXVLd/MjwWRgdBYCbnV6prUGmvJ4X/NpYYgq9pfBD49JIvyYMbTd1o11BIQz36nT Zokw== X-Gm-Message-State: ALoCoQk0iuoCotzBdU/xD/JL9GVK5jmXX4BaRZWXnkADxYaGnzNEtM5CVuSH9f+0RfRV/60u9kBX 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_089064_D7F9CCE8 X-CRM114-Status: UNSURE ( 8.49 ) X-CRM114-Notice: Please train this message. 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-rockchip@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=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=ham 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);