From patchwork Tue Aug 10 07:36:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 12428141 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=-17.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 69CF7C4338F for ; Tue, 10 Aug 2021 07:39:37 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 12E4160F13 for ; Tue, 10 Aug 2021 07:39:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 12E4160F13 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=xJTKW0PfadlFamg5zv1+/DE0qX+t3T5oU+CFnP5pRrU=; b=KzESn4FrULb78a zetDf42P0Ltss41u2zirchSMm7GqTa/lIkmpRwvHSbT/GTbHDfXVW326vgqyX4HPCooSOP50BZ/4w pftMXyx5WqGWuEPPE5rYXhHEnrlfyV73J41J8ZZkRScDZo7Z8YETV2IuAOTdbKLgrDAsRj69epy17 NxK/GeBkFa7BJR1oPyL0HSnvId/yNr633e9aEqsfWwT7rYVrv3N6jmYQ/hbu4YKIcdZx7B3U5n0G8 eEckf6lgFOJaf1yTScPT+aiGPT+PySEtNXC5mZMJ5iAP5r/t8ryLBAAYTIqvwc3O/E9tx0LrluXWF zCnRaHe5A73wvNj9qVxg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDMJz-002kmw-Af; Tue, 10 Aug 2021 07:37:11 +0000 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDMJt-002klO-1r for linux-arm-kernel@lists.infradead.org; Tue, 10 Aug 2021 07:37:09 +0000 Received: by mail-pj1-x102c.google.com with SMTP id hv22-20020a17090ae416b0290178c579e424so4041955pjb.3 for ; Tue, 10 Aug 2021 00:37:04 -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=Gp9yqcscf7/Q8S71rNb+DklCmCjBfuOZWtoJrdKgq14=; b=IAglVf6Pn8I8I9dsDbHjIfeAkSA/yD6E0MfLksr0I3bbp7rSOQLo46sTKTKHyl9KbR 1/Ax/Ap4XrXSvqSfj4UKWMsMiK2Qlt+w+AwybJt6Afct7yPg8QghYKttCJvCY/xqXvkm SkVBZJ83g65LBxLJZxqL82lCxNFSOhBzmTWP+VjWSx6JwYTMIlwFMEqzKCpRoO2ZHeMy iLi9J2g4OA/gouk7AIivwb3wNG0F55BWN3FaLUULACXKVzJzbp8T6EZqU2AN3WsvBWuT 6xKHRzNBm8HKbeykYID8qlR3XXsS6uZSkgeIJMMAyf3R73Ni3U2SsNf7QyhEebDAbH1k 0nNA== 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=Gp9yqcscf7/Q8S71rNb+DklCmCjBfuOZWtoJrdKgq14=; b=lAtc2CfpMyblc7wXcwsudt6jrPfYN0CFISYmjN0BCcs+mZzz65GEKD+eHfi9qtoLIw Or/t56l8XkeeWn/+Kg8+RWM55cBmoJ0dRZWm3XYRI/SK55Xla6tLpu/nLUekOBcR/BHx I6Znn+CNBUvdQmL5JHXs97Jpp4GyFHUSuZ28QYAU8E73PEIAWJzArzKLae/cjuKUYJCr b4Beu52EvcpBYLwSZuqP8Bnd4v6TTgxb68dcD2eAkxrXPO2H9/oZ+0WtJXP2wU/g+tf8 6TzlqArfh8e8hWtsAXVPQArWB+cVcO/JAoUf/iUvYfHJ7Kxl4Krmpi3EUXLHApor+coX JIEA== X-Gm-Message-State: AOAM533YI6fBZoioHNHImtislh0CepR9ySFztZHb3O1OMtkNvda5u+uk 3U1oYFWsgoO2fqOcgaQ2xCKFdA== X-Google-Smtp-Source: ABdhPJxILYrr525KX9FnT9P3v0D4xd0mT7Xu47cl+ZsvaVSJ3lXE+EgGIYbCSv1kqvc+zewvjPYhrA== X-Received: by 2002:a17:902:b601:b029:12b:d9a:894f with SMTP id b1-20020a170902b601b029012b0d9a894fmr350019pls.63.1628581023914; Tue, 10 Aug 2021 00:37:03 -0700 (PDT) Received: from localhost ([122.172.201.85]) by smtp.gmail.com with ESMTPSA id v14sm1734591pjd.35.2021.08.10.00.37.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 00:37:03 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Vincent Donnefort , lukasz.luba@arm.com, Andy Gross , Bjorn Andersson , Cristian Marussi , Fabio Estevam , Kevin Hilman , Matthias Brugger , NXP Linux Team , Pengutronix Kernel Team , Sascha Hauer , Shawn Guo , Sudeep Holla , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-omap@vger.kernel.org Subject: [PATCH 0/8] cpufreq: Auto-register with energy model Date: Tue, 10 Aug 2021 13:06:47 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210810_003705_172007_A81530C8 X-CRM114-Status: GOOD ( 12.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Provide a cpufreq driver flag so drivers can ask the cpufreq core to register with the EM core on their behalf. This allows us to get rid of duplicated code in the drivers and fix the unregistration part as well, which none of the drivers have done until now. This would also make the registration with EM core to happen only after policy is fully initialized, and the EM core can do other stuff from in there, like marking frequencies as inefficient (WIP). Though this patchset is useful without that work being done and should be merged nevertheless. This doesn't update scmi cpufreq driver for now as it is a special case and need to be handled differently. Though we can make it work with this if required. This is build/boot tested by the bot for a couple of boards. https://gitlab.com/vireshk/pmko/-/pipelines/350674298 --- Viresh Viresh Kumar (8): cpufreq: Auto-register with energy model if asked cpufreq: dt: Use auto-registration for energy model cpufreq: imx6q: Use auto-registration for energy model cpufreq: mediatek: Use auto-registration for energy model cpufreq: omap: Use auto-registration for energy model cpufreq: qcom-cpufreq-hw: Use auto-registration for energy model cpufreq: scpi: Use auto-registration for energy model cpufreq: vexpress: Use auto-registration for energy model drivers/cpufreq/cpufreq-dt.c | 5 ++--- drivers/cpufreq/cpufreq.c | 9 +++++++++ drivers/cpufreq/imx6q-cpufreq.c | 4 ++-- drivers/cpufreq/mediatek-cpufreq.c | 5 ++--- drivers/cpufreq/omap-cpufreq.c | 4 ++-- drivers/cpufreq/qcom-cpufreq-hw.c | 5 ++--- drivers/cpufreq/scpi-cpufreq.c | 5 ++--- drivers/cpufreq/vexpress-spc-cpufreq.c | 5 ++--- include/linux/cpufreq.h | 6 ++++++ 9 files changed, 29 insertions(+), 19 deletions(-)