From patchwork Tue Aug 10 07:36:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 12428149 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_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,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 B70C6C4320A for ; Tue, 10 Aug 2021 07:40:17 +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 7CD3260F13 for ; Tue, 10 Aug 2021 07:40:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7CD3260F13 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:References:In-Reply-To: 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: List-Owner; bh=UiWfbtkR+xtudnNxvk8+AIozow1Twv1MjJ+xv7v4Cjc=; b=g5qnHAXRijb0PO Dm/stZ4nktARjwPyQwRPtI2X9g139qDC0aInZQ1k1PUqTjvLK2+P30WN1gJzwNAaOVwGa15/whfli 9jS1ZfoWciOw55K7591yTpzFm+lmiLBGZEBLidtkz3OllXKE2KeMVj1QNm2a5OwJgEC1bZVLAl01a sGbWFT8S+abVDyN7r1+MSrPv4zfEqdqQ20yN9ykLJQnOAhPPYD4Eb/kynRRCXEnW/CuHmwLGqgWJQ l9qjmgRdCQP9reWuidyiuGpyi/5SRzOqZC44+J00MzvJkYWZQnFiN+9YveXJ/rIy34G8gE92VQGjp gtTjuhc0GsSpxY4AYwfg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDMKc-002kyh-6Q; Tue, 10 Aug 2021 07:37:50 +0000 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDMKH-002krN-Oj for linux-arm-kernel@lists.infradead.org; Tue, 10 Aug 2021 07:37:33 +0000 Received: by mail-pj1-x102a.google.com with SMTP id t7-20020a17090a5d87b029017807007f23so3060887pji.5 for ; Tue, 10 Aug 2021 00:37:29 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZfMkvAhG2Hs471btmo38FaMbm1HPcKJf+JsWbgzrWXE=; b=RAtnkgZsWRTD84WtL3JO7CI+pzY0OF/z53Kk7V0xgxfFx13n058ztE9BwxTIrkzGBp kPjaJwZtNjaez286r1aOCJlCckLdIT/Xabvn8IQzeoKtTPCVuKCk5XKT1HV4oAWn3giR f+5fyJ8sMJBf6chcUCNJVNFwRbchgZxHFQ4qzf+mAzal54DwBZAEz2M5BQuBztC4GD0N quQR6pB0kLmNWtPytvbOrNw5irDf0j1DEyTg/wt9eI9YM4aGd5c56yJJjNr1grv0gWdz ZbwBYHG5HcgDDDsZbsQoNLCHKnyKKB+AaVjwDrBw/B/r/Iz9jomLVUrqWg3E8AM08X08 jy7g== 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=ZfMkvAhG2Hs471btmo38FaMbm1HPcKJf+JsWbgzrWXE=; b=NroOxDDUg5RElET7TE5mGAYXtEh85cP9mRkvsTj4T4gCrDhDxFCaneHdU+IrBN/0xX 3HUKu0shT3+JrLkDn90gXYN5NKznA+L4VrTu4N9pdRm93E920DInD/aIe1h6hem5yXtU oqv9omUyQ0GWxCeYKnPdfWxdT6ukDpmlIiTEon++tB4HydJNR3zLsCdPgwHgb7tz9Cu2 nYtDVe3ZtiFB86VU1OSj+H2gighBP1YHxBQhOqvv74O8Eno1wqz0Yk91whA5sB/aLHoT d7yEp6SP0ugsYULHq+k8KvwEvrSykdfOfnt167U34mCfaHpN33sgJa5O2x2cpUbNjQnj E2Sg== X-Gm-Message-State: AOAM530H7HEBujMXi2Qf6SkjsJEV2mrKhfbeaqWM4TGV+nbdA4F/J0vP rZubcnVsl2ajYY2sEkrsXWFi6Q== X-Google-Smtp-Source: ABdhPJwDXChLrfWBdNBlI/8ZER3OYqAXLoVn2KcaGlOns4uBsu5glJ9xoiEM+lXiZG49fKCbUakbRQ== X-Received: by 2002:a17:902:f541:b029:12d:27cb:832e with SMTP id h1-20020a170902f541b029012d27cb832emr6159878plf.22.1628581048705; Tue, 10 Aug 2021 00:37:28 -0700 (PDT) Received: from localhost ([122.172.201.85]) by smtp.gmail.com with ESMTPSA id j23sm1918452pjn.12.2021.08.10.00.37.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 00:37:28 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Vincent Donnefort , lukasz.luba@arm.com, Sudeep Holla , Cristian Marussi , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 7/8] cpufreq: scpi: Use auto-registration for energy model Date: Tue, 10 Aug 2021 13:06:54 +0530 Message-Id: <7809d747fecbaad46699a178f26288a015055b20.1628579170.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210810_003729_845502_986B510F X-CRM114-Status: GOOD ( 14.13 ) 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 Use the CPUFREQ_REGISTER_WITH_EM flag to allow cpufreq core to automatically register with the energy model. This allows removal of boiler plate code from the driver and fixes the unregistration part as well. Signed-off-by: Viresh Kumar Reviewed-by: Lukasz Luba Acked-by: Sudeep Holla --- drivers/cpufreq/scpi-cpufreq.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/cpufreq/scpi-cpufreq.c b/drivers/cpufreq/scpi-cpufreq.c index d6a698a1b5d1..bc8c62b1beb5 100644 --- a/drivers/cpufreq/scpi-cpufreq.c +++ b/drivers/cpufreq/scpi-cpufreq.c @@ -163,8 +163,6 @@ static int scpi_cpufreq_init(struct cpufreq_policy *policy) policy->fast_switch_possible = false; - dev_pm_opp_of_register_em(cpu_dev, policy->cpus); - return 0; out_free_cpufreq_table: @@ -193,7 +191,8 @@ static struct cpufreq_driver scpi_cpufreq_driver = { .name = "scpi-cpufreq", .flags = CPUFREQ_HAVE_GOVERNOR_PER_POLICY | CPUFREQ_NEED_INITIAL_FREQ_CHECK | - CPUFREQ_IS_COOLING_DEV, + CPUFREQ_IS_COOLING_DEV | + CPUFREQ_REGISTER_WITH_EM, .verify = cpufreq_generic_frequency_table_verify, .attr = cpufreq_generic_attr, .get = scpi_cpufreq_get_rate,