From patchwork Tue Nov 25 10:34:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 41456 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CC69F25E18 for ; Tue, 25 Nov 2014 10:35:52 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id p9sf225502lbv.1 for ; Tue, 25 Nov 2014 02:35:51 -0800 (PST) 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 :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=LoUoNiJaYwpJWJIPk7nHna+OtqGCTQVbPKFwz0UM6DY=; b=Ly/AD0+G859XNbxVWBOAwFaU0WVMp/UOiIOUwpuCsVukeal/rSPioc16LV6vUhfq/G nbo/qntkj1wHZmrPWlAbn90cYV45YMseoB55ZN32X4Rh1xqYAe0rOuelVuZmrnZMkFf4 1P4gxucA/EFhyZlh9fvBm7ZAMpIIx0Lt5LP+Xj035h4LzpxDVD3sWqaSh+EIXD+eQV7U U7viZVlP9s9zNwmptndMdbqokokpt32L9zljQBDxzfxnfFZ3m4dj9BlR7ZuVaRKPf7XW KT/Z2buK/eJMr4T2e8IMh6CAPz1Qicq0JBAFmmMntwG7wyjzjRwRp8EhIuodVE/tIBc2 9hvg== X-Gm-Message-State: ALoCoQkR6M5Z1zmlLRNks0s8x7Lr93Vlqq6W4mpvxKl/14qn8xix5pg8SMzzjegzrf6ZwWfN3af+ X-Received: by 10.180.85.72 with SMTP id f8mr2431063wiz.0.1416911751802; Tue, 25 Nov 2014 02:35:51 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.130 with SMTP id m2ls523120laf.63.gmail; Tue, 25 Nov 2014 02:35:50 -0800 (PST) X-Received: by 10.152.23.103 with SMTP id l7mr24369318laf.92.1416911750970; Tue, 25 Nov 2014 02:35:50 -0800 (PST) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id t15si855623laz.105.2014.11.25.02.35.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 25 Nov 2014 02:35:50 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by mail-la0-f51.google.com with SMTP id ms9so260370lab.10 for ; Tue, 25 Nov 2014 02:35:50 -0800 (PST) X-Received: by 10.152.37.69 with SMTP id w5mr24861347laj.67.1416911750870; Tue, 25 Nov 2014 02:35:50 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp410745lbc; Tue, 25 Nov 2014 02:35:49 -0800 (PST) X-Received: by 10.70.3.196 with SMTP id e4mr42217492pde.35.1416911749225; Tue, 25 Nov 2014 02:35:49 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id mk8si1367241pdb.23.2014.11.25.02.35.48 for ; Tue, 25 Nov 2014 02:35:49 -0800 (PST) Received-SPF: none (google.com: linux-pm-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752317AbaKYKfs (ORCPT + 12 others); Tue, 25 Nov 2014 05:35:48 -0500 Received: from mail-pa0-f50.google.com ([209.85.220.50]:42660 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752186AbaKYKfr (ORCPT ); Tue, 25 Nov 2014 05:35:47 -0500 Received: by mail-pa0-f50.google.com with SMTP id bj1so340385pad.9 for ; Tue, 25 Nov 2014 02:35:46 -0800 (PST) X-Received: by 10.68.69.48 with SMTP id b16mr40731177pbu.59.1416911746882; Tue, 25 Nov 2014 02:35:46 -0800 (PST) Received: from localhost ([122.167.111.40]) by mx.google.com with ESMTPSA id wl10sm1093767pbc.58.2014.11.25.02.35.44 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 25 Nov 2014 02:35:46 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, stefan.wahren@i2se.com, nm@ti.com, linux-arm-kernel@lists.infradead.org, sudeep.holla@arm.com, Viresh Kumar Subject: [PATCH 5/8] arm_big_little: free OPP table created during ->init() Date: Tue, 25 Nov 2014 16:04:20 +0530 Message-Id: X-Mailer: git-send-email 2.0.3.693.g996b0fd In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , OPP layer now supports freeing of OPPs and we should free them once they aren't useful anymore. Signed-off-by: Viresh Kumar --- drivers/cpufreq/arm_big_little.c | 7 ++++++- drivers/cpufreq/arm_big_little.h | 5 ++++- drivers/cpufreq/arm_big_little_dt.c | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/arm_big_little.c b/drivers/cpufreq/arm_big_little.c index a46c223..e1a6ba6 100644 --- a/drivers/cpufreq/arm_big_little.c +++ b/drivers/cpufreq/arm_big_little.c @@ -289,6 +289,8 @@ static void _put_cluster_clk_and_freq_table(struct device *cpu_dev) clk_put(clk[cluster]); dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table[cluster]); + if (arm_bL_ops->free_opp_table) + arm_bL_ops->free_opp_table(cpu_dev); dev_dbg(cpu_dev, "%s: cluster: %d\n", __func__, cluster); } @@ -337,7 +339,7 @@ static int _get_cluster_clk_and_freq_table(struct device *cpu_dev) if (ret) { dev_err(cpu_dev, "%s: failed to init cpufreq table, cpu: %d, err: %d\n", __func__, cpu_dev->id, ret); - goto out; + goto free_opp_table; } name[12] = cluster + '0'; @@ -354,6 +356,9 @@ static int _get_cluster_clk_and_freq_table(struct device *cpu_dev) ret = PTR_ERR(clk[cluster]); dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table[cluster]); +free_opp_table: + if (arm_bL_ops->free_opp_table) + arm_bL_ops->free_opp_table(cpu_dev); out: dev_err(cpu_dev, "%s: Failed to get data for cluster: %d\n", __func__, cluster); diff --git a/drivers/cpufreq/arm_big_little.h b/drivers/cpufreq/arm_big_little.h index 70f18fc..a211f7d 100644 --- a/drivers/cpufreq/arm_big_little.h +++ b/drivers/cpufreq/arm_big_little.h @@ -25,13 +25,16 @@ struct cpufreq_arm_bL_ops { char name[CPUFREQ_NAME_LEN]; - int (*get_transition_latency)(struct device *cpu_dev); /* * This must set opp table for cpu_dev in a similar way as done by * of_init_opp_table(). */ int (*init_opp_table)(struct device *cpu_dev); + + /* Optional */ + int (*get_transition_latency)(struct device *cpu_dev); + void (*free_opp_table)(struct device *cpu_dev); }; int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops); diff --git a/drivers/cpufreq/arm_big_little_dt.c b/drivers/cpufreq/arm_big_little_dt.c index 4550f69..ef0b3f1 100644 --- a/drivers/cpufreq/arm_big_little_dt.c +++ b/drivers/cpufreq/arm_big_little_dt.c @@ -82,6 +82,7 @@ static struct cpufreq_arm_bL_ops dt_bL_ops = { .name = "dt-bl", .get_transition_latency = dt_get_transition_latency, .init_opp_table = dt_init_opp_table, + .free_opp_table = of_free_opp_table, }; static int generic_bL_probe(struct platform_device *pdev)