From patchwork Wed Nov 26 09:17:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 41529 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0D04425E18 for ; Wed, 26 Nov 2014 09:17:55 +0000 (UTC) Received: by mail-la0-f69.google.com with SMTP id gd6sf1499663lab.8 for ; Wed, 26 Nov 2014 01:17: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:delivered-to:mime-version:in-reply-to:references :date:message-id:subject:from:to:cc:content-type:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe; bh=a6RtFaOLWBFAhBqAvrG3zkegmApvEkUeSIBAOJjhAP8=; b=mQv1tZ764tKrqSJzB2MYA/MLQZVCn3qWyM7FhTJDk+wctJGZ6k26W/v8224KdA9Qm4 fBJOIYJpuakymAnhjjjNwsTHIAdIFrHmb/ZDRzbHUWNcUnzrT9/lbrT9apHhcjwbzIGy /xzUnW6FsblzZf9dUwJdneRIl7O2Gm8FZIXWXP8k4PorWHpOkUZX7f2Tdp4xD/hDYeeM CvF3lVZ9b8L/m8aEiYK32eaq/IQ3VUxdsfLXCFwt4BL94QkakZ+aHjL5TtwTq7L7vGzn 7XAkxSuT0mLFuVMgJjR0pA0I2YJKWbIvKmvr1Yq9NDnAUr8JR0wEoPdYnCdjHHsDRNCH lXcA== X-Gm-Message-State: ALoCoQkTqPht+kigfZVX0ZtHEcS0DXUNA8Et1emGysoTXTYNq/ZzlIgZj1p4YhAASjied3cqWcRS X-Received: by 10.195.17.134 with SMTP id ge6mr613055wjd.2.1416993473950; Wed, 26 Nov 2014 01:17:53 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.9.38 with SMTP id w6ls576354laa.49.gmail; Wed, 26 Nov 2014 01:17:53 -0800 (PST) X-Received: by 10.152.20.1 with SMTP id j1mr6751736lae.90.1416993473609; Wed, 26 Nov 2014 01:17:53 -0800 (PST) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id n3si3812160lah.1.2014.11.26.01.17.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Nov 2014 01:17:53 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by mail-la0-f41.google.com with SMTP id gf13so2095772lab.14 for ; Wed, 26 Nov 2014 01:17:53 -0800 (PST) X-Received: by 10.112.235.196 with SMTP id uo4mr32421624lbc.66.1416993473464; Wed, 26 Nov 2014 01:17:53 -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 ew9csp589789lbc; Wed, 26 Nov 2014 01:17:52 -0800 (PST) X-Received: by 10.70.137.103 with SMTP id qh7mr51077772pdb.157.1416993471824; Wed, 26 Nov 2014 01:17:51 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id af2si5965777pbc.24.2014.11.26.01.17.51 for ; Wed, 26 Nov 2014 01:17:51 -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 S1751229AbaKZJRu (ORCPT + 12 others); Wed, 26 Nov 2014 04:17:50 -0500 Received: from mail-ob0-f172.google.com ([209.85.214.172]:53827 "EHLO mail-ob0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750879AbaKZJRs (ORCPT ); Wed, 26 Nov 2014 04:17:48 -0500 Received: by mail-ob0-f172.google.com with SMTP id wn1so1874923obc.17 for ; Wed, 26 Nov 2014 01:17:47 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.182.209.36 with SMTP id mj4mr19690588obc.12.1416993467861; Wed, 26 Nov 2014 01:17:47 -0800 (PST) Received: by 10.182.56.162 with HTTP; Wed, 26 Nov 2014 01:17:47 -0800 (PST) In-Reply-To: References: <20141125162434.GC5050@linux.vnet.ibm.com> <20141125173943.GG5050@linux.vnet.ibm.com> Date: Wed, 26 Nov 2014 14:47:47 +0530 Message-ID: Subject: Re: [PATCH 4/8] opp: Introduce APIs to remove OPPs From: Viresh Kumar To: Paul McKenney Cc: Rafael Wysocki , Lists linaro-kernel , "linux-pm@vger.kernel.org" , Stefan Wahren , Nishanth Menon , "linux-arm-kernel@lists.infradead.org" , Sudeep Holla 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.41 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: , On 26 November 2014 at 11:59, Viresh Kumar wrote: > Also it looks like I should use call_srcu() with kfree_rcu() for > opp_set_availability() case as well to avoid any corner cases. This is the diff I would be adding to this patch: static void kfree_device_rcu(struct rcu_head *head) @@ -644,7 +644,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) --- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c index f9d80e6..3f728cd 100644 --- a/drivers/base/power/opp.c +++ b/drivers/base/power/opp.c @@ -506,7 +506,7 @@ static void kfree_opp_rcu(struct rcu_head *head) struct dev_pm_opp *opp = container_of(head, struct dev_pm_opp, rcu_head); pr_info("%s: opp:%p, dynamic:%d\n", __func__, opp, opp->dynamic); - kfree(opp); + kfree_rcu(opp); }