From patchwork Fri Aug 3 20:05:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 10555485 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C276D13BF for ; Fri, 3 Aug 2018 20:05:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4EC32B447 for ; Fri, 3 Aug 2018 20:05:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A92F02B841; Fri, 3 Aug 2018 20:05:34 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 4F0E92B447 for ; Fri, 3 Aug 2018 20:05:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732227AbeHCWDS (ORCPT ); Fri, 3 Aug 2018 18:03:18 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:36270 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732180AbeHCWDS (ORCPT ); Fri, 3 Aug 2018 18:03:18 -0400 Received: by mail-pf1-f194.google.com with SMTP id b11-v6so3798741pfo.3 for ; Fri, 03 Aug 2018 13:05:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dKj25AmVeyeX7jwDKFFWvEQmV7oeiXozFeZd/moXmGk=; b=NeZDCPJn1xhRRg624McpYukY08l0tfCIeSAZTaNOYLbmzKRh38hg/WTX5hfcKto3ky P8QPPPAfej6bklIcj/Gll8qgn5/1v8uIPdaweu7p+YjJt5XPhIevguki/aoDo5SnAIm9 BvoChFiyn3DIgQm2Xe5VwsHorbWwj+0ENBlwE= 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:mime-version:content-transfer-encoding; bh=dKj25AmVeyeX7jwDKFFWvEQmV7oeiXozFeZd/moXmGk=; b=lrhKZxctBlqbGqYehukc1adiHtrIQkJpoTpoPzgc+CJPNz04IOoATuF4oszr+2TcLD lRJPQBgy9LPpJ1U7vrqLcawKLzWIRrirsBcew9Qmd5aKgFpwjiBWviSBwxrmB9LWLW98 T1t84IWtA9pTAN+M7D/noUQrs51RCrbFaPTP3dwtOi27ko3kSzD+VX9joeZFoDqhJobw mA67+Usz63UPTNUly0MtsI2TSsifyxRpyQnBudhvhMhmAK/WKH7I9qz8MWHqyR7gyZSO dmTGTY4bVwxEbKZmkJkQB6hSjkGCzTsAAiANUrKKtOT5wcG7I+jsWFn1McihbF5VqwGp Ld6g== X-Gm-Message-State: AOUpUlHpIzlpyyB24NwvdsbxGVJL1qFnLVKhu+BLI5RTm61xIWIS3M6/ /aQqZlcgRICwVmiaUHfHzeK6pDp/N0M= X-Google-Smtp-Source: AAOMgpd5DqtuiPe2MuUsDSKLNzG1Jsa7gGLJg0z4zaMGkbIvZNsnG5EENYvtMGcETWPjqdfJy9njHg== X-Received: by 2002:a65:5141:: with SMTP id g1-v6mr5061018pgq.418.1533326731738; Fri, 03 Aug 2018 13:05:31 -0700 (PDT) Received: from mka.mtv.corp.google.com ([2620:15c:202:1:b6af:f85:ed6c:ac6a]) by smtp.gmail.com with ESMTPSA id u83-v6sm19944330pfj.37.2018.08.03.13.05.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Aug 2018 13:05:30 -0700 (PDT) From: Matthias Kaehlcke To: MyungJoo Ham , Kyungmin Park , Chanwoo Choi Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Brian Norris , Matthias Kaehlcke Subject: [PATCH v6 3/3] PM / devfreq: Make update_devfreq() public Date: Fri, 3 Aug 2018 13:05:11 -0700 Message-Id: <20180803200511.189664-4-mka@chromium.org> X-Mailer: git-send-email 2.18.0.597.ga71716f1ad-goog In-Reply-To: <20180803200511.189664-1-mka@chromium.org> References: <20180803200511.189664-1-mka@chromium.org> MIME-Version: 1.0 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 v6: - added 'Reviewed-by: Chanwoo Choi ' tag 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 3aae5b3af87c..e4963b0f45da 100644 --- a/include/linux/devfreq.h +++ b/include/linux/devfreq.h @@ -198,6 +198,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);