From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5AD39C43387 for ; Fri, 4 Jan 2019 11:02:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 28D5F206C0 for ; Fri, 4 Jan 2019 11:02:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DsOmO7xC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 28D5F206C0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=alxzYYpZagFhkmQ5Qhf9zZHg7QMoP92Y3r7JwJXvT8I=; b=DsOmO7xChGA57t ZHaLa/hLiU7xGuXRbBIpC8+Bm3wvh7TqIet/Auyf3dVv5Xejum66JpoOsdDH1pm0z6OXZbvGDStAs Vl+k5VpN4/g6Dkr0xSQO/pZWWv4+kr9gbVsbXBtyiAn1tnpiBe7+cudDA9GFbjOVCd7tzndPj2xww GNb45UzxUzB0djL0UkBsFg5E30VD8j4kHVibkuGV6Rrt2wFbZ5GRbrP4rUbKA5idk1YgT7/FseHRz uCQEELSk8g06IOX1qGL4zEyINmuLrQKCUYJgLmOqoxuX4a5EXHuT+p7LlNjvglAfLZ6Cvu8VeYcc9 MdQWBtK00zkyQDhMC/1w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gfNEo-0005lW-Us; Fri, 04 Jan 2019 11:02:02 +0000 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gfNEi-0005ka-1Q for linux-arm-kernel@lists.infradead.org; Fri, 04 Jan 2019 11:01:57 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7AA3715AD; Fri, 4 Jan 2019 03:01:51 -0800 (PST) Received: from e107155-lin (e107155-lin.cambridge.arm.com [10.1.196.42]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1EAC43F575; Fri, 4 Jan 2019 03:01:48 -0800 (PST) Date: Fri, 4 Jan 2019 11:01:42 +0000 From: Sudeep Holla To: Viresh Kumar Subject: Re: [PATCH] cpufreq: scpi/scmi: Fix freeing of dynamic OPPs Message-ID: <20190104110142.GA28483@e107155-lin> References: <7dddbeabb434225d9b3d02600ea4a2313622ca26.1546594910.git.viresh.kumar@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <7dddbeabb434225d9b3d02600ea4a2313622ca26.1546594910.git.viresh.kumar@linaro.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190104_030156_092958_147CF311 X-CRM114-Status: GOOD ( 13.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nishanth Menon , Vincent Guittot , linux-pm@vger.kernel.org, Stephen Boyd , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, "4 . 20" , dietmar.eggemann@arm.com, quentin.perret@arm.com, Sudeep Holla , Douglas.Raillard@arm.com, Valentin Schneider , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Jan 04, 2019 at 03:14:33PM +0530, Viresh Kumar wrote: > Since the commit 2a4eb7358aba ("OPP: Don't remove dynamic OPPs from > _dev_pm_opp_remove_table()"), dynamically created OPP aren't > automatically removed anymore by dev_pm_opp_cpumask_remove_table(). This > affects the scpi and scmi cpufreq drivers which no longer free OPPs on > failures or on invocations of the policy->exit() callback. > > Create a generic OPP helper dev_pm_opp_remove_all_dynamic() which can be > called from these drivers instead of dev_pm_opp_cpumask_remove_table(). > > In dev_pm_opp_remove_all_dynamic(), we need to make sure that the > opp_list isn't getting accessed simultaneously from other parts of the > OPP core while the helper is freeing dynamic OPPs, i.e. we can't drop > the opp_table->lock while traversing through the OPP list. And to > accomplish that, this patch also creates _opp_kref_release_unlocked() > which can be called from this new helper with the opp_table lock already > held. > I did test it but since I couldn't reproduce the original issue, my tested-by is not that worth. Anyways the changes look fine to me. Reviewed-by: Sudeep Holla -- Regards, Sudeep _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel