From patchwork Tue Dec 16 01:01:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 5498981 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3DC509F30B for ; Tue, 16 Dec 2014 01:01:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 72E2020A14 for ; Tue, 16 Dec 2014 01:01:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7442E209BF for ; Tue, 16 Dec 2014 01:01:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750953AbaLPBBL (ORCPT ); Mon, 15 Dec 2014 20:01:11 -0500 Received: from mail-ie0-f175.google.com ([209.85.223.175]:63233 "EHLO mail-ie0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750854AbaLPBBK (ORCPT ); Mon, 15 Dec 2014 20:01:10 -0500 Received: by mail-ie0-f175.google.com with SMTP id x19so11611781ier.6 for ; Mon, 15 Dec 2014 17:01:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-type:content-disposition:user-agent; bh=iB2W3fSFI5+MjMgKQODnF748catMMKuOm0WwHA5dIkc=; b=Mr/Bm+DFbn6F+q639yXcsjvyMNSg9T0KKDn3byp2Kf0M8wLwRc28PhXfSd4O/tDB9l DhINtyJrhdivX7OZLaaDXx4UC9kMOmbG2lHlpVM9KTmHm0urE1orPrwEBcTc2RyLm+5f I2zBypKDttZz2H0U230Z24IL6gQ0z3uNlWU980tv4RlGictORVdh0iP3A9asDGTkS6qM NPeB1FoNsLheh3PO9w0iKuSfpkakkNWMSJS/y2/mxyF6XLbhXSSZHn3QStCj/IF+2ppo gw9kCEuPnxHUewRyTzzLTB64wNcl5YifnR+Ohpk1Bzvj0Z85npYTPvhv0KpO+TTMnPg7 roAA== X-Gm-Message-State: ALoCoQnC4Bf6t0m5kAKP9wJbXtjLQe6WhiEHYjJKO/pepuNqNITZrM/asFly+YNcl+3FJD6wdJ6l X-Received: by 10.50.12.39 with SMTP id v7mr90838igb.13.1418691669954; Mon, 15 Dec 2014 17:01:09 -0800 (PST) Received: from dtor-ws ([2620:0:1000:1301:edc3:4b7a:3f05:ce06]) by mx.google.com with ESMTPSA id w9sm5670593igk.20.2014.12.15.17.01.09 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 15 Dec 2014 17:01:09 -0800 (PST) Date: Mon, 15 Dec 2014 17:01:07 -0800 From: Dmitry Torokhov To: "Rafael J. Wysocki" Cc: Viresh Kumar , Kukjin Kim , Shawn Guo , Wolfram Sang , "Lad, Prabhakar" , Stratos Karafotis , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] cpufreq: exynos5440: protect call to dev_pm_opp_get_opp_count with RCU lock Message-ID: <20141216010107.GA16947@dtor-ws> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP dev_pm_opp_get_opp_count() must be called with RCU lock held. Signed-off-by: Dmitry Torokhov --- Again, not tested... drivers/cpufreq/exynos5440-cpufreq.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/cpufreq/exynos5440-cpufreq.c b/drivers/cpufreq/exynos5440-cpufreq.c index 21a90ed..588b9ee 100644 --- a/drivers/cpufreq/exynos5440-cpufreq.c +++ b/drivers/cpufreq/exynos5440-cpufreq.c @@ -373,7 +373,11 @@ static int exynos_cpufreq_probe(struct platform_device *pdev) "failed to init cpufreq table: %d\n", ret); goto err_free_opp; } + + rcu_read_lock(); dvfs_info->freq_count = dev_pm_opp_get_opp_count(dvfs_info->dev); + rcu_read_unlock(); + exynos_sort_descend_freq_table(); if (of_property_read_u32(np, "clock-latency", &dvfs_info->latency))