From patchwork Wed Jun 7 12:46:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 13270743 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 6679EC83005 for ; Wed, 7 Jun 2023 14:01:11 +0000 (UTC) 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=5fy1ideoEMR98d4wNYkiukBoQgsp32V0rzcoaK66XQ4=; b=a36OKAP64vyaYG ocXdYJECCwezI2/xb1YX97gwt2I+XpYvqp8AbaQnp/v7iuKQQbY3kqSCnxet819mvEi4o7M1i44G9 k/125m8+DCWLVZZTY5zV9ItuRr2dQ022rHLhjvHB3Z5KM1891DElVtkQIJQJykXdc2tH0E4j/PNcD gIDJjyoSDcwCho9O7IEI/ZOWN/1XVRSlWCyNoUmTFuXHsRf/TrrtWgihhLyEBdvfprFhu6cS1YwnH BMp1NeZUnYTvOxjaGTwaL/ol2opIuwmjphSHxri4dz6tlzMJ1B5gg/mT+ZSfSciWiNxvOQP3oGZqa a+ovRW2g4352QA4Oo2ww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q6tiM-006B6Q-1J; Wed, 07 Jun 2023 14:00:42 +0000 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q6sZ9-005wzc-2I for linux-arm-kernel@lists.infradead.org; Wed, 07 Jun 2023 12:47:09 +0000 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2b1badb8f9bso54841461fa.1 for ; Wed, 07 Jun 2023 05:47:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686142023; x=1688734023; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EcFIFzlxuaj95mrPekLslPaq6LF3WQagm1CvzdpttW8=; b=nHwwPnA9ljX4h2OItxC5R61hMDJGQXC4NQicB85qJzaiv/1PAEAmc+ZTqbh5R7iMIN G7Co+6il9T22wVppZZjlwyNyIyF6WuBIGpBM1EhvXchD89Z1rwJJTOb6+Fhd+EOnJ/Mw XiXg1ASLg7D+CAhIuEYdDSEfnYqHVu2Nhrg7FfaNbaJR4cUX5HFexxAsNdEEWXDczrJK x5GlxIUJZ9My4guxbqa4+WFr6KnSUwCRUGDOf0dZS+7SCJPAgguillYbg9wAqhJOUpJP ppm4t8fO1Wkkj/BLBzLf88LMENST/kfA/Mz5yhEOe2SQlZave+e+2ODJJgx9WPaqSFaR YWqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686142023; x=1688734023; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EcFIFzlxuaj95mrPekLslPaq6LF3WQagm1CvzdpttW8=; b=RaORKIBFwk8FVQT3yL67ztOeNvbNBMp0JG8LyDeOChx3kHbiUaoIq+2uemTJ9VP0QO 5A9nvvIsqj81aYZrUMV48ZTmZLB8josbnPtpUm80/mRKGofih+W1DaC8RhCqIFHyvP0S LXFvGmJ7JyQVj1Umg1TYcEYHL+0f1NdcvsFK6I/pR5rWLv1No+ayQSPb9XK/e4C8s/iz MLt/PXyBHfrWamJFGeqG4j6uWQgf2geNFDRwXT4aHmua4/2gdvY/Z8CbhJLD7Pg5Gmkr 8y7m1O8olGmVjuafuuhc8gUQSiAJxrWOyhcGfuTbMbsmaI8wCu4eFiwrtwx07YYLydmn nXYg== X-Gm-Message-State: AC+VfDwL3GShejuv6Y7JFxPxvQ4ixQ3QgH8/6wAI48qLGNXguFR9h3uU Y66EppepDfmZ0qVasFTnwiZafQ== X-Google-Smtp-Source: ACHHUZ7MfrKrmho6SvmAbt/n1doRuY4rUhqfbuKmIzQhUWTjjDOL4+dQPQ+ue8e0r5O4Q+P3ADMvkQ== X-Received: by 2002:a2e:3515:0:b0:2af:1844:6fdb with SMTP id z21-20020a2e3515000000b002af18446fdbmr2148166ljz.5.1686142023625; Wed, 07 Jun 2023 05:47:03 -0700 (PDT) Received: from uffe-tuxpro14.. (h-94-254-63-18.NA.cust.bahnhof.se. [94.254.63.18]) by smtp.gmail.com with ESMTPSA id z7-20020a19f707000000b004f4b3e9e0cesm1781708lfe.297.2023.06.07.05.47.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 05:47:03 -0700 (PDT) From: Ulf Hansson To: Sudeep Holla , Cristian Marussi , Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: Nikunj Kela , Prasad Sodagudi , Alexandre Torgue , Ulf Hansson , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 07/16] cpufreq: scmi: Avoid one OF parsing in scmi_get_sharing_cpus() Date: Wed, 7 Jun 2023 14:46:19 +0200 Message-Id: <20230607124628.157465-8-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230607124628.157465-1-ulf.hansson@linaro.org> References: <20230607124628.157465-1-ulf.hansson@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230607_054707_775190_6250C6D1 X-CRM114-Status: GOOD ( 12.64 ) 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 The domain-id for the cpu_dev has already been parsed at the point when scmi_get_sharing_cpus() is getting called. Let's pass it as an in-parameter to avoid the unnecessary OF parsing. Signed-off-by: Ulf Hansson --- drivers/cpufreq/scmi-cpufreq.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c index 125e8a8421fb..78f53e388094 100644 --- a/drivers/cpufreq/scmi-cpufreq.c +++ b/drivers/cpufreq/scmi-cpufreq.c @@ -82,15 +82,12 @@ static int scmi_cpu_domain_id(struct device *cpu_dev) } static int -scmi_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask) +scmi_get_sharing_cpus(struct device *cpu_dev, int domain, + struct cpumask *cpumask) { - int cpu, domain, tdomain; + int cpu, tdomain; struct device *tcpu_dev; - domain = scmi_cpu_domain_id(cpu_dev); - if (domain < 0) - return domain; - for_each_possible_cpu(cpu) { if (cpu == cpu_dev->id) continue; @@ -163,7 +160,7 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy) } /* Obtain CPUs that share SCMI performance controls */ - ret = scmi_get_sharing_cpus(cpu_dev, policy->cpus); + ret = scmi_get_sharing_cpus(cpu_dev, domain, policy->cpus); if (ret) { dev_warn(cpu_dev, "failed to get sharing cpumask\n"); goto out_free_cpumask;