Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756428AbcK3Bge (ORCPT ); Tue, 29 Nov 2016 20:36:34 -0500 Received: from mail-io0-f181.google.com ([209.85.223.181]:35216 "EHLO mail-io0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754590AbcK3BgZ (ORCPT ); Tue, 29 Nov 2016 20:36:25 -0500 MIME-Version: 1.0 In-Reply-To: <20161129205638.GB6095@codeaurora.org> References: <2fe61813c867c173ddfcb0b9cabc00a65997a935.1480056714.git.viresh.kumar@linaro.org> <20161129024647.GY6095@codeaurora.org> <20161129051115.GE3288@vireshk-i7> <20161129205638.GB6095@codeaurora.org> From: Viresh Kumar Date: Wed, 30 Nov 2016 07:06:24 +0530 Message-ID: Subject: Re: [PATCH] PM / OPP: Allow inactive opp_device to be present in dev list To: Stephen Boyd Cc: Rafael Wysocki , Joonyoung Shim , Viresh Kumar , Nishanth Menon , Lists linaro-kernel , "linux-pm@vger.kernel.org" , Linux Kernel Mailing List , "# 3.13.x" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1956 Lines: 47 On 30 November 2016 at 02:26, Stephen Boyd wrote: > On 11/29, Viresh Kumar wrote: >> On 28-11-16, 18:46, Stephen Boyd wrote: >> > Anyway, rant over, how about handing out the opp table pointer to >> > the caller so they can pass it back in when they call the put >> > side? That should fix the same problem if I understand correctly. >> >> Hmm, so the problem is that all below routines (and their callers) need to get >> updated: >> >> int dev_pm_opp_set_supported_hw(struct device *dev, const u32 *versions, unsigned int count); >> void dev_pm_opp_put_supported_hw(struct device *dev); >> int dev_pm_opp_set_prop_name(struct device *dev, const char *name); >> void dev_pm_opp_put_prop_name(struct device *dev); >> struct opp_table *dev_pm_opp_set_regulator(struct device *dev, const char *name); >> void dev_pm_opp_put_regulator(struct opp_table *opp_table); >> >> And that will make it difficult to get it back to stable kernels, specially >> because they were all added in different kernel releases after 4.4. > > Why do we care? The put variants of the prop and supported_hw > functions are never called, so we're not going to hit this > problem there. Sure the code is broken, but nobody is using the > code in mainline so there isn't anything to backport to stable > urgently. Hmm, only the set variants are used by the sti driver. >> >> And we also need to fix them properly, with something like a cookie instead of a >> plain opp_table pointer. > > Perhaps this means my approach in using opp_table is undesirable > for some reason? Care to elaborate why? You only suggested the cookie method as well, isn't it ? I am fine with your patch as well, the only problem is that we will have different prototype for a single set of APIs.. > I'd prefer we used my patch because it > isn't as easy to break and more directly fixes the problem at > hand. Okay, can you please send it formally and I can Ack it then ? -- viresh