Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7887587imu; Mon, 3 Dec 2018 22:20:42 -0800 (PST) X-Google-Smtp-Source: AFSGD/U3OVvmlz9iZTxuJxQQjzdigSWcsDUofIsAed7O0ep/L9kVDdw9HxXk0Gz75Cb9UEkdN3Qp X-Received: by 2002:a63:2f07:: with SMTP id v7mr14822277pgv.368.1543904442057; Mon, 03 Dec 2018 22:20:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543904442; cv=none; d=google.com; s=arc-20160816; b=FpXjsCOOs8zSMryqnVlMZh2fUvdXMv1W6Q6mQ29KUsqMxH6JkccEJ4SEaWThmI/R7y S33MhwdrsthPpwnOk6dlZiQbHWIk2Jc2iGO/gCA1vQSGacmwEcedAhMcqllDeagCWFgc ejnDKtvsRVoTs14RfEB9uIAyN1KqVf5AXkUgwbWQl8EibaUAz2UR2mtGxH7c+fEnGRmD huhvaWSfU4Juj2rgWeKtE92LOF1p/SAml5v1guO91z16nZDyL1CY7DJlkYnnNBas0jFi FRdnfpfB26E9uesElZ3RKjMGUQ/RVotE0uUmUWrNk5SYbwn4KMvUtOBxhaLo72czcIjk zphw== 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=KAWhR31NxtOmiWLfxm4iRJWBqukFe+N418flXq88B2A=; b=u17bMQM7cQ0NLk99KV00EJ340DC5xr8BzAX5c5zcLqK1pOUDp9RpB4+JuW+dTA3R7O kdlfXnG90ZHUqhXW0F93pdPieVepMJxsJRh6C0+Xn9Yd3XXi7+WwTwKd6icPvLubEPo4 d9DKi+taNqCCiNND8sC5EuQrHSJX7LhqqL37gVDkNmNH63KsLVltWiKZAvltw3q72F7Z hmxwcSwOtOcD76LhRoCuY9FxAYS/SsENAkFtDu+Y/l518jUqzyPvPXUHSkLQn1LRCT2t gQ9Fr0GkQY9E7+62Z/aON7oln6bsSQiRXdbdsrYMVm1pYbeqF74rapPUuaNlAaHuW1H/ Pr5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=aZH8dZaW; 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 w2si13377620pgp.546.2018.12.03.22.20.26; Mon, 03 Dec 2018 22:20:42 -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=aZH8dZaW; 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 S1726054AbeLDGTm (ORCPT + 99 others); Tue, 4 Dec 2018 01:19:42 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:11738 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725988AbeLDGTm (ORCPT ); Tue, 4 Dec 2018 01:19:42 -0500 Received: from epcas1p3.samsung.com (unknown [182.195.41.47]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20181204061936epoutp0347b1937a6968b8e23a17ef8fd9c93e8b~tDNm5rLKw3207632076epoutp038; Tue, 4 Dec 2018 06:19:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20181204061936epoutp0347b1937a6968b8e23a17ef8fd9c93e8b~tDNm5rLKw3207632076epoutp038 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1543904376; bh=KAWhR31NxtOmiWLfxm4iRJWBqukFe+N418flXq88B2A=; h=Date:From:To:Cc:Subject:In-reply-to:References:From; b=aZH8dZaWNWd5u4ZRQHMwT/jNZ/UbRsT0i84oyay2e8nTQy+X28GRuq5tOqv+vQpvB vscvr7JyRMzLaXLtT6nSPG/ASI71bgukLNS3WjaJKdIO7xtw4LjAjvBD8PtAO2e0fg Sg7uCFDvpO2AZAlmaOpd42f27Kumg4LlxuzuBnpc= Received: from epsmges2p1.samsung.com (unknown [182.195.40.158]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20181204061933epcas1p130cb84e1eea4741d9316db3419d2971f~tDNkQkuf52171421714epcas1p1V; Tue, 4 Dec 2018 06:19:33 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id 29.F5.04055.57C160C5; Tue, 4 Dec 2018 15:19:33 +0900 (KST) Received: from epsmgms2p2new.samsung.com (unknown [182.195.42.143]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20181204061933epcas2p3fc013e7960266fcf9e3f1abab94bdd61~tDNjzxLcZ2199121991epcas2p39; Tue, 4 Dec 2018 06:19:33 +0000 (GMT) X-AuditID: b6c32a45-711ff70000000fd7-69-5c061c75d631 Received: from epmmp1.local.host ( [203.254.227.16]) by epsmgms2p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 45.82.03627.47C160C5; Tue, 4 Dec 2018 15:19:33 +0900 (KST) MIME-version: 1.0 Content-transfer-encoding: 8BIT Content-type: text/plain; charset="utf-8" Received: from [10.113.63.77] by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PJ700A4V88KCE60@mmp1.samsung.com>; Tue, 04 Dec 2018 15:19:32 +0900 (KST) Message-id: <5C061C74.808@samsung.com> Date: Tue, 04 Dec 2018 15:19:32 +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 v2 3/5] devfreq: add devfreq_suspend/resume() functions In-reply-to: <1543847475-7600-4-git-send-email-l.luba@partner.samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA01Tf0xbVRjNfa/vB8uKb2VsV5hbfcZlkLC11MrFrEbdNC92USL+sSgGn/AC rL+efS2KjlAGjK3LXJXF1G6IA4YTuhRYxxiwkZU6kg1XwYCLkyUOM4EthIyFTZ1oXx8q/53z fee7955z76VxzRyZRpfZXYLTzltZcpWqZygjJ8u9gSzQfR5k0aWzGajLHyLQua5FAjVFrxGo piVEopFDNnRk6g6OYrFOCn237y6FfvJsQIGjFzDUPTVBoB/6jpNo4XAUIH/sIoZORycpdPLH UQzdqD5Foskr38bXuDpGoLoLUQrt75gn0N3vb6peWM/19PcQXPDLIOCOeUZVnO/IPcC1DMxg XHf7QZIbbAxS3JnWKm7pMsVdmhvAuPB4vYr7JNwOuFMdDyhuoXtjXvJblu2lAl8sOLWCvchR XGYvMbHm/MIdhcZndfosfS7KYbV23iaY2J278rJeKbPG7bPact7qjpfyeElitz2/3elwuwRt qUNymVhBLLaKueJWibdJbnvJ1iKH7Tm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ljxkbGM9LdDFy ckgImEhs+9bN2MXIxSEksJNR4vm5u6wgCV4BQYkfk++xdDFycDALyEscuZQNYapLTJmSC1F+ n1Fi1t9mZpA4r4CaxI5r1SCdLAKqEtsvHmMDsdkEtCT2v7gBZvMLKEpc/fGYEaRcVCBCovtE JcgYEYHzjBIH+zrBtjILtDJLPGrLArGFBbwlHracgTrtLqPE1Y+vmEESnAJeElvmv2aZwCgw C8mlsxAunYVw6QJG5lWMkqkFxbnpucVGBUZ5qeV6xYm5xaV56XrJ+bmbGIFRve2wVv8OxsdL 4g8xCnAwKvHwOjiwxgixJpYVV+YeYpTgYFYS4S0oZIkR4k1JrKxKLcqPLyrNSS0+xCjNwaIk zsuffyxSSCA9sSQ1OzW1ILUIJsvEwSnVwDi1xry+ennK1/t2fi+7q9y+7nixknfijOATUqdc GBbOms11/3XlbsEJThnTSj9YhLWekf4vOyn93vGl+QbRpbq72fYsXXnS7OqiVSfjCvmeyUw7 2n4/edYKE1NrN1vfvv+KsTcTG//niG1Rq08slI24cbi768xBn1V3zcuvyZn8NlY8utx5p4ES S3FGoqEWc1FxIgAdFJyt5gIAAA== X-CMS-MailID: 20181204061933epcas2p3fc013e7960266fcf9e3f1abab94bdd61 X-Msg-Generator: CA CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20181203143132eucas1p128c029a7c7461e1127924a08e4a71811 References: <1543847475-7600-1-git-send-email-l.luba@partner.samsung.com> <1543847475-7600-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월 03일 23:31, Lukasz Luba wrote: > This patch adds implementation for global suspend/resume for > devfreq framework. System suspend will next use these functions. > > The patch is based on earlier work by Tobias Jakobi. Please remove it from each patch description. > > Suggested-by: Tobias Jakobi > Suggested-by: Chanwoo Choi > Signed-off-by: Lukasz Luba > --- > drivers/devfreq/devfreq.c | 42 ++++++++++++++++++++++++++++++++++++++++++ > include/linux/devfreq.h | 6 ++++++ > 2 files changed, 48 insertions(+) > > diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c > index 36bed24..7d60423 100644 > --- a/drivers/devfreq/devfreq.c > +++ b/drivers/devfreq/devfreq.c > @@ -935,6 +935,48 @@ 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_warn(&devfreq->dev, "device suspend failed\n"); When I checked the cpufreq_suspend(), cpufreq_suspend() prints message as 'err' level. I think that dev_err is more proper than dev_warn. I'm not sure what is more correct log. But, 'devfreq->dev' device has the separate suspend/resume function. So, I think that devfreq_suspend() should print error log containing that it is error by devfreq framework. "device suspend failed" -> "failed to suspend devfreq device" > + } > + 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, "device resume failed\n"); ditto. "device resume failed" -> "failed to resume devfreq device" > + } > + 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