From patchwork Fri Sep 13 13:02:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20254 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1329020358 for ; Fri, 13 Sep 2013 13:26:52 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id gd11sf1210624vcb.8 for ; Fri, 13 Sep 2013 06:26:51 -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=GA8f/PNVQT8WCWWn/ZEhwqQDkWym9ONijnfYAtzvcPk=; b=TBHZ9112lJvA5i5PRdUyB2iSHL7pLxpKaS0hZY3O0t0lUaJv1NLlctgcYgPKmexJZw 5W9Mo1oO37D28g1Kie9hkOXqa6zXr0L7MtU7qgT+XRRj7UhcbAkZYDWpcPqHEIrC95ND qUkNLeiL2bsz2Mn9o3VD4EQP3TQ87DYGpkoeULGbKi3iCdLmKX9TcuhRMhllkUWwW/Fz VKBBvUOAkrnA1uEd97VCu41t701jendDcdBFg699ci4KtDcxHwKKrLY7vX95WquUjZxK 0sEbT6GqCBephxGZ+XbtWzkssfFVX4N3jVrSmqPazqV/dV6ebYdlK/tO9ADTFkSKB1Au D1Rw== X-Gm-Message-State: ALoCoQkIR2Kf3FUloNceXsi7gVRSSFhB6YLV5EtwGJlyLZRT932Xh+gKp6F+z5zVJi/o/N3/QQ9x X-Received: by 10.236.110.168 with SMTP id u28mr4999422yhg.40.1379078811826; Fri, 13 Sep 2013 06:26:51 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.95.138 with SMTP id dk10ls1104873qeb.23.gmail; Fri, 13 Sep 2013 06:26:51 -0700 (PDT) X-Received: by 10.52.173.165 with SMTP id bl5mr10444523vdc.18.1379078811589; Fri, 13 Sep 2013 06:26:51 -0700 (PDT) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id sn2si3126110vec.64.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:26:51 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.176 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.176; Received: by mail-ve0-f176.google.com with SMTP id jx11so945772veb.21 for ; Fri, 13 Sep 2013 06:26:51 -0700 (PDT) X-Received: by 10.58.197.5 with SMTP id iq5mr407928vec.30.1379078811440; Fri, 13 Sep 2013 06:26:51 -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 u4csp80683vcz; Fri, 13 Sep 2013 06:26:50 -0700 (PDT) X-Received: by 10.66.188.203 with SMTP id gc11mr15051978pac.63.1379078810471; Fri, 13 Sep 2013 06:26:50 -0700 (PDT) Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by mx.google.com with ESMTPS id gb4si7467123pbb.180.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:26:50 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.46 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.46; Received: by mail-pa0-f46.google.com with SMTP id fa1so2535760pad.33 for ; Fri, 13 Sep 2013 06:26:50 -0700 (PDT) X-Received: by 10.68.164.131 with SMTP id yq3mr13544425pbb.55.1379078810048; Fri, 13 Sep 2013 06:26:50 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id tz3sm11770915pbc.20.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:26:49 -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 200/228] cpufreq: pasemi: remove calls to cpufreq_notify_transition() Date: Fri, 13 Sep 2013 18:32:26 +0530 Message-Id: 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.176 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 --- drivers/cpufreq/pasemi-cpufreq.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/cpufreq/pasemi-cpufreq.c b/drivers/cpufreq/pasemi-cpufreq.c index 17424dd..1c33136 100644 --- a/drivers/cpufreq/pasemi-cpufreq.c +++ b/drivers/cpufreq/pasemi-cpufreq.c @@ -51,8 +51,6 @@ static void __iomem *sdcpwr_mapbase; static void __iomem *sdcasr_mapbase; -static DEFINE_MUTEX(pas_switch_mutex); - /* Current astate, is used when waking up from power savings on * one core, in case the other core has switched states during * the idle time. @@ -242,15 +240,8 @@ static int pas_cpufreq_cpu_exit(struct cpufreq_policy *policy) static int pas_cpufreq_target(struct cpufreq_policy *policy, unsigned int pas_astate_new) { - struct cpufreq_freqs freqs; int i; - freqs.old = policy->cur; - freqs.new = pas_freqs[pas_astate_new].frequency; - - mutex_lock(&pas_switch_mutex); - cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); - pr_debug("setting frequency for cpu %d to %d kHz, 1/%d of max frequency\n", policy->cpu, pas_freqs[pas_astate_new].frequency, @@ -261,10 +252,7 @@ static int pas_cpufreq_target(struct cpufreq_policy *policy, for_each_online_cpu(i) set_astate(i, pas_astate_new); - cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); - mutex_unlock(&pas_switch_mutex); - - ppc_proc_freq = freqs.new * 1000ul; + ppc_proc_freq = pas_freqs[pas_astate_new].frequency * 1000ul; return 0; }