Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8041357imu; Tue, 4 Dec 2018 01:46:59 -0800 (PST) X-Google-Smtp-Source: AFSGD/XBCfEWuXsW8AEN2QkXBo7XHJsPrdf7JPL74ftrtA0xEqfWL+U9EZXZkZdsvRKVzoGtnD5m X-Received: by 2002:a62:8dd9:: with SMTP id p86mr19133623pfk.143.1543916819170; Tue, 04 Dec 2018 01:46:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543916819; cv=none; d=google.com; s=arc-20160816; b=IX1hLv+VH1gyMVpss7b1FG/58vQx3352lxLyebtAElzPNAaXZqy4v/5aaM0acydYAx t83Z1xBizd+47KlYQATO5vy4EwRKyJdh+a3NnXmZPC8nfi/G5X5rGN4lOEFt4cwcF/Sw xFg7SDZYf49r+bfFeRoJoUnjv4hVTQEYH8vjGD2ASrP1i4vVl06d7+5i8js5b3rFa87e MVVFcA3AssR9Pdy+kG3ImPo+oXFDlkM+cwSD/ZcCTwUv9zf09DlYPEZ4okcp7NDiZhPd M/GnlS4F56kE3PnNR9bPCdCiKoC3sEsfNTz9kkVUAxYbIe7n+kUNYbWEHXdeMhhxNgpP JiyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type :content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:cc:to:subject:dkim-signature :dkim-filter; bh=f+WU9Gp86xU9qgTi6jNl25QiCGGFXV/6k5uQqb9i5No=; b=dTWSr1R6oL5yXnXrsFFaVDnvKxLQatb4tEB5unFniX76Ieo+yK/ueECoIF57uDOgk/ 4wQC90PjNxjaaQk7Sp5VFd6VkXgN3XUmNkS9d7oRoKTCp+87agcqAIViEDsrtw3KOYes jB56UvPR6E6P7IaquN8RANR0Zieu9Mun08cr7ouxN6Gzyy0Q8xtCdMG6N3UmvUxEw1qj IrKvjCerE7zv2DpP7XsfaCXg7PUFJRF3EQy+jyn8w3xEZWwzFjf3snewyTulpYx3M8k/ vsmgpW+b4xDQ8Psd+RxpRC3jRPbUAPbyJUSGpyPv8h/4Qqtkb7tUT+DfKtR9P/KkaDF/ iVQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Avc9zmM6; 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 t12si16224751plq.190.2018.12.04.01.46.44; Tue, 04 Dec 2018 01:46:59 -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=Avc9zmM6; 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 S1726001AbeLDJoy (ORCPT + 99 others); Tue, 4 Dec 2018 04:44:54 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:49162 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725764AbeLDJox (ORCPT ); Tue, 4 Dec 2018 04:44:53 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20181204094451euoutp028a046a955d108d0ec681775e1561dd83~tGA0E5WcP1430614306euoutp02U for ; Tue, 4 Dec 2018 09:44:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20181204094451euoutp028a046a955d108d0ec681775e1561dd83~tGA0E5WcP1430614306euoutp02U DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1543916691; bh=f+WU9Gp86xU9qgTi6jNl25QiCGGFXV/6k5uQqb9i5No=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=Avc9zmM6GBHcnjpNtUOITggKOu3Fabq2TadSCFmL0ZLrT5zPtFQCnp+RyjA7CpU9L cZSGShd0kx+cQQphHsS0d12yUtgi9o87ybPQSbCBxoZolYlRtwrvA7eucMTgDRLIe4 qCKgcZrKUbAm+alLMCnPdrOQZdbjjrSqtjVszIJ8= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181204094449eucas1p1e079a735091b9c12c7ea5f1f40ddddb9~tGAynlO_o2232222322eucas1p1B; Tue, 4 Dec 2018 09:44:49 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 61.03.04806.19C460C5; Tue, 4 Dec 2018 09:44:49 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20181204094448eucas1p2c7e2367dad1909b112b42df4de88fac5~tGAxyHJFc2425624256eucas1p2F; Tue, 4 Dec 2018 09:44:48 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20181204094448eusmtrp105a67b802cb088e17d5b94b203168f22~tGAxiTLj41089810898eusmtrp1h; Tue, 4 Dec 2018 09:44:48 +0000 (GMT) X-AuditID: cbfec7f5-34dff700000012c6-32-5c064c91ddfe Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 2B.1C.04284.09C460C5; Tue, 4 Dec 2018 09:44:48 +0000 (GMT) Received: from [106.120.51.20] (unknown [106.120.51.20]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20181204094447eusmtip19cc51854e23421e50f2e2aa7f08d4fbe~tGAwkt-iM2933329333eusmtip1j; Tue, 4 Dec 2018 09:44:47 +0000 (GMT) Subject: Re: [PATCH v2 3/5] devfreq: add devfreq_suspend/resume() functions To: Chanwoo Choi , 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 From: Lukasz Luba Message-ID: Date: Tue, 4 Dec 2018 10:44:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <5C061C74.808@samsung.com> Content-Language: en-US Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA02SeVCMYRzHPfuepc3Tin5yzew4yoxo+OMZjMEYXsOMzDCz2MHSOznalX0r woxFlxy5ZR3RhmaLtLatiUTXypbkiojI2eHKPU1pezP67/P9Pd/vPN/fMw9PqU6z/vwaQ6Ro NOjC1awn7Sj/fWfsgXmsdvzzvKHkZm4gyUnJZkhezg+G1H57x5DU0jsM2WnJZknlbj1Jbmym SHX1ZY5U7WjhiPlwoYLYGh8x5H7BSZa07S1FJKX6uoJcLK3nyLnaGgV5uj2DJfW3y7ryrnsM iSss5Uh85meGtNx9Tk/zExxXHYyQdToLCSdMNbSwP/krEizXPigEm3UXKxSdyuKEK+nbhI5y TrA/TKCFfXYrEjIyf3JCm21YiHKJ55RQMXxNtGg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FbBl98cw1lqZR7IPLldTrO36cdb1 hGLrXxsF7Ln6SsBWVE1S7DfrvM3CJEmcVqPXcfPTNbwuXrxLiiIl0lgkiYyKlUhl8t2rIqPF EYq4VE6VcZDTRij2StKNv/KorOmww21GMgd8nZsP/GjIRMFT7y9g+cCfFjHlAD4dLca9QTA8 39JIeTkQTvfmk96icQCnnJ8xTxDIJMLhU8+AJwhiOgEsdHTMtMIZAw7HPl4DXuUPgPcKatw+ TZOMBDZVHvDYQmYDNFSNz4wQMItgw2MT6eE5zA74fOwW8NbMhu0XRwUe9mPCYaHh7sx6OBMD S2zD/zgEvhktxbwcBnNvF+NmILL46BYfxeKjWHyUK0BQCYI4Pa9OU/NSCa9U8/rMNEmKRm0F 7n9pePLb1gS667a0AoYG4lnConVEsohQHuSz1a0A0rg4SDiwhEwWCVOV2Uc4rWaPVq/i+FYQ 7T6uAA+dk6Jxf1+mbo80WipHsVK5TC6LQeIQoWNldpKISVPquP0cl8Vp/3sY7ReaA+hgm1nx dvlCTQ+2+fCPq4OHEM6sjz8rvPFBvU3/9IzJPywhKWG9eHI4Zsm+irjEfnlBW79/2bmByeqA zsWtyavvuHbmWcuPBhiHp0H31hXqsWOqDblreZcpwzRg2rhwPin0G9p+nykL5x++OmIMmdrd bkto1g3Z60/Lgj/hio9iAZ+ulC7DtbzyL+dOnXVFAwAA X-CMS-MailID: 20181204094448eucas1p2c7e2367dad1909b112b42df4de88fac5 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20181203143132eucas1p128c029a7c7461e1127924a08e4a71811 X-EPHeader: CA CMS-TYPE: 201P 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> <5C061C74.808@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Chanwoo, On 12/4/18 7:19 AM, Chanwoo Choi wrote: > 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. OK > >> >> 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" OK, changed in next v3 patch set. > >> + } >> + 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" > ACK Regards, Lukasz > >> + } >> + 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) >> { >> >