From patchwork Wed Jul 13 20:25:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Muckle X-Patchwork-Id: 71973 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1185743qga; Wed, 13 Jul 2016 13:26:30 -0700 (PDT) X-Received: by 10.98.22.212 with SMTP id 203mr1389521pfw.74.1468441590819; Wed, 13 Jul 2016 13:26:30 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 15si161025pfv.78.2016.07.13.13.26.30; Wed, 13 Jul 2016 13:26:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751197AbcGMUZ7 (ORCPT + 14 others); Wed, 13 Jul 2016 16:25:59 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:36791 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750996AbcGMUZq (ORCPT ); Wed, 13 Jul 2016 16:25:46 -0400 Received: by mail-pa0-f54.google.com with SMTP id pp5so14118334pac.3 for ; Wed, 13 Jul 2016 13:25:45 -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; bh=nxoIZK1JefwKM+sUSmTca1Frt4W1j0EEG6sh5Mv3Lyw=; b=XYholtBtV4c9m/1+/4dCWy81nPZyj9QZaL54I8RtPziwV3EZnqOTqfYoFo1i/O2cL2 VnISPLt58cjOZXOIz41cq2iwxSZ9q5MfN7RMfJlkwCtneyw630k9su8Hqnw5walvfhm7 mOL0vZqqIqRAonHL0nL59atdOzgdJBkdfM7RI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=nxoIZK1JefwKM+sUSmTca1Frt4W1j0EEG6sh5Mv3Lyw=; b=UCXq+M0blB9IoAMQsENtCKGPE9r5VDv0Ck5RLRE3bylE7HoVkJupy+AUy469ekZOhW /+5pn4R3ibFpqJa+lIyklQbcjCeZF8d7QrlcVfHofbnO9wVk57Gcv0qh+NE4Z+pblgoC yjNJnDhqJc12ij5Mx+aixuKZqMHP/K+rdGmPRZ6s+X50uawkOnSMM2DMo5U0g8+fOJRb QJ2zHzd4WGtsO0CRCr4+7salfrLNNXeEbw+pZ+Jybu9XiT/EpCLDfAT/k55qCiUtsm/5 ezN3kCd0uwZIbZ4tCG0SJV7zKF14/MwbkZGi2qrcKY1Kn8cx/hMbSkQ3SPNvPJ+chqt2 h+bQ== X-Gm-Message-State: ALyK8tJGlTTpqx/Fj7qta466csKrsSLVchyyNPd9ENps2pc0Lr13GtsHKMyV+Z+Y5CgPbo4R X-Received: by 10.66.144.229 with SMTP id sp5mr16552892pab.97.1468441545101; Wed, 13 Jul 2016 13:25:45 -0700 (PDT) Received: from graphite.smuckle.net (cpe-76-167-105-107.san.res.rr.com. [76.167.105.107]) by smtp.gmail.com with ESMTPSA id o80sm115466pfa.67.2016.07.13.13.25.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 Jul 2016 13:25:44 -0700 (PDT) From: Steve Muckle X-Google-Original-From: Steve Muckle To: Peter Zijlstra , Ingo Molnar , "Rafael J . Wysocki" , Viresh Kumar Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Vincent Guittot , Morten Rasmussen , Dietmar Eggemann , Juri Lelli , Patrick Bellasi , Steve Muckle Subject: [PATCH v3 3/3] cpufreq: acpi-cpufreq: use cached frequency mapping when possible Date: Wed, 13 Jul 2016 13:25:27 -0700 Message-Id: <1468441527-23534-4-git-send-email-smuckle@linaro.org> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1468441527-23534-1-git-send-email-smuckle@linaro.org> References: <1468441527-23534-1-git-send-email-smuckle@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org A call to cpufreq_driver_resolve_freq will cache the mapping from the desired target frequency to the frequency table index. If there is a mapping for the desired target frequency then use it instead of looking up the mapping again. Signed-off-by: Steve Muckle --- drivers/cpufreq/acpi-cpufreq.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.7.3 -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c index 11c9a078e0fd..297e9128fe9f 100644 --- a/drivers/cpufreq/acpi-cpufreq.c +++ b/drivers/cpufreq/acpi-cpufreq.c @@ -473,7 +473,10 @@ unsigned int acpi_cpufreq_fast_switch(struct cpufreq_policy *policy, /* * Find the closest frequency above target_freq. */ - index = cpufreq_table_find_index_dl(policy, target_freq); + if (policy->cached_target_freq == target_freq) + index = policy->cached_resolved_idx; + else + index = cpufreq_table_find_index_dl(policy, target_freq); entry = &policy->freq_table[index]; next_freq = entry->frequency;