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: 5499001 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8DE79BEEA8 for ; Tue, 16 Dec 2014 01:03:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ACDAD209BF for ; Tue, 16 Dec 2014 01:03:26 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E8EC1209B1 for ; Tue, 16 Dec 2014 01:03:25 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y0gW9-0005W2-Uj; Tue, 16 Dec 2014 01:01:37 +0000 Received: from mail-ig0-f174.google.com ([209.85.213.174]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y0gW4-0005Lq-BI for linux-arm-kernel@lists.infradead.org; Tue, 16 Dec 2014 01:01:35 +0000 Received: by mail-ig0-f174.google.com with SMTP id hn15so6055182igb.1 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=FvPQ8k/M5He4YVQW+GThzBtba+wCVNJfg2kxNveukApk6y9nx4hq7GL515z5xARV4w SA+bEVQigxnsO2hHy3yLn+kGp16118G7vrJNMX2sl5T3vBIKw1ND3u2DY1eYfolD3GUG s2gzjRpRWqjnMfyrOTnCAdaS7gG6ifgTm64AkGFSnmtpKMq5pYKSBM1oCLRlZC2SP0MP owzIREJoq3ExYSveYojy5UZihS1JCcv+TXXiERjzuJbNvSAWAIXLHiBugIOS4YYVXiRM 4uR9XpxhZ5dXmo73UqKHys4qXRY/lT4HwTFRyowcX80wuPTvBmf7/uxzYNhGzOLOuGah 4Kkg== X-Gm-Message-State: ALoCoQmlpFZGaU8XHBSM+P4IdUBDd5S8p7cv5/lp3FSYjyIYtPBwEQ8WVWO6JKe8sRJx95wP7N0P 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" 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) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141215_170132_427155_4E6C32D1 X-CRM114-Status: UNSURE ( 9.40 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) Cc: linux-samsung-soc@vger.kernel.org, Wolfram Sang , Viresh Kumar , linux-pm@vger.kernel.org, Stratos Karafotis , linux-kernel@vger.kernel.org, "Lad, Prabhakar" , Kukjin Kim , Shawn Guo , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham 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))