From patchwork Tue Jul 3 23:46:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 10505641 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 039E060225 for ; Tue, 3 Jul 2018 23:49:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E736228979 for ; Tue, 3 Jul 2018 23:49:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB4132899B; Tue, 3 Jul 2018 23:49:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 55BD228979 for ; Tue, 3 Jul 2018 23:49:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932694AbeGCXtO (ORCPT ); Tue, 3 Jul 2018 19:49:14 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:36567 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753539AbeGCXrc (ORCPT ); Tue, 3 Jul 2018 19:47:32 -0400 Received: by mail-pl0-f66.google.com with SMTP id a7-v6so1750980plp.3 for ; Tue, 03 Jul 2018 16:47:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BB5bFgMvczqwvFxpGImGlCQGaZfQstFGTxKw+wkkwn8=; b=r3UtoO4D81b4FR9nlwbD9ZqJT4jbCdMBILMx17oO2uOlGvw0+rVyvgqdEZ7FJiBIjo S9AJwh3fgVSC0/vp7ndp3dsLgrzpqj38pRzOTL/T1y59unVm2XJYJjNmBRnA4XNTumZI vgPqeC9aUd/cEcSkPClUaR1k+lFED7XACuX4wCXjBrUi75frTKl8T9zc5zRtcdvQVk83 O2cYnckxD9FIc6+dSvaj15A6Dy2v0vp2pAOAVKKOrji4CcF97ImK0o+Y9PgzfAqJFTpT ivquQgDl6x1lkYYH7gxCRRWVi+a8xVhklNQFqpIdA1I9AGJ0YLw0NNqdmryC+ofrnmZL O7+Q== X-Gm-Message-State: APt69E2/srDawXArV/gtCE5Uv1pNCSOtOgHrsPMDMk0p/QxZjPTFY2/e qbrClXNv7AMjK2Sd5WbaK6GYZw== X-Google-Smtp-Source: ADUXVKKWkUX7yG7OmrnYn8Hkct+47CtSY1MAqvIlGc2tTxh83MZ0cISLf3rsfWOvPqGCp/mwFac9tw== X-Received: by 2002:a17:902:7446:: with SMTP id e6-v6mr32494159plt.161.1530661651454; Tue, 03 Jul 2018 16:47:31 -0700 (PDT) Received: from mka.mtv.corp.google.com ([2620:0:1000:1501:8e2d:4727:1211:622]) by smtp.gmail.com with ESMTPSA id l85-v6sm6608562pfk.79.2018.07.03.16.47.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Jul 2018 16:47:30 -0700 (PDT) From: Matthias Kaehlcke To: MyungJoo Ham Cc: Kyungmin Park , Chanwoo Choi , Arnd Bergmann , Greg Kroah-Hartman , Rob Herring , Mark Rutland , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Brian Norris , Douglas Anderson , Enric Balletbo i Serra , "Rafael J . Wysocki" , Viresh Kumar , Lee Jones , Benson Leung , Olof Johansson , Matthias Kaehlcke Subject: [PATCH v5 06/12] PM / devfreq: Make update_devfreq() public Date: Tue, 3 Jul 2018 16:46:59 -0700 Message-Id: <20180703234705.227473-7-mka@chromium.org> X-Mailer: git-send-email 2.18.0.203.gfac676dfb9-goog In-Reply-To: <20180703234705.227473-1-mka@chromium.org> References: <20180703234705.227473-1-mka@chromium.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently update_devfreq() is only visible to devfreq governors outside of devfreq.c. Make it public to allow drivers that adjust devfreq policies to cause a re-evaluation of the frequency after a policy change. Signed-off-by: Matthias Kaehlcke Acked-by: MyungJoo Ham Reviewed-by: Brian Norris Reviewed-by: Chanwoo Choi --- Changes in v5: - none Changed in v4: - added 'Reviewed-by: Brian Norris ' tag Changes in v3: - none Changes in v2: - added 'Acked-by: MyungJoo Ham ' tag --- drivers/devfreq/governor.h | 3 --- include/linux/devfreq.h | 8 ++++++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/devfreq/governor.h b/drivers/devfreq/governor.h index b81700244ce3..f53339ca610f 100644 --- a/drivers/devfreq/governor.h +++ b/drivers/devfreq/governor.h @@ -57,9 +57,6 @@ struct devfreq_governor { unsigned int event, void *data); }; -/* Caution: devfreq->lock must be locked before calling update_devfreq */ -extern int update_devfreq(struct devfreq *devfreq); - extern void devfreq_monitor_start(struct devfreq *devfreq); extern void devfreq_monitor_stop(struct devfreq *devfreq); extern void devfreq_monitor_suspend(struct devfreq *devfreq); diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h index 7c8dce96db73..c4f84a769cb5 100644 --- a/include/linux/devfreq.h +++ b/include/linux/devfreq.h @@ -222,6 +222,14 @@ 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); +/** + * update_devfreq() - Reevaluate the device and configure frequency + * @devfreq: the devfreq device + * + * Note: devfreq->lock must be held + */ +extern int update_devfreq(struct devfreq *devfreq); + /* Helper functions for devfreq user device driver with OPP. */ extern struct dev_pm_opp *devfreq_recommended_opp(struct device *dev, unsigned long *freq, u32 flags);