From patchwork Fri Aug 16 02:25:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19189 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 9C11C2486D for ; Fri, 16 Aug 2013 02:27:51 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id ha11sf1794113vcb.0 for ; Thu, 15 Aug 2013 19:27:51 -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=Moh7l5gRRZjxNK+auHaagpy8zYIHUPba33raSNKOkU8=; b=fB7kZ8FcVsDxmRIjt7/klqCf/jXC4b/ACVzyA5l80IjHRI5jyuCOJt6d7hUKs7Sauy 0lOJyO49D9SsWQfcxdvqe8ZwkDLwM/UO5/C/vq2ywgtoKyK3HQvVijVelwIDagByf6+B ZdoXg2ApRaUwIN39QikSneBcPj2ICjXefUu/7h0EpLWXQcL3La1PFOV9zYqtMK4W/1QS w0q8ur5lTSiduDRftHLEp4Q8qgt8uoo6RBurMTLLmBocqJSqQBDIGmVmy5R8YC8h+GPE NBAV3oJy+iyv1Dle2b1qmo0Em9au2jujIRmZpTfeL+0bxASc4AHPaJmGfCwEMZqAZsoQ dNVw== X-Received: by 10.236.68.193 with SMTP id l41mr367788yhd.19.1376620071333; Thu, 15 Aug 2013 19:27:51 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.30.35 with SMTP id p3ls597603qeh.97.gmail; Thu, 15 Aug 2013 19:27:51 -0700 (PDT) X-Received: by 10.52.165.45 with SMTP id yv13mr12613679vdb.1.1376620071111; Thu, 15 Aug 2013 19:27:51 -0700 (PDT) Received: from mail-vb0-f46.google.com (mail-vb0-f46.google.com [209.85.212.46]) by mx.google.com with ESMTPS id t9si694705vcz.72.2013.08.15.19.27.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Aug 2013 19:27:51 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.46 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.46; Received: by mail-vb0-f46.google.com with SMTP id p13so1218222vbe.19 for ; Thu, 15 Aug 2013 19:27:51 -0700 (PDT) X-Gm-Message-State: ALoCoQkYn6qo0UAqcMvooQVqv6Y71AChsa35VGpOuqQ97Boz5CXpS6IRIi8TU1be0DLB8didjh68 X-Received: by 10.220.164.70 with SMTP id d6mr17024164vcy.19.1376620071024; Thu, 15 Aug 2013 19:27: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 u4csp45201vcz; Thu, 15 Aug 2013 19:27:50 -0700 (PDT) X-Received: by 10.66.216.129 with SMTP id oq1mr635977pac.75.1376620070138; Thu, 15 Aug 2013 19:27:50 -0700 (PDT) Received: from mail-pb0-f53.google.com (mail-pb0-f53.google.com [209.85.160.53]) by mx.google.com with ESMTPS id xx2si78347pac.24.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Aug 2013 19:27:50 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.53 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.53; Received: by mail-pb0-f53.google.com with SMTP id up15so1478065pbc.12 for ; Thu, 15 Aug 2013 19:27:49 -0700 (PDT) X-Received: by 10.68.254.73 with SMTP id ag9mr18566081pbd.54.1376620069731; Thu, 15 Aug 2013 19:27:49 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id e7sm2826780pbc.11.2013.08.15.19.27.45 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 15 Aug 2013 19:27: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 , Andrew Lunn Subject: [PATCH 16/34] cpufreq: kirkwood: remove calls to cpufreq_notify_transition() Date: Fri, 16 Aug 2013 07:55:13 +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.212.46 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. Cc: Andrew Lunn Signed-off-by: Viresh Kumar --- drivers/cpufreq/kirkwood-cpufreq.c | 54 ++++++++++++++------------------------ 1 file changed, 20 insertions(+), 34 deletions(-) diff --git a/drivers/cpufreq/kirkwood-cpufreq.c b/drivers/cpufreq/kirkwood-cpufreq.c index c3d6987..fcf461e 100644 --- a/drivers/cpufreq/kirkwood-cpufreq.c +++ b/drivers/cpufreq/kirkwood-cpufreq.c @@ -58,48 +58,34 @@ static unsigned int kirkwood_cpufreq_get_cpu_frequency(unsigned int cpu) static int kirkwood_cpufreq_target(struct cpufreq_policy *policy, unsigned int index) { - struct cpufreq_freqs freqs; unsigned int state = kirkwood_freq_table[index].driver_data; unsigned long reg; - freqs.old = kirkwood_cpufreq_get_cpu_frequency(0); - freqs.new = kirkwood_freq_table[index].frequency; + local_irq_disable(); - cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); + /* Disable interrupts to the CPU */ + reg = readl_relaxed(priv.base); + reg |= CPU_SW_INT_BLK; + writel_relaxed(reg, priv.base); - dev_dbg(priv.dev, "Attempting to set frequency to %i KHz\n", - kirkwood_freq_table[index].frequency); - dev_dbg(priv.dev, "old frequency was %i KHz\n", - kirkwood_cpufreq_get_cpu_frequency(0)); - - if (freqs.old != freqs.new) { - local_irq_disable(); - - /* Disable interrupts to the CPU */ - reg = readl_relaxed(priv.base); - reg |= CPU_SW_INT_BLK; - writel_relaxed(reg, priv.base); - - switch (state) { - case STATE_CPU_FREQ: - clk_disable(priv.powersave_clk); - break; - case STATE_DDR_FREQ: - clk_enable(priv.powersave_clk); - break; - } + switch (state) { + case STATE_CPU_FREQ: + clk_disable(priv.powersave_clk); + break; + case STATE_DDR_FREQ: + clk_enable(priv.powersave_clk); + break; + } - /* Wait-for-Interrupt, while the hardware changes frequency */ - cpu_do_idle(); + /* Wait-for-Interrupt, while the hardware changes frequency */ + cpu_do_idle(); - /* Enable interrupts to the CPU */ - reg = readl_relaxed(priv.base); - reg &= ~CPU_SW_INT_BLK; - writel_relaxed(reg, priv.base); + /* Enable interrupts to the CPU */ + reg = readl_relaxed(priv.base); + reg &= ~CPU_SW_INT_BLK; + writel_relaxed(reg, priv.base); - local_irq_enable(); - } - cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); + local_irq_enable(); return 0; }