Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8035074imu; Tue, 4 Dec 2018 01:38:56 -0800 (PST) X-Google-Smtp-Source: AFSGD/XvCvGEDe6Qr91fenKtyx73eik0eWi3+EZ6Qj6Pu84DV0DLNv/Ebo1sZ0LFX/8KVDOS21D8 X-Received: by 2002:a65:4646:: with SMTP id k6mr14638340pgr.153.1543916336113; Tue, 04 Dec 2018 01:38:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543916336; cv=none; d=google.com; s=arc-20160816; b=Rnl544Q47c5Hv9MmmNcZG8ZYYC7UeAGI/QYmpyVNARDTDlV3/x5+i5mHSMLObInneK xdkWKMIzeUwvG3Ecm6wHragUK7zW7Miqq0QAMKmiU4ERch6LkpyjEDe0VJj/c5IjLK1p 3/Aluykdmpk5ceEvHA7J65d0Mgix42UVLSRn5G+RaV1SAqDtnc8JLVpHufAzW5O1Fn+W x4G/t1/fFWh7AgGfRXtwJK22YjLx9OVIY78B71kG/TF72Aq5Y22kKZs9QTq7yw/XAJI1 xVArsFfm1Lcb+kfPv+hsEicwScmTXz1qo+lbbAMTGr3QqserJnjkmgycmnUwKK3LEZxG g+7A== 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=5oHwbkNBwZ8vyA7aiFkSdMNnG2mYoDqJwLr7psoNemc=; b=fr/JtqYIZ0SmlUPVkynU0AtfENrEjQfU30Digs6EI8yi75OJh2/sB6Rym0FILzDkoA kHeH4J0VORz+X8Y4uSscuLSeX9ytbH1huXIkcDgcSio8QSQxdWZ7dc0HJfGcaDhBmsln hngChZ752TAZOMW02B2Rlcm3BKbOUIyDLBXj8N0JUQ25G9b4rAw/g0jikSOpbgWMLZqK Dlfd3BzUgnG7+KwtH1I8t6gdwCFwJ1swn3FHmA6AiavddfsOq6MlQGp+4OW4mOSjmsbz /G0SQk9RnBRe0LLjgdZ7qriDfZT8r0Uynytm6d1cPKLSOCE35ykh/k6iK49adqcrloNy BMjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="HkQPftd/"; 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 k62si17282688pfc.208.2018.12.04.01.38.41; Tue, 04 Dec 2018 01:38:56 -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="HkQPftd/"; 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 S1725984AbeLDJg7 (ORCPT + 99 others); Tue, 4 Dec 2018 04:36:59 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:46007 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725857AbeLDJg6 (ORCPT ); Tue, 4 Dec 2018 04:36:58 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20181204093655euoutp02bbed318c533ff83222000aed0be66302~tF55N6dja1018410184euoutp028 for ; Tue, 4 Dec 2018 09:36:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20181204093655euoutp02bbed318c533ff83222000aed0be66302~tF55N6dja1018410184euoutp028 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1543916215; bh=5oHwbkNBwZ8vyA7aiFkSdMNnG2mYoDqJwLr7psoNemc=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=HkQPftd/kukHaVN4am1IcXmytVT/aRGRvroja5EID4/igZMKc9vk9b+EBWn7zwxxU dD5975dRhB5O0u5J2m9mmPw0UXsluuUe+NYKQRf7VXOPQpO2KdC/Dh/w9kHpP/iCn6 rJ9QmOpZfKa2BigTskWmfsxAwCVAhV3gV/NEaGLE= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181204093654eucas1p2d116d06566f9845accdc7c3863f5fe8a~tF54Ju3rX1999119991eucas1p2f; Tue, 4 Dec 2018 09:36:54 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 18.A7.04441.6BA460C5; Tue, 4 Dec 2018 09:36:54 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20181204093653eucas1p131c58415f6a494ca38c28bce87663f25~tF53C37vv1164211642eucas1p1p; Tue, 4 Dec 2018 09:36:53 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20181204093653eusmtrp24278476d6886c845d59dbb463545726c~tF52zHntu0363703637eusmtrp2S; Tue, 4 Dec 2018 09:36:53 +0000 (GMT) X-AuditID: cbfec7f2-5e3ff70000001159-49-5c064ab6b0f6 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id F4.90.04128.5BA460C5; Tue, 4 Dec 2018 09:36:53 +0000 (GMT) Received: from [106.120.51.20] (unknown [106.120.51.20]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20181204093652eusmtip20f4a75b67b676023661632c12d2b8ef0~tF512CYcj2472424724eusmtip2e; Tue, 4 Dec 2018 09:36:52 +0000 (GMT) Subject: Re: [PATCH v2 1/5] devfreq: refactor set_target frequency function 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: <545653c6-d68f-9177-6765-15a1beccb60f@partner.samsung.com> Date: Tue, 4 Dec 2018 10:36:51 +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: <5C060511.8020802@samsung.com> Content-Language: en-US Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA02SaUxTaRSG/XpX0JqP6tgT11iNGxEko+HDFeOSG52JM3/UKMlMHe8gGVq1 F1BHowiCFTc0aqGyGEElpQattRRQUEAJi2wOMoNUajAaGVECuEWDcrk18u85y5vzvsnhKU0m O56PMsaIJqM+Wsf60677H+vnutawEfPOtkwhd2/OJtfTChhSeP0dQ1r7XzAku7KeIYk5BSyp O2ogJzv/p0hDwzWOPEh4xRHrmdsq4uh8xJCHxRks6TteiUhaQ6mKXK30cORSa5OKPD6YxxJP zb1BfW0zQ5JuV3IkOb+HIa8an9DhWsFV4mIEe5YdCefjm2gh9WQvEnJuvVQJDtsRVijLtHPC jdwDwsB9TnC2HKaFE04bEvLy33NCn2PyL+p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prQHc5ewugisqHAPcjQdOjLOYT1Nc89UaEXev4jg3 3S7i6l+dJLhz9WbAVVX/FnHjlkVbmHhZlE6brucXJ2sF/RppghyFyuSRSBYaHimTh0XsWhWq kAavjdrPp6Zk8LrgtXtkyb39Jiqtc+GRF5V9eDY4BQ1ATEM2HE7afuAG4EFL2EoA65tuUe5g Abzw0CZy83w49dpAuS8NA9hvs2OuYD67CVbkjxKuwIvtALDY8QxzHXC2AIfO0XLgVqYBPD0x SRoATVOsDDaaD7uQYTfA3IG9rocINgA+KjH++82b3QmfO+8AFzPsPPj00hDhYjG7Ao5NuCfC 2ZWw9N5H3M0+8N1QGeZmP5jXcBkvAhLTLN00SzHNUkyzlGuAMAMvPl1Qq9RCqExQqoV0jUq2 T6u2gJm+WNv/1DcCw7ftrYClgdSTMa4nEyWkMkPIVLcCSONSL+bDUipRwuxXZmbxOm2SLj2V F1qBYma587iv9z7tTPs0+iS5Qh6BIuURYRFhK5HUh3GEZMZLWJVSzx/i+TRe99/DaLFvNmjZ EZig8hdiDjYGpVy3x2lCvgZU+3sta3aO9kTXwdTyL7W5Jwhm99FIvclzceEjydyBJZvz7VsO GOlyz20/bYpxVeyBkmNpU1n9hvYrMXFYRmxnQLfJqlg9PpQWrT76ntPPebLDT5zv+9ZuTsrx +L5VfNHq/DRtaUw4eDOc6S6QEkKyUr4c1wnKv3JJz8JFAwAA X-CMS-MailID: 20181204093653eucas1p131c58415f6a494ca38c28bce87663f25 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20181203143129eucas1p2955b6becc60ee57110cbc52f6e4f60c5 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181203143129eucas1p2955b6becc60ee57110cbc52f6e4f60c5 References: <1543847475-7600-1-git-send-email-l.luba@partner.samsung.com> <1543847475-7600-2-git-send-email-l.luba@partner.samsung.com> <5C060511.8020802@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 5:39 AM, Chanwoo Choi wrote: > Hi Lukasz, > > On 2018년 12월 03일 23:31, Lukasz Luba wrote: >> The refactoring is needed for the new client in devfreq: suspend. >> To avoid code duplication, move it to the new local function >> devfreq_set_target. >> >> The patch is based on earlier work by Tobias Jakobi. > > As I already commented, Please remove it. You already mentioned it on cover-letter. > If you want to contain the contribution history of Tobias, you might better > to add 'Signed-off-by' or others. OK Regards, Lukasz > >> >> Suggested-by: Tobias Jakobi >> Suggested-by: Chanwoo Choi >> Signed-off-by: Lukasz Luba >> --- >> drivers/devfreq/devfreq.c | 62 +++++++++++++++++++++++++++-------------------- >> 1 file changed, 36 insertions(+), 26 deletions(-) >> >> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c >> index 1414130..a9fd61b 100644 >> --- a/drivers/devfreq/devfreq.c >> +++ b/drivers/devfreq/devfreq.c >> @@ -285,6 +285,40 @@ static int devfreq_notify_transition(struct devfreq *devfreq, >> return 0; >> } >> >> +static int devfreq_set_target(struct devfreq *devfreq, unsigned long new_freq, >> + u32 flags) >> +{ >> + struct devfreq_freqs freqs; >> + unsigned long cur_freq; >> + int err = 0; >> + >> + if (devfreq->profile->get_cur_freq) >> + devfreq->profile->get_cur_freq(devfreq->dev.parent, &cur_freq); >> + else >> + cur_freq = devfreq->previous_freq; >> + >> + freqs.old = cur_freq; >> + freqs.new = new_freq; >> + devfreq_notify_transition(devfreq, &freqs, DEVFREQ_PRECHANGE); >> + >> + err = devfreq->profile->target(devfreq->dev.parent, &new_freq, flags); >> + if (err) { >> + freqs.new = cur_freq; >> + devfreq_notify_transition(devfreq, &freqs, DEVFREQ_POSTCHANGE); >> + return err; >> + } >> + >> + freqs.new = new_freq; >> + devfreq_notify_transition(devfreq, &freqs, DEVFREQ_POSTCHANGE); >> + >> + if (devfreq_update_status(devfreq, new_freq)) >> + dev_err(&devfreq->dev, >> + "Couldn't update frequency transition information.\n"); >> + >> + devfreq->previous_freq = new_freq; >> + return err; >> +} >> + >> /* Load monitoring helper functions for governors use */ >> >> /** >> @@ -296,8 +330,7 @@ static int devfreq_notify_transition(struct devfreq *devfreq, >> */ >> int update_devfreq(struct devfreq *devfreq) >> { >> - struct devfreq_freqs freqs; >> - unsigned long freq, cur_freq, min_freq, max_freq; >> + unsigned long freq, min_freq, max_freq; >> int err = 0; >> u32 flags = 0; >> >> @@ -333,31 +366,8 @@ int update_devfreq(struct devfreq *devfreq) >> flags |= DEVFREQ_FLAG_LEAST_UPPER_BOUND; /* Use LUB */ >> } >> >> - if (devfreq->profile->get_cur_freq) >> - devfreq->profile->get_cur_freq(devfreq->dev.parent, &cur_freq); >> - else >> - cur_freq = devfreq->previous_freq; >> - >> - freqs.old = cur_freq; >> - freqs.new = freq; >> - devfreq_notify_transition(devfreq, &freqs, DEVFREQ_PRECHANGE); >> + return devfreq_set_target(devfreq, freq, flags); >> >> - err = devfreq->profile->target(devfreq->dev.parent, &freq, flags); >> - if (err) { >> - freqs.new = cur_freq; >> - devfreq_notify_transition(devfreq, &freqs, DEVFREQ_POSTCHANGE); >> - return err; >> - } >> - >> - freqs.new = freq; >> - devfreq_notify_transition(devfreq, &freqs, DEVFREQ_POSTCHANGE); >> - >> - if (devfreq_update_status(devfreq, freq)) >> - dev_err(&devfreq->dev, >> - "Couldn't update frequency transition information.\n"); >> - >> - devfreq->previous_freq = freq; >> - return err; >> } >> EXPORT_SYMBOL(update_devfreq); >> >> > >