From patchwork Wed Dec 5 11:05:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Luba X-Patchwork-Id: 10713867 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 E752B13BB for ; Wed, 5 Dec 2018 11:06:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D72C029B08 for ; Wed, 5 Dec 2018 11:06:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA49229EB4; Wed, 5 Dec 2018 11:06:24 +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 A441429C77 for ; Wed, 5 Dec 2018 11:06:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726909AbeLELGV (ORCPT ); Wed, 5 Dec 2018 06:06:21 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:43862 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726866AbeLELGU (ORCPT ); Wed, 5 Dec 2018 06:06:20 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20181205110618euoutp01a3d8ac96afddbee6e435762bff5b7afe~taxN_9d971367813678euoutp01E for ; Wed, 5 Dec 2018 11:06:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181205110618euoutp01a3d8ac96afddbee6e435762bff5b7afe~taxN_9d971367813678euoutp01E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1544007978; bh=5YbI0/sdABJonddxc7tqFUe+sKRZeu5VTL1AAqyvtrU=; h=From:To:Cc:Subject:Date:References:From; b=pS7afGspQ2yP4ZSa7Or9RyiDeu4hsB6EUzLJjPkzB06A3go33QVbzCCHOMLIhKnQC HIbxPR0ERUJS6jn43IxtmV0xOoSpbcFvCpYIev0Kwj2Sua8Xuo0iyZhlW7bBIyifom wgXQy4D2zvLRkjTfBIBuuK2tZGOYtquLn025DdEw= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181205110617eucas1p2303f3342cebba238c2b79dfe8a41d9c2~taxM1j9Y81015510155eucas1p22; Wed, 5 Dec 2018 11:06:17 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 6B.F0.04441.921B70C5; Wed, 5 Dec 2018 11:06:17 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20181205110616eucas1p1e0e17b0c6a96c3b6d77516d4b02de8b1~taxL-5N9q0443104431eucas1p1G; Wed, 5 Dec 2018 11:06:16 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20181205110616eusmtrp2a40ea9b4bda1f199da13e76ba2ddd1f7~taxLv-K5m2749027490eusmtrp2Z; Wed, 5 Dec 2018 11:06:16 +0000 (GMT) X-AuditID: cbfec7f2-5e3ff70000001159-70-5c07b129fa47 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 6D.62.04128.821B70C5; Wed, 5 Dec 2018 11:06:16 +0000 (GMT) Received: from AMDC3778.DIGITAL.local (unknown [106.120.51.20]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20181205110615eusmtip10a184f8a03b45dd74c0519875c2aa70c~taxK3AI4W2561625616eusmtip1f; Wed, 5 Dec 2018 11:06:15 +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 v3 0/5] devfreq: handle suspend/resume Date: Wed, 5 Dec 2018 12:05:51 +0100 Message-Id: <1544007956-28889-1-git-send-email-l.luba@partner.samsung.com> X-Mailer: git-send-email 2.7.4 X-Brightmail-Tracker: H4sIAAAAAAAAA0VSeUiTcRje77uVZp9L6u1AaCA0STsw+0F2QdFXUAT9E2XUqs8VuWn70rLL ZaRrWeo61LKMrJzzymVzrnXMVqvMm7KDIgnpskuzKKTya4v+e97neJ/3j5cjVe/ocdxmwzbR aNAmq5lQynnnR1uMpo5NnPrTNQJ7r2hwXVEtjRvqvtG4++trGpf6Wmm8v6yWwQ8O6XHeq/ck bmu7xOKWrD4WPzVNwCePXSOw49UjGne5Sxg8cNiHcFHbdQJX+56z+EJ3B4Gf7bMx+Pn928M7 mjtpfOCaj8XZlZ9p3Nf+gpoHgvOqkxaqzlQh4ZSpgxLy8/qRUOZ5SwgO+0FGuHG6ihUun88U ft1hBe9HDyHUP8yhhCP1diTYKr+zwoAjcnnYqtCEjWLy5nTRO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yy1KL9O0S9DKavh5nKjgiWLGrcSVbA+MKvi5GTg4JAROJl33b2EBs IYGljBKvD+VBxMUkJu3bzg5hC0v8udYFVMMFVPOJUaLp0WvGLkYODjYBPYkdqwpB4iICyxkl 7v+czQ7iMAs8YJboeL6JFaRIWMBM4lKDK8ggFgFViZ03PjGB2LwCXhJ72o8zQSyQk7h5rpN5 AiPPAkaGVYwiqaXFuem5xUZ6xYm5xaV56XrJ+bmbGIHRt+3Yzy07GLveBR9iFOBgVOLhlZjC FiPEmlhWXJl7iFGCg1lJhHeFDXuMEG9KYmVValF+fFFpTmrxIUZToOUTmaVEk/OBiSGvJN7Q 1NDcwtLQ3Njc2MxCSZz3vEFllJBAemJJanZqakFqEUwfEwenVAOjhUON+EfRDQLs5vOl41vk ti3iTH5yh+/Gf7k1ZheVX0xo4dio+uPz22sf/i7YP02c7xbzZYXiC94J80zauluuTXnn035j xd2EE1pMfkv139gr39c4/euqZn2Tdq4b2zWBBZ2bajKqE/RPiy0olu8LWGxk9t2+6mP1dH/v M1JyMb+F3s1f0N6nxFKckWioxVxUnAgAiOPxsdQCAAA= X-CMS-MailID: 20181205110616eucas1p1e0e17b0c6a96c3b6d77516d4b02de8b1 X-Msg-Generator: CA X-RootMTR: 20181205110616eucas1p1e0e17b0c6a96c3b6d77516d4b02de8b1 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181205110616eucas1p1e0e17b0c6a96c3b6d77516d4b02de8b1 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 v3 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: v3: - cleaned commit messages according to Chanwoo's comments - moved atomic operation to beggining of function in devfreq_{suspend|resume}_device() - changed dev_warn() to dev_err() with also new error message, when devfreq_{suspend|resume}() failed 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 | 153 ++++++++++++++++++++++++++++++-------- include/linux/devfreq.h | 13 ++++ 5 files changed, 141 insertions(+), 32 deletions(-)