Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752795AbcKYH2b (ORCPT ); Fri, 25 Nov 2016 02:28:31 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:56582 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752415AbcKYH21 (ORCPT ); Fri, 25 Nov 2016 02:28:27 -0500 X-AuditID: cbfee61a-f79916d0000062de-c6-5837e8073cf6 Message-id: <5837E833.20007@samsung.com> Date: Fri, 25 Nov 2016 16:28:51 +0900 From: Joonyoung Shim User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-version: 1.0 To: Viresh Kumar , Rafael Wysocki , 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, Joonyoung Shim Subject: Re: [PATCH] PM / OPP: Allow inactive opp_device to be present in dev list References: <2fe61813c867c173ddfcb0b9cabc00a65997a935.1480056714.git.viresh.kumar@linaro.org> In-reply-to: <2fe61813c867c173ddfcb0b9cabc00a65997a935.1480056714.git.viresh.kumar@linaro.org> Content-type: text/plain; charset=windows-1252 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrPIsWRmVeSWpSXmKPExsVy+t9jAV32F+YRBodOyVu8uHeRxeL9oWfM Fpd3zWGz+Nx7hNHizY+zTBZnTl9itfhxppvFYsHGR4wWG796WGx+cIzNgcvjcl8vk8emVZ1s Hneu7WHzuP3vMbPHlqvtLB59W1Yxehy/sZ3J4/MmuQCOKDebjNTElNQihdS85PyUzLx0W6XQ EDddCyWFvMTcVFulCF3fkCAlhbLEnFIgz8gADTg4B7gHK+nbJbhlLL24kblgHW/F14lPmRsY f3B1MXJySAiYSJycPZsNwhaTuHBvPZgtJLCUUeLcX94uRi4g+z6jxJFjs5hBErwCGhJzb0xj 6WLk4GARUJU4tcgbJMwmoCdxZ9txJhBbVCBM4sG6vawQ5YISPybfYwGxRQS2MUos/GwOMpNZ YAGjxLb5U8BmCguESByeswtq8WZGidn73EBsToEEiUsH5zKD7GIGWnD/ohZImFlAXmLzmrfM ExgFZiFZMQuhahaSqgWMzKsYJVILkguKk9JzDfNSy/WKE3OLS/PS9ZLzczcxgiPzmdQOxoO7 3A8xCnAwKvHwTkg3jxBiTSwrrsw9xCjBwawkwsvwFCjEm5JYWZValB9fVJqTWnyI0RQYBBOZ pUST84FJI68k3tDE3MTc2MDC3NLSxEhJnLdx9rNwIYH0xJLU7NTUgtQimD4mDk6pBkYdgwzt xPQDnbKdh8q23FqYvKWjjvHZiVCud9/itb8FPxV+/pbbvrzx2vGXYUWKv6eeyvsSGx8WWBC+ yC3Wr/uzzbM9Z29/WRUqYX37+J2KraWmtw5tZHy6tjNggmtBnsA/5+KaVudr6ou4Jx/0m7ij o+n+hznTnqlXbf3ZJeDyQX/HCouANT1KLMUZiYZazEXFiQDB7cQT4gIAAA== X-MTR: 20000000000000000@CPGS Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1672 Lines: 38 On 11/25/2016 03:53 PM, 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 It's working well during system suspend/resume on my Odroid-XU3 board. Tested-by: Joonyoung Shim Thanks.