From patchwork Fri Sep 13 13:02:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20236 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f71.google.com (mail-qe0-f71.google.com [209.85.128.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B631720358 for ; Fri, 13 Sep 2013 13:24:42 +0000 (UTC) Received: by mail-qe0-f71.google.com with SMTP id a11sf1229001qen.10 for ; Fri, 13 Sep 2013 06:24:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=teElxpolKcI6lkSeO694E8JVTU+TVF+13BzAms7PG7M=; b=XiV0F4vZsq/xdBql05VbKoKCzzsIK7eo2eazm49KYjgi+q448x2Q4Xtn7s0yJXl/p4 u0+4vwjbEonMtXEhcPNgAVhopYUT99NK1Gb1jEaG6kKBrVCiJnjv2Y4ZheVYMWbCllz8 TP8Vk+Xg536844nIkDsnQKLsaMui5pUAjFAEAJbqzDcwgRdivUDJ0L+Aifu6o7CjkALD JT+dJVEGihLRa2VmGxopFCGYn200E65jmTP0WsX+IyOK+itWJ3z8CtM+py/HyagxtPwS d6VLdEHmpAIR0hCN2NHStDoZj9FlGVLYIN8naWd9B/4MBR3M3z4TZbdWxG6ABIR5mGov k/ag== X-Gm-Message-State: ALoCoQk/ed7kP1mFDjYXDzhzKmzcl4DdJ0xb9jY5kncC4x1W8UUVuFTo0l1w9gNxIFpThGHaq/fv X-Received: by 10.236.73.164 with SMTP id v24mr4866025yhd.24.1379078682481; Fri, 13 Sep 2013 06:24:42 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.38.130 with SMTP id g2ls1152422qek.99.gmail; Fri, 13 Sep 2013 06:24:42 -0700 (PDT) X-Received: by 10.221.32.133 with SMTP id sk5mr1133039vcb.27.1379078682261; Fri, 13 Sep 2013 06:24:42 -0700 (PDT) Received: from mail-vb0-f52.google.com (mail-vb0-f52.google.com [209.85.212.52]) by mx.google.com with ESMTPS id tm8si3097338vdc.150.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:24:42 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.52 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.52; Received: by mail-vb0-f52.google.com with SMTP id f12so876389vbg.25 for ; Fri, 13 Sep 2013 06:24:42 -0700 (PDT) X-Received: by 10.58.28.147 with SMTP id b19mr1120659veh.27.1379078682165; Fri, 13 Sep 2013 06:24:42 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp80577vcz; Fri, 13 Sep 2013 06:24:41 -0700 (PDT) X-Received: by 10.66.25.102 with SMTP id b6mr14682529pag.129.1379078681140; Fri, 13 Sep 2013 06:24:41 -0700 (PDT) Received: from mail-pa0-f51.google.com (mail-pa0-f51.google.com [209.85.220.51]) by mx.google.com with ESMTPS id xx2si11266513pac.53.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:24:41 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.51 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.51; Received: by mail-pa0-f51.google.com with SMTP id lf1so2546125pab.10 for ; Fri, 13 Sep 2013 06:24:40 -0700 (PDT) X-Received: by 10.68.189.70 with SMTP id gg6mr13460494pbc.123.1379078680736; Fri, 13 Sep 2013 06:24:40 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id qp10sm18090103pab.13.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:24:40 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Viresh Kumar Subject: [PATCH 182/228] cpufreq: acpi: remove calls to cpufreq_notify_transition() Date: Fri, 13 Sep 2013 18:32:08 +0530 Message-Id: <14622306cc87b9a0819318b9a4a51cf9da15b6fd.1379063063.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.52 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Most of the drivers do following in their ->target_index() routines: struct cpufreq_freqs freqs; freqs.old = old freq... freqs.new = new freq... cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); /* Change rate here */ cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); This is replicated over all cpufreq drivers today and there doesn't exists a good enough reason why this shouldn't be moved to cpufreq core instead. Earlier patches have added support in cpufreq core to do cpufreq notification on frequency change, this one removes it from this driver. Some related minor cleanups are also done along with it. Reviewed-by: Lan Tianyu Signed-off-by: Viresh Kumar --- drivers/cpufreq/acpi-cpufreq.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c index 7536e7d..6b00cd8 100644 --- a/drivers/cpufreq/acpi-cpufreq.c +++ b/drivers/cpufreq/acpi-cpufreq.c @@ -428,14 +428,10 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy, { struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu); struct acpi_processor_performance *perf; - struct cpufreq_freqs freqs; struct drv_cmd cmd; unsigned int next_perf_state = 0; /* Index into perf table */ int result = 0; - pr_debug("acpi_cpufreq_target %d (%d)\n", - data->freq_table[index].frequency, policy->cpu); - if (unlikely(data == NULL || data->acpi_data == NULL || data->freq_table == NULL)) { return -ENODEV; @@ -483,23 +479,17 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy, else cmd.mask = cpumask_of(policy->cpu); - freqs.old = perf->states[perf->state].core_frequency * 1000; - freqs.new = data->freq_table[index].frequency; - cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); - drv_write(&cmd); if (acpi_pstate_strict) { - if (!check_freqs(cmd.mask, freqs.new, data)) { + if (!check_freqs(cmd.mask, data->freq_table[index].frequency, + data)) { pr_debug("acpi_cpufreq_target failed (%d)\n", policy->cpu); result = -EAGAIN; - freqs.new = freqs.old; } } - cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); - if (!result) perf->state = next_perf_state;