From patchwork Tue Mar 9 12:58:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 396426 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B253FC4361A for ; Tue, 9 Mar 2021 13:13:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6AA2D65259 for ; Tue, 9 Mar 2021 13:13:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231265AbhCINM6 (ORCPT ); Tue, 9 Mar 2021 08:12:58 -0500 Received: from inva021.nxp.com ([92.121.34.21]:58108 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230452AbhCINMk (ORCPT ); Tue, 9 Mar 2021 08:12:40 -0500 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id F0362200FBB; Tue, 9 Mar 2021 14:12:38 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id BD9C6200FCD; Tue, 9 Mar 2021 14:12:32 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 6894A402AC; Tue, 9 Mar 2021 14:12:24 +0100 (CET) From: Dong Aisheng To: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: dongas86@gmail.com, kernel@pengutronix.de, shawnguo@kernel.org, linux-imx@nxp.com, linux-kernel@vger.kernel.org, myungjoo.ham@samsung.com, kyungmin.park@samsung.com, cw00.choi@samsung.com, abel.vesa@nxp.com, Dong Aisheng Subject: [PATCH 01/11] doc: ABI: devfreq: remove invalid central_polling description Date: Tue, 9 Mar 2021 20:58:43 +0800 Message-Id: <1615294733-22761-14-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615294733-22761-1-git-send-email-aisheng.dong@nxp.com> References: <1615294733-22761-1-git-send-email-aisheng.dong@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org no_central_polling has been removed since commit 7e6fdd4bad03 ("PM / devfreq: Core updates to support devices which can idle") Signed-off-by: Dong Aisheng --- Documentation/ABI/testing/sysfs-class-devfreq | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-class-devfreq b/Documentation/ABI/testing/sysfs-class-devfreq index 386bc230a33d..5e6b74f30406 100644 --- a/Documentation/ABI/testing/sysfs-class-devfreq +++ b/Documentation/ABI/testing/sysfs-class-devfreq @@ -97,10 +97,7 @@ Description: object. The values are represented in ms. If the value is less than 1 jiffy, it is considered to be 0, which means no polling. This value is meaningless if the governor is - not polling; thus. If the governor is not using - devfreq-provided central polling - (/sys/class/devfreq/.../central_polling is 0), this value - may be useless. + not polling. A list of governors that support the node: - simple_ondmenad From patchwork Tue Mar 9 12:58:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 396428 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66D42C433E6 for ; Tue, 9 Mar 2021 13:13:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4B78B65259 for ; Tue, 9 Mar 2021 13:13:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231272AbhCINM6 (ORCPT ); Tue, 9 Mar 2021 08:12:58 -0500 Received: from inva020.nxp.com ([92.121.34.13]:47152 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230458AbhCINMl (ORCPT ); Tue, 9 Mar 2021 08:12:41 -0500 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 6B7A71A100C; Tue, 9 Mar 2021 14:12:40 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 470F11A1009; Tue, 9 Mar 2021 14:12:34 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 4CA5440314; Tue, 9 Mar 2021 14:12:26 +0100 (CET) From: Dong Aisheng To: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: dongas86@gmail.com, kernel@pengutronix.de, shawnguo@kernel.org, linux-imx@nxp.com, linux-kernel@vger.kernel.org, myungjoo.ham@samsung.com, kyungmin.park@samsung.com, cw00.choi@samsung.com, abel.vesa@nxp.com, Dong Aisheng Subject: [PATCH 02/11] PM / devfreq: remove the invalid description for get_target_freq Date: Tue, 9 Mar 2021 20:58:44 +0800 Message-Id: <1615294733-22761-15-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615294733-22761-1-git-send-email-aisheng.dong@nxp.com> References: <1615294733-22761-1-git-send-email-aisheng.dong@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org First of all, no_central_polling was removed since commit 7e6fdd4bad03 ("PM / devfreq: Core updates to support devices which can idle") Secondly, get_target_freq() is not only called only with update_devfreq() notified by OPP now, but also min/max freq qos notifier. So remove this invalid description now to avoid confusing. Signed-off-by: Dong Aisheng --- drivers/devfreq/governor.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/devfreq/governor.h b/drivers/devfreq/governor.h index 70f44b3ca42e..5cee3f64fe2b 100644 --- a/drivers/devfreq/governor.h +++ b/drivers/devfreq/governor.h @@ -57,8 +57,6 @@ * Basically, get_target_freq will run * devfreq_dev_profile.get_dev_status() to get the * status of the device (load = busy_time / total_time). - * If no_central_polling is set, this callback is called - * only with update_devfreq() notified by OPP. * @event_handler: Callback for devfreq core framework to notify events * to governors. Events include per device governor * init and exit, opp changes out of devfreq, suspend From patchwork Tue Mar 9 12:58:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 396424 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39878C43331 for ; Tue, 9 Mar 2021 13:13:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 05BEB652B7 for ; Tue, 9 Mar 2021 13:13:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231169AbhCINMz (ORCPT ); Tue, 9 Mar 2021 08:12:55 -0500 Received: from inva020.nxp.com ([92.121.34.13]:46832 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229815AbhCINMZ (ORCPT ); Tue, 9 Mar 2021 08:12:25 -0500 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 1EDC41A100C; Tue, 9 Mar 2021 14:12:24 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id E88A01A100D; Tue, 9 Mar 2021 14:12:17 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id BC38D402AC; Tue, 9 Mar 2021 14:12:09 +0100 (CET) From: Dong Aisheng To: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: dongas86@gmail.com, kernel@pengutronix.de, shawnguo@kernel.org, linux-imx@nxp.com, linux-kernel@vger.kernel.org, myungjoo.ham@samsung.com, kyungmin.park@samsung.com, cw00.choi@samsung.com, abel.vesa@nxp.com, Dong Aisheng Subject: [PATCH 03/11] PM / devfreq: fix the wrong set_freq path for userspace governor Date: Tue, 9 Mar 2021 20:58:33 +0800 Message-Id: <1615294733-22761-4-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615294733-22761-1-git-send-email-aisheng.dong@nxp.com> References: <1615294733-22761-1-git-send-email-aisheng.dong@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Fix the wrong set_freq path for userspace governor. Signed-off-by: Dong Aisheng --- drivers/devfreq/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig index 00704efe6398..20373a893b44 100644 --- a/drivers/devfreq/Kconfig +++ b/drivers/devfreq/Kconfig @@ -62,7 +62,7 @@ config DEVFREQ_GOV_USERSPACE help Sets the frequency at the user specified one. This governor returns the user configured frequency if there - has been an input to /sys/devices/.../power/devfreq_set_freq. + has been an input to /sys/devices/.../userspace/set_freq. Otherwise, the governor does not change the frequency given at the initialization. From patchwork Tue Mar 9 12:58:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 397101 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F2F7C433E9 for ; Tue, 9 Mar 2021 13:13:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D896765259 for ; Tue, 9 Mar 2021 13:13:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231294AbhCINM7 (ORCPT ); Tue, 9 Mar 2021 08:12:59 -0500 Received: from inva021.nxp.com ([92.121.34.21]:58250 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230473AbhCINMo (ORCPT ); Tue, 9 Mar 2021 08:12:44 -0500 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 256B3200FA9; Tue, 9 Mar 2021 14:12:43 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id F15C2200FC7; Tue, 9 Mar 2021 14:12:36 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 1372240310; Tue, 9 Mar 2021 14:12:28 +0100 (CET) From: Dong Aisheng To: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: dongas86@gmail.com, kernel@pengutronix.de, shawnguo@kernel.org, linux-imx@nxp.com, linux-kernel@vger.kernel.org, myungjoo.ham@samsung.com, kyungmin.park@samsung.com, cw00.choi@samsung.com, abel.vesa@nxp.com, Dong Aisheng Subject: [PATCH 04/11] PM / devfreq: bail out early if no freq changes in devfreq_set_target Date: Tue, 9 Mar 2021 20:58:46 +0800 Message-Id: <1615294733-22761-17-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615294733-22761-1-git-send-email-aisheng.dong@nxp.com> References: <1615294733-22761-1-git-send-email-aisheng.dong@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org It's unnecessary to set the same freq again and run notifier calls. Signed-off-by: Dong Aisheng --- drivers/devfreq/devfreq.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index bf3047896e41..6e80bf70e7b3 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -358,6 +358,9 @@ static int devfreq_set_target(struct devfreq *devfreq, unsigned long new_freq, else cur_freq = devfreq->previous_freq; + if (new_freq == cur_freq) + return 0; + freqs.old = cur_freq; freqs.new = new_freq; devfreq_notify_transition(devfreq, &freqs, DEVFREQ_PRECHANGE); @@ -374,7 +377,7 @@ static int devfreq_set_target(struct devfreq *devfreq, unsigned long new_freq, * and DEVFREQ_POSTCHANGE because for showing the correct frequency * change order of between devfreq device and passive devfreq device. */ - if (trace_devfreq_frequency_enabled() && new_freq != cur_freq) + if (trace_devfreq_frequency_enabled()) trace_devfreq_frequency(devfreq, new_freq, cur_freq); freqs.new = new_freq; From patchwork Tue Mar 9 12:58:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 396423 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06ECDC433E0 for ; Tue, 9 Mar 2021 13:13:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B049D6525D for ; Tue, 9 Mar 2021 13:13:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231301AbhCINNA (ORCPT ); Tue, 9 Mar 2021 08:13:00 -0500 Received: from inva021.nxp.com ([92.121.34.21]:58264 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230477AbhCINMp (ORCPT ); Tue, 9 Mar 2021 08:12:45 -0500 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 9C186200FBB; Tue, 9 Mar 2021 14:12:44 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 7572C200FAC; Tue, 9 Mar 2021 14:12:38 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 6D0D54031B; Tue, 9 Mar 2021 14:12:30 +0100 (CET) From: Dong Aisheng To: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: dongas86@gmail.com, kernel@pengutronix.de, shawnguo@kernel.org, linux-imx@nxp.com, linux-kernel@vger.kernel.org, myungjoo.ham@samsung.com, kyungmin.park@samsung.com, cw00.choi@samsung.com, abel.vesa@nxp.com, Dong Aisheng Subject: [PATCH 05/11] PM / devfreq: use more accurate returned new_freq as resume_freq Date: Tue, 9 Mar 2021 20:58:47 +0800 Message-Id: <1615294733-22761-18-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615294733-22761-1-git-send-email-aisheng.dong@nxp.com> References: <1615294733-22761-1-git-send-email-aisheng.dong@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Use the more accurate returned new_freq as resume_freq. It's the same as how devfreq->previous_freq was updated. Signed-off-by: Dong Aisheng --- drivers/devfreq/devfreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index 6e80bf70e7b3..ce569bd9adfa 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -390,7 +390,7 @@ static int devfreq_set_target(struct devfreq *devfreq, unsigned long new_freq, devfreq->previous_freq = new_freq; if (devfreq->suspend_freq) - devfreq->resume_freq = cur_freq; + devfreq->resume_freq = new_freq; return err; } From patchwork Tue Mar 9 12:58:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 396431 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA351C432C3 for ; Tue, 9 Mar 2021 13:13:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 86DBC6525D for ; Tue, 9 Mar 2021 13:13:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231216AbhCINM4 (ORCPT ); Tue, 9 Mar 2021 08:12:56 -0500 Received: from inva021.nxp.com ([92.121.34.21]:57804 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230183AbhCINMd (ORCPT ); Tue, 9 Mar 2021 08:12:33 -0500 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 220CD200FC5; Tue, 9 Mar 2021 14:12:32 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id EFB97200FC7; Tue, 9 Mar 2021 14:12:25 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 3EEA740328; Tue, 9 Mar 2021 14:12:14 +0100 (CET) From: Dong Aisheng To: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: dongas86@gmail.com, kernel@pengutronix.de, shawnguo@kernel.org, linux-imx@nxp.com, linux-kernel@vger.kernel.org, myungjoo.ham@samsung.com, kyungmin.park@samsung.com, cw00.choi@samsung.com, abel.vesa@nxp.com, Dong Aisheng Subject: [PATCH 06/11] PM / devfreq: drop the unnecessary low variable initialization Date: Tue, 9 Mar 2021 20:58:36 +0800 Message-Id: <1615294733-22761-7-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615294733-22761-1-git-send-email-aisheng.dong@nxp.com> References: <1615294733-22761-1-git-send-email-aisheng.dong@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org drop the unnecessary low variable initialization and make the return more straightforward. Signed-off-by: Dong Aisheng --- drivers/devfreq/devfreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index ce569bd9adfa..7231fe6862a2 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -351,7 +351,7 @@ static int devfreq_set_target(struct devfreq *devfreq, unsigned long new_freq, { struct devfreq_freqs freqs; unsigned long cur_freq; - int err = 0; + int err; if (devfreq->profile->get_cur_freq) devfreq->profile->get_cur_freq(devfreq->dev.parent, &cur_freq); @@ -392,7 +392,7 @@ static int devfreq_set_target(struct devfreq *devfreq, unsigned long new_freq, if (devfreq->suspend_freq) devfreq->resume_freq = new_freq; - return err; + return 0; } /** From patchwork Tue Mar 9 12:58:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 396427 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3880C4160E for ; Tue, 9 Mar 2021 13:13:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9A6C2652BC for ; Tue, 9 Mar 2021 13:13:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229815AbhCINNA (ORCPT ); Tue, 9 Mar 2021 08:13:00 -0500 Received: from inva020.nxp.com ([92.121.34.13]:47308 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230492AbhCINMr (ORCPT ); Tue, 9 Mar 2021 08:12:47 -0500 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id AFAAD1A101A; Tue, 9 Mar 2021 14:12:46 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 875E41A1009; Tue, 9 Mar 2021 14:12:40 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 1BED9402EB; Tue, 9 Mar 2021 14:12:33 +0100 (CET) From: Dong Aisheng To: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: dongas86@gmail.com, kernel@pengutronix.de, shawnguo@kernel.org, linux-imx@nxp.com, linux-kernel@vger.kernel.org, myungjoo.ham@samsung.com, kyungmin.park@samsung.com, cw00.choi@samsung.com, abel.vesa@nxp.com, Dong Aisheng Subject: [PATCH 07/11] PM / devfreq: check get_dev_status before start monitor Date: Tue, 9 Mar 2021 20:58:49 +0800 Message-Id: <1615294733-22761-20-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615294733-22761-1-git-send-email-aisheng.dong@nxp.com> References: <1615294733-22761-1-git-send-email-aisheng.dong@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The devfreq monitor depends on the device to provide load information by .get_dev_status() to calculate the next target freq. And this will cause changing governor to simple ondemand fail if device can't support. Signed-off-by: Dong Aisheng --- drivers/devfreq/devfreq.c | 10 +++++++--- drivers/devfreq/governor.h | 2 +- drivers/devfreq/governor_simpleondemand.c | 3 +-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index 7231fe6862a2..d1787b6c7d7c 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -482,10 +482,13 @@ static void devfreq_monitor(struct work_struct *work) * to be called from governor in response to DEVFREQ_GOV_START * event when device is added to devfreq framework. */ -void devfreq_monitor_start(struct devfreq *devfreq) +int devfreq_monitor_start(struct devfreq *devfreq) { if (IS_SUPPORTED_FLAG(devfreq->governor->flags, IRQ_DRIVEN)) - return; + return 0; + + if (!devfreq->profile->get_dev_status) + return -EINVAL; switch (devfreq->profile->timer) { case DEVFREQ_TIMER_DEFERRABLE: @@ -495,12 +498,13 @@ void devfreq_monitor_start(struct devfreq *devfreq) INIT_DELAYED_WORK(&devfreq->work, devfreq_monitor); break; default: - return; + return -EINVAL; } if (devfreq->profile->polling_ms) queue_delayed_work(devfreq_wq, &devfreq->work, msecs_to_jiffies(devfreq->profile->polling_ms)); + return 0; } EXPORT_SYMBOL(devfreq_monitor_start); diff --git a/drivers/devfreq/governor.h b/drivers/devfreq/governor.h index 5cee3f64fe2b..31af6d072a10 100644 --- a/drivers/devfreq/governor.h +++ b/drivers/devfreq/governor.h @@ -75,7 +75,7 @@ struct devfreq_governor { unsigned int event, void *data); }; -void devfreq_monitor_start(struct devfreq *devfreq); +int devfreq_monitor_start(struct devfreq *devfreq); void devfreq_monitor_stop(struct devfreq *devfreq); void devfreq_monitor_suspend(struct devfreq *devfreq); void devfreq_monitor_resume(struct devfreq *devfreq); diff --git a/drivers/devfreq/governor_simpleondemand.c b/drivers/devfreq/governor_simpleondemand.c index d57b82a2b570..ea287b57cbf3 100644 --- a/drivers/devfreq/governor_simpleondemand.c +++ b/drivers/devfreq/governor_simpleondemand.c @@ -89,8 +89,7 @@ static int devfreq_simple_ondemand_handler(struct devfreq *devfreq, { switch (event) { case DEVFREQ_GOV_START: - devfreq_monitor_start(devfreq); - break; + return devfreq_monitor_start(devfreq); case DEVFREQ_GOV_STOP: devfreq_monitor_stop(devfreq); From patchwork Tue Mar 9 12:58:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 397105 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98423C4361B for ; Tue, 9 Mar 2021 13:13:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 62C406527D for ; Tue, 9 Mar 2021 13:13:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231325AbhCINNB (ORCPT ); Tue, 9 Mar 2021 08:13:01 -0500 Received: from inva020.nxp.com ([92.121.34.13]:47444 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230495AbhCINMt (ORCPT ); Tue, 9 Mar 2021 08:12:49 -0500 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 3179F1A09B2; Tue, 9 Mar 2021 14:12:48 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 0DC4C1A1010; Tue, 9 Mar 2021 14:12:42 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 758354031D; Tue, 9 Mar 2021 14:12:34 +0100 (CET) From: Dong Aisheng To: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: dongas86@gmail.com, kernel@pengutronix.de, shawnguo@kernel.org, linux-imx@nxp.com, linux-kernel@vger.kernel.org, myungjoo.ham@samsung.com, kyungmin.park@samsung.com, cw00.choi@samsung.com, abel.vesa@nxp.com, Dong Aisheng Subject: [PATCH 08/11] PM / devfreq: check get_dev_status in devfreq_update_stats Date: Tue, 9 Mar 2021 20:58:50 +0800 Message-Id: <1615294733-22761-21-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615294733-22761-1-git-send-email-aisheng.dong@nxp.com> References: <1615294733-22761-1-git-send-email-aisheng.dong@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Check .get_dev_status() in devfreq_update_stats in case it's abused when a device does not provide it. Signed-off-by: Dong Aisheng --- drivers/devfreq/governor.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/devfreq/governor.h b/drivers/devfreq/governor.h index 31af6d072a10..67a6dbdd5d23 100644 --- a/drivers/devfreq/governor.h +++ b/drivers/devfreq/governor.h @@ -89,6 +89,9 @@ int devfreq_update_target(struct devfreq *devfreq, unsigned long freq); static inline int devfreq_update_stats(struct devfreq *df) { + if (!df->profile->get_dev_status) + return -EINVAL; + return df->profile->get_dev_status(df->dev.parent, &df->last_status); } #endif /* _GOVERNOR_H */ From patchwork Tue Mar 9 12:58:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 397104 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C8B2C1550B for ; Tue, 9 Mar 2021 13:13:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0D7AD65274 for ; Tue, 9 Mar 2021 13:13:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231335AbhCINNB (ORCPT ); Tue, 9 Mar 2021 08:13:01 -0500 Received: from inva020.nxp.com ([92.121.34.13]:47504 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230503AbhCINMv (ORCPT ); Tue, 9 Mar 2021 08:12:51 -0500 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id D92D31A1009; Tue, 9 Mar 2021 14:12:49 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 7976F1A1011; Tue, 9 Mar 2021 14:12:43 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id EEED7402A7; Tue, 9 Mar 2021 14:12:35 +0100 (CET) From: Dong Aisheng To: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: dongas86@gmail.com, kernel@pengutronix.de, shawnguo@kernel.org, linux-imx@nxp.com, linux-kernel@vger.kernel.org, myungjoo.ham@samsung.com, kyungmin.park@samsung.com, cw00.choi@samsung.com, abel.vesa@nxp.com, Dong Aisheng Subject: [PATCH 09/11] PM / devfreq: governor: optimize simpleondemand get_target_freq Date: Tue, 9 Mar 2021 20:58:51 +0800 Message-Id: <1615294733-22761-22-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615294733-22761-1-git-send-email-aisheng.dong@nxp.com> References: <1615294733-22761-1-git-send-email-aisheng.dong@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org devfreq_simple_ondemand_data only needs to be initialized once when calling devm_devfreq_add_device. It's unnecessary to put the data check logic in the hot path (.get_target_freq()) where it will be called all the time during polling. Instead, we only check and initialize it one time during DEVFREQ_GOV_START. This also helps check data validability in advance during DEVFREQ_GOV_START rather than checking it later when running .get_target_freq(). Signed-off-by: Dong Aisheng --- drivers/devfreq/governor_simpleondemand.c | 50 +++++++++++++++-------- 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/drivers/devfreq/governor_simpleondemand.c b/drivers/devfreq/governor_simpleondemand.c index ea287b57cbf3..341eb7e9dc04 100644 --- a/drivers/devfreq/governor_simpleondemand.c +++ b/drivers/devfreq/governor_simpleondemand.c @@ -15,15 +15,19 @@ /* Default constants for DevFreq-Simple-Ondemand (DFSO) */ #define DFSO_UPTHRESHOLD (90) #define DFSO_DOWNDIFFERENCTIAL (5) + +static struct devfreq_simple_ondemand_data od_default = { + .upthreshold = DFSO_UPTHRESHOLD, + .downdifferential = DFSO_DOWNDIFFERENCTIAL, +}; + static int devfreq_simple_ondemand_func(struct devfreq *df, unsigned long *freq) { int err; struct devfreq_dev_status *stat; unsigned long long a, b; - unsigned int dfso_upthreshold = DFSO_UPTHRESHOLD; - unsigned int dfso_downdifferential = DFSO_DOWNDIFFERENCTIAL; - struct devfreq_simple_ondemand_data *data = df->data; + struct devfreq_simple_ondemand_data *od = df->data; err = devfreq_update_stats(df); if (err) @@ -31,16 +35,6 @@ static int devfreq_simple_ondemand_func(struct devfreq *df, stat = &df->last_status; - if (data) { - if (data->upthreshold) - dfso_upthreshold = data->upthreshold; - if (data->downdifferential) - dfso_downdifferential = data->downdifferential; - } - if (dfso_upthreshold > 100 || - dfso_upthreshold < dfso_downdifferential) - return -EINVAL; - /* Assume MAX if it is going to be divided by zero */ if (stat->total_time == 0) { *freq = DEVFREQ_MAX_FREQ; @@ -55,7 +49,7 @@ static int devfreq_simple_ondemand_func(struct devfreq *df, /* Set MAX if it's busy enough */ if (stat->busy_time * 100 > - stat->total_time * dfso_upthreshold) { + stat->total_time * od->upthreshold) { *freq = DEVFREQ_MAX_FREQ; return 0; } @@ -68,7 +62,7 @@ static int devfreq_simple_ondemand_func(struct devfreq *df, /* Keep the current frequency */ if (stat->busy_time * 100 > - stat->total_time * (dfso_upthreshold - dfso_downdifferential)) { + stat->total_time * (od->upthreshold - od->downdifferential)) { *freq = stat->current_frequency; return 0; } @@ -78,17 +72,41 @@ static int devfreq_simple_ondemand_func(struct devfreq *df, a *= stat->current_frequency; b = div_u64(a, stat->total_time); b *= 100; - b = div_u64(b, (dfso_upthreshold - dfso_downdifferential / 2)); + b = div_u64(b, (od->upthreshold - od->downdifferential / 2)); *freq = (unsigned long) b; return 0; } +static int devfreq_simple_ondemand_check_od(struct devfreq *devfreq) +{ + struct devfreq_simple_ondemand_data *od = devfreq->data; + + if (od) { + if (!od->upthreshold) + od->upthreshold = DFSO_UPTHRESHOLD; + + if (!od->downdifferential) + od->downdifferential = DFSO_DOWNDIFFERENCTIAL; + + if (od->upthreshold > 100 || + od->upthreshold < od->downdifferential) + return -EINVAL; + } else { + od = &od_default; + } + + return 0; +} + static int devfreq_simple_ondemand_handler(struct devfreq *devfreq, unsigned int event, void *data) { switch (event) { case DEVFREQ_GOV_START: + if (devfreq_simple_ondemand_check_od(devfreq)) + return -EINVAL; + return devfreq_monitor_start(devfreq); case DEVFREQ_GOV_STOP: From patchwork Tue Mar 9 12:58:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 397102 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F07D4C4332B for ; Tue, 9 Mar 2021 13:13:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D810D65275 for ; Tue, 9 Mar 2021 13:13:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231339AbhCINNC (ORCPT ); Tue, 9 Mar 2021 08:13:02 -0500 Received: from inva020.nxp.com ([92.121.34.13]:47526 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230508AbhCINMw (ORCPT ); Tue, 9 Mar 2021 08:12:52 -0500 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id CCBD01A1005; Tue, 9 Mar 2021 14:12:51 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 9FB751A100C; Tue, 9 Mar 2021 14:12:45 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 704E9402AD; Tue, 9 Mar 2021 14:12:37 +0100 (CET) From: Dong Aisheng To: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: dongas86@gmail.com, kernel@pengutronix.de, shawnguo@kernel.org, linux-imx@nxp.com, linux-kernel@vger.kernel.org, myungjoo.ham@samsung.com, kyungmin.park@samsung.com, cw00.choi@samsung.com, abel.vesa@nxp.com, Dong Aisheng Subject: [PATCH 10/11] PM / devfreq: imx8m-ddrc: remove imx8m_ddrc_get_dev_status Date: Tue, 9 Mar 2021 20:58:52 +0800 Message-Id: <1615294733-22761-23-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615294733-22761-1-git-send-email-aisheng.dong@nxp.com> References: <1615294733-22761-1-git-send-email-aisheng.dong@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Current driver actually does not support simple ondemand governor as it's unable to provide device load information. So removing the unnecessary callback to avoid confusing. Right now the driver is using userspace governor by default. Signed-off-by: Dong Aisheng --- drivers/devfreq/imx8m-ddrc.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/drivers/devfreq/imx8m-ddrc.c b/drivers/devfreq/imx8m-ddrc.c index bc82d3653bff..0a6b7a1c829d 100644 --- a/drivers/devfreq/imx8m-ddrc.c +++ b/drivers/devfreq/imx8m-ddrc.c @@ -280,18 +280,6 @@ static int imx8m_ddrc_get_cur_freq(struct device *dev, unsigned long *freq) return 0; } -static int imx8m_ddrc_get_dev_status(struct device *dev, - struct devfreq_dev_status *stat) -{ - struct imx8m_ddrc *priv = dev_get_drvdata(dev); - - stat->busy_time = 0; - stat->total_time = 0; - stat->current_frequency = clk_get_rate(priv->dram_core); - - return 0; -} - static int imx8m_ddrc_init_freq_info(struct device *dev) { struct imx8m_ddrc *priv = dev_get_drvdata(dev); @@ -431,7 +419,6 @@ static int imx8m_ddrc_probe(struct platform_device *pdev) priv->profile.polling_ms = 1000; priv->profile.target = imx8m_ddrc_target; - priv->profile.get_dev_status = imx8m_ddrc_get_dev_status; priv->profile.exit = imx8m_ddrc_exit; priv->profile.get_cur_freq = imx8m_ddrc_get_cur_freq; priv->profile.initial_freq = clk_get_rate(priv->dram_core); From patchwork Tue Mar 9 12:58:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 396425 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03CD2C4161F for ; Tue, 9 Mar 2021 13:13:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BA1C56525D for ; Tue, 9 Mar 2021 13:13:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231342AbhCINNC (ORCPT ); Tue, 9 Mar 2021 08:13:02 -0500 Received: from inva021.nxp.com ([92.121.34.21]:58492 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230521AbhCINMx (ORCPT ); Tue, 9 Mar 2021 08:12:53 -0500 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id BBE79200FBB; Tue, 9 Mar 2021 14:12:52 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 93E9D200FAC; Tue, 9 Mar 2021 14:12:46 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 1A959402AC; Tue, 9 Mar 2021 14:12:39 +0100 (CET) From: Dong Aisheng To: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: dongas86@gmail.com, kernel@pengutronix.de, shawnguo@kernel.org, linux-imx@nxp.com, linux-kernel@vger.kernel.org, myungjoo.ham@samsung.com, kyungmin.park@samsung.com, cw00.choi@samsung.com, abel.vesa@nxp.com, Dong Aisheng Subject: [PATCH 11/11] PM / devfreq: imx8m-ddrc: drop polling_ms Date: Tue, 9 Mar 2021 20:58:53 +0800 Message-Id: <1615294733-22761-24-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615294733-22761-1-git-send-email-aisheng.dong@nxp.com> References: <1615294733-22761-1-git-send-email-aisheng.dong@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org polling_ms is only used by simple ondemand governor which this driver can't support. Drop it to avoid confusing. Signed-off-by: Dong Aisheng --- drivers/devfreq/imx8m-ddrc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/devfreq/imx8m-ddrc.c b/drivers/devfreq/imx8m-ddrc.c index 0a6b7a1c829d..ecb9375aa877 100644 --- a/drivers/devfreq/imx8m-ddrc.c +++ b/drivers/devfreq/imx8m-ddrc.c @@ -417,7 +417,6 @@ static int imx8m_ddrc_probe(struct platform_device *pdev) if (ret < 0) goto err; - priv->profile.polling_ms = 1000; priv->profile.target = imx8m_ddrc_target; priv->profile.exit = imx8m_ddrc_exit; priv->profile.get_cur_freq = imx8m_ddrc_get_cur_freq;