From patchwork Fri Sep 13 13:02:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20249 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f199.google.com (mail-ve0-f199.google.com [209.85.128.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 456FF20358 for ; Fri, 13 Sep 2013 13:26:15 +0000 (UTC) Received: by mail-ve0-f199.google.com with SMTP id db12sf1240430veb.10 for ; Fri, 13 Sep 2013 06:26:15 -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=VQJIiYSX/Kb0tBGw3bGBaZKy1Y4IbUKDetSEx52/9Ow=; b=LAeDvMib40xyH0ZXHI6IoZuL6L9qi6ifE9szBbcBx0HTdh8324k75KvCNwwaKK39hP nDSlQGSJk07lhmcitTZm/z8OrACn7ZUItnoXB91bd8rMYkVZAHTMZxPJ86JrrcMIB0RI KFzfMtI7E08DPsaxcZlLmxwtqkqcvCXz0a+B/Yt2ejFQf8bwdpdDzt16CaO2xjRqhkxZ 7P9zA6+tOSVZ8cE670Wwb73l8nOddU4Jh4SU0bGnpc0FshBaUK9Op/qU3LNULw8S7Kxy DMYLnVHaMYKQZjG4Y8m1aDNepMTu+7h2ozrxu7UNJItDnFQFCCj3Genh14k3WwdsGvd3 YI2Q== X-Gm-Message-State: ALoCoQniF12nJ6UWmUdruWQ28LqxERDgkza+jYUIfTE/sQPOxwXT/M6SR5UAVeray0+nXowG7zBC X-Received: by 10.236.108.233 with SMTP id q69mr5022591yhg.11.1379078775040; Fri, 13 Sep 2013 06:26:15 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.71.168 with SMTP id w8ls1191309qeu.64.gmail; Fri, 13 Sep 2013 06:26:14 -0700 (PDT) X-Received: by 10.58.187.47 with SMTP id fp15mr7071406vec.22.1379078774800; Fri, 13 Sep 2013 06:26:14 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id uh5si3111405vcb.127.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:26:14 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.180; Received: by mail-vc0-f180.google.com with SMTP id gf11so889554vcb.25 for ; Fri, 13 Sep 2013 06:26:14 -0700 (PDT) X-Received: by 10.52.232.165 with SMTP id tp5mr10025623vdc.11.1379078774712; Fri, 13 Sep 2013 06:26:14 -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 u4csp80650vcz; Fri, 13 Sep 2013 06:26:14 -0700 (PDT) X-Received: by 10.68.217.225 with SMTP id pb1mr13353536pbc.61.1379078773598; Fri, 13 Sep 2013 06:26:13 -0700 (PDT) Received: from mail-pd0-f180.google.com (mail-pd0-f180.google.com [209.85.192.180]) by mx.google.com with ESMTPS id vs7si7444511pbc.295.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:26:13 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.180 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.180; Received: by mail-pd0-f180.google.com with SMTP id y10so1242141pdj.25 for ; Fri, 13 Sep 2013 06:26:13 -0700 (PDT) X-Received: by 10.68.219.33 with SMTP id pl1mr13323529pbc.147.1379078773166; Fri, 13 Sep 2013 06:26:13 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id qa9sm11783525pbc.7.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:26:12 -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 195/228] cpufreq: kirkwood: remove calls to cpufreq_notify_transition() Date: Fri, 13 Sep 2013 18:32:21 +0530 Message-Id: <0a512914fd48b2d6db685446f88b9a096eff79a1.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.220.180 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 0ae4dd7..0767a4e 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; }