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: 5498991 Return-Path: X-Original-To: patchwork-linux-pm@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 13AB09F30B for ; Tue, 16 Dec 2014 01:01:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C3869209BF for ; Tue, 16 Dec 2014 01:01:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7276E209F5 for ; Tue, 16 Dec 2014 01:01:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751091AbaLPBBM (ORCPT ); Mon, 15 Dec 2014 20:01:12 -0500 Received: from mail-ig0-f171.google.com ([209.85.213.171]:63198 "EHLO mail-ig0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750862AbaLPBBK (ORCPT ); Mon, 15 Dec 2014 20:01:10 -0500 Received: by mail-ig0-f171.google.com with SMTP id z20so6033370igj.10 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=GvDDJ8Z1JTEQTuN8qQkE3qUdEh2tae2swUSSeRZVCa0d9sacfg/n7rGXC9VxAqqNTo wtgj3JmYMJ3w4v+ayGXogo1rlAk7ywm2nx8gFccs8H/WKUQmF42dDE/la3MiFCiXpcwL FzYJjJP8XbkK8MwmCGl41+prSvKBu3qLp+VmxBmoGazZObtG/yqVp3r4/1946vRGrhCY ffcOB1P7xlD5R05K6/e8p2s/t61lW6QMMwcPJuOMcfkOCckOkAIYyKD7au3ibLmUZxcH FIJIxod4aQdbnmqaa1smiyL/vYSK9mNx0Trh/c1oG99TtyYhiGT/mplaJgSej1H4OGMR 0BtQ== X-Gm-Message-State: ALoCoQmbEVWYK4s0XXtYE8xjwocwotQSse+6Cw6Ao54gb6vjTck8Oksvv4IVUSZJWip4ie28cawT 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-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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))