From patchwork Thu Nov 27 03:24:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 41590 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f69.google.com (mail-ee0-f69.google.com [74.125.83.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3947225E74 for ; Thu, 27 Nov 2014 03:24:54 +0000 (UTC) Received: by mail-ee0-f69.google.com with SMTP id d49sf2643218eek.8 for ; Wed, 26 Nov 2014 19:24:53 -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=JZDve1WidJ0tqgV9diNJtdBh8t4AIMuNPz4jAvduhc4=; b=jhQUOsQxSdZmEsGh9WOWZnnl7Q7GpJzQPkyc3N7UuU9AJ35dyv1hZA3HtQH4pxD5NH pkz95wGBzK9lGfGgJF8YDGQMPphVz2NGrRIXrqEp20qFJMO3PmFTcOwEVTFnmGpTQgk+ PCpYuCudo/+iF1VEsMP+/8KfudUK4DbEd1U3H0QsDm0JIyHOCncSfPe70KkVaF74cAQX K/GbLNqO+lR/EFptTU+Tv6ZRpTtsd7zv5AUBznCNNxRNbOXDN9Kw9a8pBNxuh3wfhJC3 o3Q8ws8zV5FUlMBbb0Oy9U6+OUvUxn5L6JZUtz4sspXw1HzNKlqAoxOpNGHLb7B79l1n yEyw== X-Gm-Message-State: ALoCoQnrNpwU5D514i9ra+HdPvTWyP7rf5xGdjIIaUqVYU8++XdEDRtzMERAxUhwnNdfvbL8hCJ6 X-Received: by 10.112.142.36 with SMTP id rt4mr9998121lbb.3.1417058693389; Wed, 26 Nov 2014 19:24:53 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.28.67 with SMTP id z3ls790864lag.74.gmail; Wed, 26 Nov 2014 19:24:52 -0800 (PST) X-Received: by 10.112.157.194 with SMTP id wo2mr36739473lbb.55.1417058692514; Wed, 26 Nov 2014 19:24:52 -0800 (PST) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id yg7si5969581lbb.133.2014.11.26.19.24.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Nov 2014 19:24:52 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by mail-lb0-f177.google.com with SMTP id 10so3367227lbg.8 for ; Wed, 26 Nov 2014 19:24:52 -0800 (PST) X-Received: by 10.112.62.166 with SMTP id z6mr36086471lbr.74.1417058692389; Wed, 26 Nov 2014 19:24:52 -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 ew9csp738425lbc; Wed, 26 Nov 2014 19:24:51 -0800 (PST) X-Received: by 10.66.228.170 with SMTP id sj10mr11750351pac.47.1417058690699; Wed, 26 Nov 2014 19:24:50 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bz1si3994085pdb.123.2014.11.26.19.24.49 for ; Wed, 26 Nov 2014 19:24:50 -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 S1753527AbaK0DYt (ORCPT + 12 others); Wed, 26 Nov 2014 22:24:49 -0500 Received: from mail-pd0-f170.google.com ([209.85.192.170]:38532 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753426AbaK0DYt (ORCPT ); Wed, 26 Nov 2014 22:24:49 -0500 Received: by mail-pd0-f170.google.com with SMTP id fp1so4059829pdb.1 for ; Wed, 26 Nov 2014 19:24:48 -0800 (PST) X-Received: by 10.68.101.131 with SMTP id fg3mr59213036pbb.130.1417058688616; Wed, 26 Nov 2014 19:24:48 -0800 (PST) Received: from localhost ([122.167.111.40]) by mx.google.com with ESMTPSA id il5sm5574377pbb.56.2014.11.26.19.24.47 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 26 Nov 2014 19:24:47 -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, paulmck@linux.vnet.ibm.com, Viresh Kumar Subject: [PATCH V1 5/8] opp: replace kfree_rcu() with call_srcu() in opp_set_availability() Date: Thu, 27 Nov 2014 08:54:07 +0530 Message-Id: <268325a89f657777924a52082749d8342e4ef79f.1417058376.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.0.3.693.g996b0fd In-Reply-To: <9a64eb3d9d11ff7379b7eb6d9207625175f28e47.1417058376.git.viresh.kumar@linaro.org> References: <9a64eb3d9d11ff7379b7eb6d9207625175f28e47.1417058376.git.viresh.kumar@linaro.org> In-Reply-To: <1407c1d67e546a09f5dd122de943de45bcd3c846.1417058376.git.viresh.kumar@linaro.org> References: <1407c1d67e546a09f5dd122de943de45bcd3c846.1417058376.git.viresh.kumar@linaro.org> 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.217.177 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: , This existed before we introduced call_srcu() in opp layer to synchronize with srcu_notifier_call_chain() while removing OPPs. And is a potential bug which wasn't noticed earlier. Let fix it as well by using the right API to free OPP. Signed-off-by: Viresh Kumar --- drivers/base/power/opp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c index 977474a..2d195f3 100644 --- a/drivers/base/power/opp.c +++ b/drivers/base/power/opp.c @@ -641,7 +641,7 @@ static int opp_set_availability(struct device *dev, unsigned long freq, list_replace_rcu(&opp->node, &new_opp->node); mutex_unlock(&dev_opp_list_lock); - kfree_rcu(opp, rcu_head); + call_srcu(&dev_opp->srcu_head.srcu, &opp->rcu_head, kfree_opp_rcu); /* Notify the change of the OPP availability */ if (availability_req)