From patchwork Fri Jun 26 03:51:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 191790 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp111961ilg; Thu, 25 Jun 2020 20:52:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2Pa1q9U5YCOaDEsHXlUe+6jyniAQraKfSnW90UabZxg56v08iNxCwFKymQ1kz+OOF9AD7 X-Received: by 2002:a17:907:7290:: with SMTP id dt16mr816757ejc.63.1593143523415; Thu, 25 Jun 2020 20:52:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593143523; cv=none; d=google.com; s=arc-20160816; b=rTE5dDjUotlbrgXjo5v1jOWjWNNF+nfb4fob97WaDQY2Bb+oZQLHFxWB4tL8cohdnj KadwkQxSZSZ0Nz5jc8eeM00LbRSCwaxaBubg00v0HM/gA4ycPpMjOxA8zqzvYaPOzdCH jz4nRSFFEQ/YpE/kFwDrytN/4/AB4V4Lu2lt3Apr5VRRKNFh0JJ1bWz9OfQrQ8bkA+W4 fPkH4r1/DEhgBBPIgOgjbuaX8GjGx9r0thd7V6k56CTeSZkKK5o8DRdnG6JCpAkd/DPc tTo2ro2/dp/A1enDexrpnNL3L8rrTuMN8Wk9YeyrJk45snOYW2WbFfS0KYXIKr7td1uv GChA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=7bN1uZrTrlYe7+hbOLOxin5wT6ZnXt4+ox32w8sL7Hc=; b=H6m77Gu3qgM13ODGX/SP/FSgxB/I8OXozWCgQyY+alAuTwx5GxEKp75oane+2v7s0m uaEJGC9TNjUelB2pDPVF8q/rLBpAKpQANhiVdCo+x7r1YtgGdEsAmxEynn7DKYephWlL 8mlYOu1RAV7VZhCFJKbNpRtouRb6CizH5Ft4xccDKSNq1zhn4ccv0Y0CLRSw22jf5PKx lvNUOdG1YQ3rMDp+9lOlqVuo96sZdoOiG4CUHdooN9cqdKLVrCJ5X6m8nmqIa9n2Tyfb lM4O3vQDY2c9WkF6rR+N5CmEVXX4GYIMoUgk/2NefXSi/DRQ6TAEX8qXSJBaC7Ysbvfm p39A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FrOalOYS; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d17si4351528edu.223.2020.06.25.20.52.02; Thu, 25 Jun 2020 20:52:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FrOalOYS; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726402AbgFZDvv (ORCPT + 10 others); Thu, 25 Jun 2020 23:51:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726421AbgFZDvu (ORCPT ); Thu, 25 Jun 2020 23:51:50 -0400 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F664C08C5DC for ; Thu, 25 Jun 2020 20:51:50 -0700 (PDT) Received: by mail-pj1-x1042.google.com with SMTP id u8so4133946pje.4 for ; Thu, 25 Jun 2020 20:51:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=7bN1uZrTrlYe7+hbOLOxin5wT6ZnXt4+ox32w8sL7Hc=; b=FrOalOYSHarf0XoChv3NrRBqbQ9p5VWA6f832QKG0SInAh154BXvlKEgwC7obvI2vX 7kX+40HAcARrqUPtcQWUBdObgGt0OWnCUZyqIIZUJ6DWbTcyfQ/DfPU4U/E1uTJmdREy wFbf8x9TOckfDIqN3oUmguJLxibXTcl4NAtqH5l9OslDU4ff/kK7wJkVtbOjda30fKI9 oG6K7yY8/3KtSfDsa/Vu85lYcBAvZsBxSW75ooXamgKyFsYPsFKhgEU7eKpU7V8WlHsT 36wgUHu0VhqQccdu9tD396DLlUYUvtfvzYfQgA3NRgxQw1hJ4f2aguN7PLlX42dZrUGG ripA== 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:mime-version :content-transfer-encoding; bh=7bN1uZrTrlYe7+hbOLOxin5wT6ZnXt4+ox32w8sL7Hc=; b=prOt7UA8l2dSGynYB9fwOvlR1e7nFMhOiAK6dUVFnSQX497lvDqnJHXUtGR7kEk01N xeW+0lHFwyEpT6ycNapeN3Sd3VfUmiTVrYeWMndvmr1U+G9TU7Q8MlgGVvt6ttIOgvfh HJFKHilYicL1bXgbqXOtK+I5/Dsp5Ysir3G0/PFWHRXxByRDfx0AT04UR/EgLP4FOkcJ CZWmCpRBg1otqxbkWV1L5o9YCuqH3UJ9ai+4GLS1HavYsGkUvLxEo0ag0HWq8Wi+Nu/1 JqBnnnUcyUAx3kunqo8GGhV4KyJUa2FZPMqUFkRwijK7Ci8/JxcPRxtqzIhhYxdHiVcI mU7w== X-Gm-Message-State: AOAM531+9PmcP9w9d/h0VDRwCDoyAF5vf0Ti0SkK8FfLKGpyCI9ccJy7 zZJ32Xp4mrxqnhuXcz9VGYOjYw== X-Received: by 2002:a17:902:b78a:: with SMTP id e10mr985267pls.194.1593143509854; Thu, 25 Jun 2020 20:51:49 -0700 (PDT) Received: from localhost ([122.172.127.76]) by smtp.gmail.com with ESMTPSA id iq19sm9466929pjb.48.2020.06.25.20.51.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jun 2020 20:51:49 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Arnd Bergmann , Ben Segall , Dietmar Eggemann , Ingo Molnar , Jonathan Corbet , Juri Lelli , Mel Gorman , Peter Zijlstra , Steven Rostedt , Vincent Guittot , Viresh Kumar Cc: linux-pm@vger.kernel.org, kernel-team@android.com, tkjos@google.com, adharmap@codeaurora.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Quentin Perret Subject: [PATCH v3 0/3] cpufreq: Allow default governor on cmdline and fix locking issues Date: Fri, 26 Jun 2020 09:21:41 +0530 Message-Id: X-Mailer: git-send-email 2.25.0.rc1.19.g042ed3e048af MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Hi, I have picked Quentin's series over my patch, modified both and tested. V2->V3: - default_governor is a string now and we don't set it on governor registration or unregistration anymore. - Fixed locking issues in cpufreq_init_policy(). -- Viresh Original cover letter fro Quentin: This series enables users of prebuilt kernels (e.g. distro kernels) to specify their CPUfreq governor of choice using the kernel command line, instead of having to wait for the system to fully boot to userspace to switch using the sysfs interface. This is helpful for 2 reasons: 1. users get to choose the governor that runs during the actual boot; 2. it simplifies the userspace boot procedure a bit (one less thing to worry about). To enable this, the first patch moves all governor init calls to core_initcall, to make sure they are registered by the time the drivers probe. This should be relatively low impact as registering a governor is a simple procedure (it gets added to a llist), and all governors already load at core_initcall anyway when they're set as the default in Kconfig. This also allows to clean-up the governors' init/exit code, and reduces boilerplate. The second patch introduces the new command line parameter, inspired by its cpuidle counterpart. More details can be found in the respective patch headers. Changes in v2: - added Viresh's ack to patch 01 - moved the assignment of 'default_governor' in patch 02 to the governor registration path instead of the driver registration (Viresh) Quentin Perret (2): cpufreq: Register governors at core_initcall cpufreq: Specify default governor on command line Viresh Kumar (1): cpufreq: Fix locking issues with governors .../admin-guide/kernel-parameters.txt | 5 + Documentation/admin-guide/pm/cpufreq.rst | 6 +- .../platforms/cell/cpufreq_spudemand.c | 26 +----- drivers/cpufreq/cpufreq.c | 93 ++++++++++++------- drivers/cpufreq/cpufreq_conservative.c | 22 +---- drivers/cpufreq/cpufreq_ondemand.c | 24 ++--- drivers/cpufreq/cpufreq_performance.c | 14 +-- drivers/cpufreq/cpufreq_powersave.c | 18 +--- drivers/cpufreq/cpufreq_userspace.c | 18 +--- include/linux/cpufreq.h | 14 +++ kernel/sched/cpufreq_schedutil.c | 6 +- 11 files changed, 106 insertions(+), 140 deletions(-) -- 2.25.0.rc1.19.g042ed3e048af