Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10158651imu; Wed, 5 Dec 2018 17:32:55 -0800 (PST) X-Google-Smtp-Source: AFSGD/U9DGmIeIXAhF5Iq13KX966DetuoNsV7F4fkL9bfQT2G3XVs+0vPlQ/pf0L8uzIAagLJEAx X-Received: by 2002:a63:5f41:: with SMTP id t62mr22548996pgb.76.1544059975620; Wed, 05 Dec 2018 17:32:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544059975; cv=none; d=google.com; s=arc-20160816; b=j4aL1TZBeyp/rXkEhlKB7+3TEKa8VuNT64hVqu/pSoeDF3DDIwwPfEcnrGDFOzt42x oBPDFOZD29lD/dTEDKmZLVJ9jt1DJl5arP0LW0ipBTM9EAWBbKV3EGbku3k4PJkWyTFA vhGNlfCQpxux33VHGzK5humiD1h6trvyRzEh4JGbNjO2qnBxZfUaXUsmxjKMqa3Ja5Mu 4g2mr4l+prMmfFL/yO6fdowEogHOPoMQAC+LeLx4Y36nC41bHFhMX+Iym8Fs3Yijn3sT pa6dsHRbePQfKoBHHpsnQQk7amCRgOoXaWz5rOvoNY0lQvGxl/19vO7Vwj6sY02bV64h LarQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:dlp-filter:cms-type :in-reply-to:subject:cc:to:user-agent:organization:from:date :message-id:content-transfer-encoding:mime-version:dkim-signature :dkim-filter; bh=6Gr1bmJzUWL64rFVd1bqGmgfe5R9n31yoLfNkjesgRM=; b=J3QUs2rY9zmfrZNK3EysE150xZYjB5PFOnGD0JmofSLpWD0mC+Yj2vcqFxR2oEInnn XvuPGOojgmVvdb/P9ivBTaluUC69MNxcdK4kGz0oEkO3BIqnXnOMlCNXYt0VXPzQeJSs zP04oYrfkwtyV92GjK3A/n3h7zq+arhj5DDDFzhqPxnqie5JKR6VbsQFy2yQkTmXvFKK VXxeP6WBNiUsSeORviN415Y89a9keHwISHn53U4MVM+7daelx8mlZv9x3WUf3oYHyZEY xRwKN/oLWiW+6gQsSvqACF2+wcvHER6vKf2N5s5xzWSMtiSCXhCyKbapTwhiTAF+8agZ kmuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=G0ApBWes; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n11-v6si20849237plg.87.2018.12.05.17.32.40; Wed, 05 Dec 2018 17:32:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=G0ApBWes; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728238AbeLFBay (ORCPT + 99 others); Wed, 5 Dec 2018 20:30:54 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:22419 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727358AbeLFBax (ORCPT ); Wed, 5 Dec 2018 20:30:53 -0500 Received: from epcas1p2.samsung.com (unknown [182.195.41.46]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20181206013050epoutp03654c897569c028534e2b54cff78c01fe~tmkDUUYRT0968709687epoutp03F; Thu, 6 Dec 2018 01:30:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20181206013050epoutp03654c897569c028534e2b54cff78c01fe~tmkDUUYRT0968709687epoutp03F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1544059850; bh=6Gr1bmJzUWL64rFVd1bqGmgfe5R9n31yoLfNkjesgRM=; h=Date:From:To:Cc:Subject:In-reply-to:References:From; b=G0ApBWes4rCc9+i2N8h96pwH5K/1AG2cwF7qrkbo5SCw6XgTE6kNykTEEoKmCaJNE mberMR6wPPLX2ZDogJkIMoswpGhzMNYIZJzA+/kotba/d/GNtaJbsGovPYy6tRoSSu wHcmas++aQ8Wg7bj9qYi9MWYiMlyYHVIOd8rt/2M= Received: from epsmges1p5.samsung.com (unknown [182.195.40.155]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20181206013044epcas1p1a94c9a3550e3fe30e62f596ebf8dc6bc~tmj9v8ein3108331083epcas1p1w; Thu, 6 Dec 2018 01:30:44 +0000 (GMT) Received: from epcas1p2.samsung.com ( [182.195.41.46]) by epsmges1p5.samsung.com (Symantec Messaging Gateway) with SMTP id EE.D8.04064.4CB780C5; Thu, 6 Dec 2018 10:30:44 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20181206013044epcas1p3df03d153eaf830ff2f35a9dab5755349~tmj9ccmsT3162731627epcas1p3s; Thu, 6 Dec 2018 01:30:44 +0000 (GMT) X-AuditID: b6c32a39-011ff70000000fe0-95-5c087bc42b7b Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 1E.E8.03601.3CB780C5; Thu, 6 Dec 2018 10:30:44 +0900 (KST) MIME-version: 1.0 Content-transfer-encoding: 8BIT Content-type: text/plain; charset="utf-8" Received: from [10.113.63.77] by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PJA008KTK776720@mmp2.samsung.com>; Thu, 06 Dec 2018 10:30:43 +0900 (KST) Message-id: <5C087BC3.1050405@samsung.com> Date: Thu, 06 Dec 2018 10:30:43 +0900 From: Chanwoo Choi Organization: Samsung Electronics User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 To: Lukasz Luba , 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, 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 Subject: Re: [PATCH v3 3/5] devfreq: add devfreq_suspend/resume() functions In-reply-to: <1544007956-28889-4-git-send-email-l.luba@partner.samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrLJsWRmVeSWpSXmKPExsWy7bCmnu6Rao4Yg5bzMhYHt2pabJyxntVi +8ZvrBbzj5xjtWhevJ7N4kx3rkX/49fMFufPb2C3ONv0ht3iVoOMxawpe5ksNj2+xmpxedcc NovPvUcYLWac38dksfbIXXaLpdcvMlncblzBZnH31FGgGacvsVq07j3CbtG2+gOrxZsL91gc xD227d7G6rFm3hpGj9kNF1k8JvR/YvRYvOclk8emVZ1sHvvnrmH32Lyk3uPfMXaPg+/2MHls udrO4tG3ZRWjx4rV39k9Pm+SC+CLyrbJSE1MSS1SSM1Lzk/JzEu3VfIOjneONzUzMNQ1tLQw V1LIS8xNtVVy8QnQdcvMAXpfSaEsMacUKBSQWFyspG9nU5RfWpKqkJFfXGKrlFqQklNgWaBX nJhbXJqXrpecn2tlaGBgZApUmJCd8W/aapaCfqmK83dXMDUwLhXtYuTkkBAwkdj+6ShjFyMX h5DADkaJnsU9UM53RonTjQsYYao+Lnv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ugSvj37TVLAX9UhXn765gamBcKtrF yMkhIWAi8XHZW6YuRi4OIYF1jBJL7q9hBknwCghK/Jh8j6WLkYODWUBe4silbAhTXWLKlFyI 8vuMEocv7maEKNeSWH3mNzuIzSKgKrFo5x2wOBtQfP+LG2wgNr+AosTVH48ZQeaICkRIdJ+o BJkjInCeUeJgXycrSA2zQCuzxKO2LBBbWMBb4lbTHja4Zes3/GQFaeYESqz/LjuBUWAWkktn IVw6C+HSBYzMqxglUwuKc9Nzi40KDPNSy/WKE3OLS/PS9ZLzczcxAuN622Gtvh2M95fEH2IU 4GBU4uF98YA9Rog1say4MvcQowQHs5IIL4MeR4wQb0piZVVqUX58UWlOavEhRmkOFiVx3tt5 xyKFBNITS1KzU1MLUotgskwcnFINjIL7BRfYLbQy4yt/wjXDferbJzFqlTHsadufLS9uyHfo OVjTLuXeHnCoysFFwMrCkelCp+KUp5yOuUUPrr9bwaSfqHx5qoer6V6PqxMZzuqErP38SWWD +DJ21ZOzpiwO0Q0pUim5+fXvlHuOQd8SO2zWs695m/Ce9xOnwU3FW2Jl3IsWzf3vpMRSnJFo qMVcVJwIAB1n177nAgAA X-CMS-MailID: 20181206013044epcas1p3df03d153eaf830ff2f35a9dab5755349 X-Msg-Generator: CA CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20181205110622eucas1p23d788afd54ad34c0a2663efac8734648 References: <1544007956-28889-1-git-send-email-l.luba@partner.samsung.com> <1544007956-28889-4-git-send-email-l.luba@partner.samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Lukasz, On 2018년 12월 05일 20:05, Lukasz Luba wrote: > This patch adds implementation for global suspend/resume for > devfreq framework. System suspend will next use these functions. > > Suggested-by: Tobias Jakobi > Suggested-by: Chanwoo Choi > Signed-off-by: Lukasz Luba > --- > drivers/devfreq/devfreq.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ > include/linux/devfreq.h | 6 ++++++ > 2 files changed, 50 insertions(+) Reviewed-by: Chanwoo Choi > > diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c > index 46517b6..0ae3de7 100644 > --- a/drivers/devfreq/devfreq.c > +++ b/drivers/devfreq/devfreq.c > @@ -935,6 +935,50 @@ int devfreq_resume_device(struct devfreq *devfreq) > EXPORT_SYMBOL(devfreq_resume_device); > > /** > + * devfreq_suspend() - Suspend devfreq governors and devices > + * > + * Called during system wide Suspend/Hibernate cycles for suspending governors > + * and devices preserving the state for resume. On some platforms the devfreq > + * device must have precise state (frequency) after resume in order to provide > + * fully operating setup. > + */ > +void devfreq_suspend(void) > +{ > + struct devfreq *devfreq; > + int ret; > + > + mutex_lock(&devfreq_list_lock); > + list_for_each_entry(devfreq, &devfreq_list, node) { > + ret = devfreq_suspend_device(devfreq); > + if (ret) > + dev_err(&devfreq->dev, > + "failed to suspend devfreq device\n"); > + } > + mutex_unlock(&devfreq_list_lock); > +} > + > +/** > + * devfreq_resume() - Resume devfreq governors and devices > + * > + * Called during system wide Suspend/Hibernate cycle for resuming governors and > + * devices that are suspended with devfreq_suspend(). > + */ > +void devfreq_resume(void) > +{ > + struct devfreq *devfreq; > + int ret; > + > + mutex_lock(&devfreq_list_lock); > + list_for_each_entry(devfreq, &devfreq_list, node) { > + ret = devfreq_resume_device(devfreq); > + if (ret) > + dev_warn(&devfreq->dev, > + "failed to resume devfreq device\n"); > + } > + mutex_unlock(&devfreq_list_lock); > +} > + > +/** > * devfreq_add_governor() - Add devfreq governor > * @governor: the devfreq governor to be added > */ > diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h > index d985199..fbffa74 100644 > --- a/include/linux/devfreq.h > +++ b/include/linux/devfreq.h > @@ -205,6 +205,9 @@ extern void devm_devfreq_remove_device(struct device *dev, > extern int devfreq_suspend_device(struct devfreq *devfreq); > extern int devfreq_resume_device(struct devfreq *devfreq); > > +extern void devfreq_suspend(void); > +extern void devfreq_resume(void); > + > /** > * update_devfreq() - Reevaluate the device and configure frequency > * @devfreq: the devfreq device > @@ -331,6 +334,9 @@ static inline int devfreq_resume_device(struct devfreq *devfreq) > return 0; > } > > +static inline void devfreq_suspend(void) {} > +static inline void devfreq_resume(void) {} > + > static inline struct dev_pm_opp *devfreq_recommended_opp(struct device *dev, > unsigned long *freq, u32 flags) > { > -- Best Regards, Chanwoo Choi Samsung Electronics