From patchwork Fri Aug 16 02:24:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19175 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f72.google.com (mail-qa0-f72.google.com [209.85.216.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 254F02486D for ; Fri, 16 Aug 2013 02:26:07 +0000 (UTC) Received: by mail-qa0-f72.google.com with SMTP id o19sf505806qap.11 for ; Thu, 15 Aug 2013 19:26:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-gm-message-state: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=f38BR/M9InaOs7Ch5DqaxvnW2Pt4rUNQ+4LEbEkkkLw=; b=C7fDsUFdo8LjV7aHKUA9+HHkKNdc8VId+DuKaTw4F6z8mJGisr+7L/7QzMsooQjQ3b SbSlQAyHMgJC3/yl0hxAqSgbTs3WJwUHdzZeph8qX7TMVje7T9FT7xnK6pcHZhZcNQEO wFDKHMIMysxiaOREhdhZUNRCi8LFJfJ2FAlqlRXd1aMyjLpkinBie9cbbxSM1RWYDDqC oZ8ObHFr7HU3v+IOz445Jf1GoR7X7OkQkCTKQd0QznvqmqihLDTEY/Ph/udgjHGQInj8 A7QtUMruSZJ9cz6hAUVOzK/YiGY/MpE+bSyph9OIsBnzcY7rp9pjBIZrmcu77CUBRD9J e9cQ== X-Received: by 10.236.207.103 with SMTP id m67mr455303yho.1.1376619966901; Thu, 15 Aug 2013 19:26:06 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.49.135 with SMTP id u7ls574611qen.3.gmail; Thu, 15 Aug 2013 19:26:06 -0700 (PDT) X-Received: by 10.220.174.200 with SMTP id u8mr17302301vcz.6.1376619966744; Thu, 15 Aug 2013 19:26:06 -0700 (PDT) Received: from mail-ve0-f175.google.com (mail-ve0-f175.google.com [209.85.128.175]) by mx.google.com with ESMTPS id y4si762023vej.37.2013.08.15.19.26.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Aug 2013 19:26:06 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.175; Received: by mail-ve0-f175.google.com with SMTP id oy10so1096155veb.6 for ; Thu, 15 Aug 2013 19:26:06 -0700 (PDT) X-Gm-Message-State: ALoCoQnTJB7pQYQf/9lW9pIKi+C7+ERAKHqeOukrXVsBgsCOL+A5eZj/5v7vhAlIzahsV7qOFhe7 X-Received: by 10.58.45.70 with SMTP id k6mr17555725vem.9.1376619966662; Thu, 15 Aug 2013 19:26:06 -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 u4csp45129vcz; Thu, 15 Aug 2013 19:26:06 -0700 (PDT) X-Received: by 10.66.248.161 with SMTP id yn1mr711454pac.0.1376619965876; Thu, 15 Aug 2013 19:26:05 -0700 (PDT) Received: from mail-pd0-f172.google.com (mail-pd0-f172.google.com [209.85.192.172]) by mx.google.com with ESMTPS id vs3si67729pab.56.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Aug 2013 19:26:05 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.172 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.172; Received: by mail-pd0-f172.google.com with SMTP id z10so1595462pdj.17 for ; Thu, 15 Aug 2013 19:26:05 -0700 (PDT) X-Received: by 10.67.5.69 with SMTP id ck5mr627571pad.76.1376619965497; Thu, 15 Aug 2013 19:26:05 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id yg1sm3149246pbb.1.2013.08.15.19.26.01 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 15 Aug 2013 19:26:04 -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 02/34] cpufreq: acpi: remove calls to cpufreq_notify_transition() Date: Fri, 16 Aug 2013 07:54:59 +0530 Message-Id: <333bf5868dfbfb6de474f060dc216fa6d33848e2.1376619363.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.128.175 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. Signed-off-by: Viresh Kumar Reviewed-by: Lan Tianyu --- 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;