Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752768AbcKYGzk (ORCPT ); Fri, 25 Nov 2016 01:55:40 -0500 Received: from mail-pg0-f43.google.com ([74.125.83.43]:34175 "EHLO mail-pg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752104AbcKYGzc (ORCPT ); Fri, 25 Nov 2016 01:55:32 -0500 Date: Fri, 25 Nov 2016 12:25:29 +0530 From: Viresh Kumar To: Rafael Wysocki , jy0922.shim@samsung.com, Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] PM / OPP: Allow inactive opp_device to be present in dev list Message-ID: <20161125065529.GB29969@vireshk-i7> References: <2fe61813c867c173ddfcb0b9cabc00a65997a935.1480056714.git.viresh.kumar@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2fe61813c867c173ddfcb0b9cabc00a65997a935.1480056714.git.viresh.kumar@linaro.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1847 Lines: 43 On 25-11-16, 12:23, Viresh Kumar wrote: > Joonyoung Shim reported an interesting problem on his ARM octa-core > Odoroid-XU3 platform. During system suspend, dev_pm_opp_put_regulator() > was failing for a struct device for which dev_pm_opp_set_regulator() is > called earlier. > > This happened because an earlier call to > dev_pm_opp_of_cpumask_remove_table() function (from cpufreq-dt.c file) > removed all the entries from opp_table->dev_list apart from the last CPU > device in the cpumask of CPUs sharing the OPP. > > But both dev_pm_opp_set_regulator() and dev_pm_opp_put_regulator() > routines get CPU device for the first CPU in the cpumask. And so the OPP > core failed to find the OPP table for the struct device. > > This patch attempts to fix this problem by adding another field in the > struct opp_device: inactive. > > Instead of removing the entries from the list during > dev_pm_opp_of_cpumask_remove_table() function call, we mark them as > inactive. Such inactive devices will not be used by the core in most of > the cases, like before, but will be used only at special places which > need to take inactive devices into account. > > All the devices are removed from the list together now and that happens > only when the opp_table gets destroyed. > > This patch is tested on Dual A15, Exynos5250 platform by compiling the > cpufreq-dt driver as a module. The module is inserted/removed multiple > times with combinations of CPU offline/online steps. > > Signed-off-by: Viresh Kumar @Rafael: Can you please add following while applying the patch ? Cc: # v4.4+ Somehow git send-email wasn't working properly for me as it was trying to cc stable@vger.kernel.org#v4.4+ and that was failing. I tried lots of options including suppress-cc but nothing worked :( -- viresh