From patchwork Wed Nov 23 13:51:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Jakobi X-Patchwork-Id: 9443325 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 92CC2600BA for ; Wed, 23 Nov 2016 13:52:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7FF6A25F3E for ; Wed, 23 Nov 2016 13:52:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7409E2623D; Wed, 23 Nov 2016 13:52:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DBC325F3E for ; Wed, 23 Nov 2016 13:52:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964843AbcKWNwH (ORCPT ); Wed, 23 Nov 2016 08:52:07 -0500 Received: from smtp.math.uni-bielefeld.de ([129.70.45.10]:58248 "EHLO smtp.math.uni-bielefeld.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964828AbcKWNwH (ORCPT ); Wed, 23 Nov 2016 08:52:07 -0500 Received: from chidori.dhcp.uni-bielefeld.de (dhcp-10-68-170-113.dhcp.uni-bielefeld.de [10.68.170.113]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client did not present a certificate) by smtp.math.uni-bielefeld.de (Postfix) with ESMTPSA id 2CDBC5FA53; Wed, 23 Nov 2016 14:52:05 +0100 (CET) From: Tobias Jakobi To: linux-samsung-soc@vger.kernel.org Cc: linux-pm@vger.kernel.org, m.reichl@fivetechno.de, myungjoo.ham@gmail.com, cw00.choi@samsung.com, Tobias Jakobi Subject: [RFC 2/4] PM / devfreq: suspend subsystem on system suspend/hibernate Date: Wed, 23 Nov 2016 14:51:25 +0100 Message-Id: <1479909087-22659-3-git-send-email-tjakobi@math.uni-bielefeld.de> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1479909087-22659-1-git-send-email-tjakobi@math.uni-bielefeld.de> References: <1479909087-22659-1-git-send-email-tjakobi@math.uni-bielefeld.de> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On the Exynos4412 SoC the DevFreq subsystem adjusts frequency of the various internal busses and corresponding voltages. E.g. the clock of the DMC (dynamic memory controller) bus together with the voltage of the MIF regulator are controlled by this. If DMC activity is low and DevFreq has set a lower OPP, the following can happen. If the system is restarted or goes into a suspend/resume-cycle, the first-stage (BL0) bootloader takes over, which also initializes clocks to default values. Since the PMIC is an external component and not part of the SoC, the BL0 doesn't set any default voltages. Upon setting the default clocks for the DMC bus, the BL0 hangs because the corresponding voltage is too low. To fix this, we make sure to only go into suspend with a 'safe' DevFreq configuration. Signed-off-by: Tobias Jakobi Reviewed-by: Chanwoo Choi --- drivers/base/power/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 5a94dfa..9cd7e06 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include "../base.h" @@ -943,6 +944,7 @@ void dpm_resume(pm_message_t state) dpm_show_time(starttime, state, NULL); cpufreq_resume(); + devfreq_resume(); trace_suspend_resume(TPS("dpm_resume"), state.event, false); } @@ -1582,6 +1584,7 @@ int dpm_suspend(pm_message_t state) trace_suspend_resume(TPS("dpm_suspend"), state.event, true); might_sleep(); + devfreq_suspend(); cpufreq_suspend(); mutex_lock(&dpm_list_mtx);