From patchwork Mon Dec 3 14:31:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Luba X-Patchwork-Id: 10709659 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3E3831731 for ; Mon, 3 Dec 2018 14:31:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F6C32AF2F for ; Mon, 3 Dec 2018 14:31:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 22C1E2AF3A; Mon, 3 Dec 2018 14:31:34 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable 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 196282AF2F for ; Mon, 3 Dec 2018 14:31:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726571AbeLCOco (ORCPT ); Mon, 3 Dec 2018 09:32:44 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:60035 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726556AbeLCOco (ORCPT ); Mon, 3 Dec 2018 09:32:44 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20181203143129euoutp0199c53db2dda4a44fe8e6370831c03a24~s2RzJZjLZ1388213882euoutp01B for ; Mon, 3 Dec 2018 14:31:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181203143129euoutp0199c53db2dda4a44fe8e6370831c03a24~s2RzJZjLZ1388213882euoutp01B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1543847489; bh=xnvwoL8u4q3jdpcw9MomShy0KGKgN6QxlXlHKX/7FTo=; h=From:To:Cc:Subject:Date:References:From; b=PZmtrG7mus0DRl7/H+WsXKbsfOxmI0z9Oy5AvidiOmDfR5cnfRswRXUyjp673TSfU nek7qQntLHWQqrhAR6TP795CnZhtzeZUS5mnf03rCHuDLgCqY9sK+80ymFQ/3dQ0zK k1avNr9zvtZyWoi6c4WL6n31USAPedq1MlybBNE8= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181203143128eucas1p19e2ea9db521aa745ff93977171d5d6f1~s2Rxl0npp1711417114eucas1p1M; Mon, 3 Dec 2018 14:31:28 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 18.CA.04441.F3E350C5; Mon, 3 Dec 2018 14:31:27 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20181203143127eucas1p2604fc066139a32fdffe996212b42b40e~s2RwrM_2o0832208322eucas1p2B; Mon, 3 Dec 2018 14:31:27 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20181203143127eusmtrp103bf2b3db0d489f291e8c9e5e2ea143c~s2RwalByQ1650116501eusmtrp1c; Mon, 3 Dec 2018 14:31:27 +0000 (GMT) X-AuditID: cbfec7f2-5e3ff70000001159-9e-5c053e3fe2a1 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 2E.E8.04128.E3E350C5; Mon, 3 Dec 2018 14:31:26 +0000 (GMT) Received: from AMDC3778.DIGITAL.local (unknown [106.120.51.20]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20181203143126eusmtip202d74b9b677be3a30dfbb759f4d9400c~s2Rve22Pf0696906969eusmtip2D; Mon, 3 Dec 2018 14:31:25 +0000 (GMT) From: Lukasz Luba To: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org Cc: tjakobi@math.uni-bielefeld.de, myungjoo.ham@samsung.com, kyungmin.park@samsung.com, cw00.choi@samsung.com, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, gregkh@linuxfoundation.org, keescook@chromium.org, anton@enomsg.org, ccross@android.com, tony.luck@intel.com, robh+dt@kernel.org, mark.rutland@arm.com, kgene@kernel.org, krzk@kernel.org, m.szyprowski@samsung.com, b.zolnierkie@samsung.com, Lukasz Luba Subject: [PATCH v2 0/5] devfreq: handle suspend/resume Date: Mon, 3 Dec 2018 15:31:10 +0100 Message-Id: <1543847475-7600-1-git-send-email-l.luba@partner.samsung.com> X-Mailer: git-send-email 2.7.4 X-Brightmail-Tracker: H4sIAAAAAAAAA0VSWUwTURT1dWY6I6EwFgNPtmijBlARE9QXNS6RjzH6oTEGgxosdgQDLbUD uGFAiUKVxdQFUlyDCBlrCrWWpoALVqpiKcW4QVAjrhUJUsVoIto6Vf/OOfece8/HpTCph4ik dqjyWI1KniMTB+GWzu/dc5YtJTYnDdYidOtaPGquMRKopXmMQE++vCPQOXs3gUrqjGL04KgS VQ1+xJDL1UQi58EhEvUVRyP9iXYRMg0+JtBD22kx8lbYAapxXRehK/YBEtU/cYtQ/4FGMRq4 f8e3o6uXQIfa7SQ6fHmEQEM9z/HlkLG0WgjGcNYAmNpiN84cqxoFTF3bBxFj4rVi5sYZA8lc vVjEjHeSzK3hNhFjflSKM5VmHjCNl7+RjNcUuzYkLWiJgs3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djYpqTmZZalF+nYJehnrm6ezFuznr5jRf569gfEsTxcjJ4eEgInEpjUL2LsY uTiEBJYySix6c5gdIiEmMWnfdihbWOLPtS42iKJPjBLXd6wFSnBwsAnoSexYVQgSFxFYzihx /+dssEnMAg+YJTqeb2IF6RYWMJN4fHwJM4jNIqAq0df7DczmFfCUmHNjPQvEBjmJm+c6mScw 8ixgZFjFKJJaWpybnltspFecmFtcmpeul5yfu4kRGIHbjv3csoOx613wIUYBDkYlHl6HeJYY IdbEsuLK3EOMEhzMSiK8BYVAId6UxMqq1KL8+KLSnNTiQ4ymQMsnMkuJJucDk0NeSbyhqaG5 haWhubG5sZmFkjjveYPKKCGB9MSS1OzU1ILUIpg+Jg5OqQZGv84lESe6d16vmTibZ6IFn8aX NwuOzl0pM/nlfVv9I2eVl+jeOPzzX+fDZRrvdrufaK7PfliUP3vuxDBr5YUvxAuN6t8L1bxQ ub/dRYlXT2Qb7yojlYJ5+UVbJycEzt2W8fFfwJ7Ff4p0t1rW3ZPP9hSaHfabN6HMwzp4l0vh 7VlO621v+fxpVGIpzkg01GIuKk4EAEf5GybWAgAA X-CMS-MailID: 20181203143127eucas1p2604fc066139a32fdffe996212b42b40e X-Msg-Generator: CA X-RootMTR: 20181203143127eucas1p2604fc066139a32fdffe996212b42b40e X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181203143127eucas1p2604fc066139a32fdffe996212b42b40e References: 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 Hi all, This v2 patch set aims to address the issue with devfreq devices' frequency during suspend/resume. It extends suspend/resume by calls to Devfreq framework. In the devfreq framework there is a small refactoring to avoid code duplication in changging frequency (patch 1) and there are extensions for suspending devices. The suspending device has now chance to set proper state when the system is going for suspend. This phase is the right place to set needed frequences for the next resume process. It has been tested on Odroid u3 with Exynos 4412. The patch set draws on Tobias Jakobi's work posted ~2 years ago, who tried to solve issue with devfreq device's frequency during suspend/resume. During the discussion on LKML some corner cases and comments appeared related to the design. This patch set address them keeping in mind suggestions from Chanwoo Choi. Tobias's paches: https://www.spinics.net/lists/linux-samsung-soc/msg56602.html Changes: v2: - refactored patchset and merget patch 1 and 3 as suggested by Chanwoo Choi, - changed devfreq_{susped|resume}_device functions, - added doxygen information for new entres in 'struct devfreq', - devfreq_set_target skipped one argument, now resume_freq is set inside, - minor changes addresing comments from maintainers regarding the style, Regards, Lukasz Luba Lukasz Luba (5): devfreq: refactor set_target frequency function devfreq: add support for suspend/resume of a devfreq device devfreq: add devfreq_suspend/resume() functions drivers: power: suspend: call devfreq suspend/resume arm: dts: exynos4: opp-suspend in DMC and leftbus arch/arm/boot/dts/exynos4210.dtsi | 2 + arch/arm/boot/dts/exynos4412.dtsi | 2 + drivers/base/power/main.c | 3 + drivers/devfreq/devfreq.c | 155 +++++++++++++++++++++++++++++--------- include/linux/devfreq.h | 13 ++++ 5 files changed, 141 insertions(+), 34 deletions(-)