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=-12.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 2B22CC43462 for ; Thu, 29 Apr 2021 07:51:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E30E16145B for ; Thu, 29 Apr 2021 07:51:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239619AbhD2Hvp (ORCPT ); Thu, 29 Apr 2021 03:51:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231528AbhD2Hvn (ORCPT ); Thu, 29 Apr 2021 03:51:43 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88249C06138B for ; Thu, 29 Apr 2021 00:50:57 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id 20so30362060pll.7 for ; Thu, 29 Apr 2021 00:50:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=XTx/thG4WPqLujG9OHbuc45ghslhD/DJHZfDs/oHSh0=; b=oOKWpcEuBYKPRs26BuQsrMlUYswythWAXRWqRiEobuyNfwlILxiqnLBTq+qFKwQWPw QzsAVsSnnSdNjPohWkmZns64Inbbl9ccZ2sLoWOnA6R5kUWZ08nwFdKt6uSuf4zOkOVc oTTKkhNIEzcoFOPtIpVSYEb+e+EYgogDs+3ZNXCo6j9NFbkmGpTbrXW4z/oVeUVZb8BU aEIIUfFTcjH6WBK4lPmBfTiaMdBRdy/oUxdY9MjkLWSSzH/MHRud5WK7fXwmhOhh+j1j dsnlYTPdKgWKikICp0/5hOkDVFH7CuHzO0F/Iy2LPOTHJTs79t1IXwHqxb44Vkm4paNC B2UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=XTx/thG4WPqLujG9OHbuc45ghslhD/DJHZfDs/oHSh0=; b=NGZIne98Hnfb6C6gRsPYb+mcN2SwFvyBS+FqPZAz8i10sYCIDwmIyvKVEk329Osq7T 5P/UpPmBgzr63uYVRGj7qSDvxnGAyozJ06md9BLzTBoBvSxvwLtJxvAqJT8EtC3wblsg NH0IJCKdIP0Lv5GYNLj8YIuqeOoj2ivRdTGirru5Cx+0dk45Fpt+A4OXcOg3meMwpcQN aZ1lQtqEV/HLFKDFRRDtiAxOG7rg/I8WZ9jQeqfRZbd2hc2itS78jrs5dy2APnOwUNJX 9mRLwVTAoi0revj+54QHRGlv5GPrYf3aVmFQCeGtJKSx90pMHVlJPfxMzc17M9YyUWKs xk8Q== X-Gm-Message-State: AOAM530gGT8Z/efgfZJdSjQFrcTohe/rk6EjFgUmewZkpt4W4o39N4uL EMK5vtpFIK62W466KWXVpFHTOg== X-Google-Smtp-Source: ABdhPJwwXEANuKHmnnDxb+3Y+tQzhO7ngCIEXVVT6C6z7FzUdn0wjWg/fZcqn9oaBUazh/6FS8HUOg== X-Received: by 2002:a17:90a:448b:: with SMTP id t11mr36831576pjg.21.1619682657146; Thu, 29 Apr 2021 00:50:57 -0700 (PDT) Received: from localhost ([136.185.154.93]) by smtp.gmail.com with ESMTPSA id x2sm1653711pfu.77.2021.04.29.00.50.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Apr 2021 00:50:56 -0700 (PDT) Date: Thu, 29 Apr 2021 13:20:54 +0530 From: Viresh Kumar To: Ulf Hansson Cc: Rajendra Nayak , Bjorn Andersson , Roja Rani Yarubandi , Rob Herring , Wolfram Sang , Stephen Boyd , Doug Anderson , Sai Prakash Ranjan , Matthias Kaehlcke , akashast@codeaurora.org, msavaliy@qti.qualcomm.com, parashar@codeaurora.org, Linux PM , DTML , Linux Kernel Mailing List , linux-arm-msm , Andy Gross , linux-i2c@vger.kernel.org Subject: Re: [PATCH 3/3] i2c: i2c-qcom-geni: Add support for 'assigned-performance-states' Message-ID: <20210429075054.vrotcbldbaivfh2d@vireshk-i7> References: <20201224111210.1214-1-rojay@codeaurora.org> <20201224111210.1214-4-rojay@codeaurora.org> <6bfec3e6-3d26-7ade-d836-032273856ce2@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716-391-311a52 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sorry Roja for dragging this too long, unfortunately I didn't have a lot to add on. Lemme try start this thread again. On 19-01-21, 12:02, Ulf Hansson wrote: > On Mon, 18 Jan 2021 at 06:36, Rajendra Nayak wrote: > > > > > > On 1/15/2021 8:13 PM, Bjorn Andersson wrote: > > > On Thu 24 Dec 05:12 CST 2020, Roja Rani Yarubandi wrote: > > > > > >> @@ -629,6 +658,16 @@ static int __maybe_unused geni_i2c_runtime_suspend(struct device *dev) > > >> struct geni_i2c_dev *gi2c = dev_get_drvdata(dev); > > >> > > >> disable_irq(gi2c->irq); > > >> + > > >> + /* Drop the assigned performance state */ > > >> + if (gi2c->assigned_pstate) { > > >> + ret = dev_pm_genpd_set_performance_state(dev, 0); > > >> + if (ret) { > > >> + dev_err(dev, "Failed to set performance state\n"); > > >> + return ret; > > >> + } > > >> + } > > >> + > > > > > > Ulf, Viresh, I think we discussed this at the time of introducing the > > > performance states. > > > > > > The client's state does not affect if its performance_state should > > > be included in the calculation of the aggregated performance_state, so > > > each driver that needs to keep some minimum performance state needs to > > > have these two snippets. > > > > > > Would it not make sense to on enable/disable re-evaluate the > > > performance_state and potentially reconfigure the hardware > > > automatically? > > > > I agree, this will be repeated across multiple drivers which would > > need some minimal vote while they are active, handling this during > > genpd enable/disable in genpd core makes sense. > > Initially that's what we tried out, but we realized that it was > difficult to deal with this internally in genpd, but more importantly > it also removed some flexibility from consumers and providers. See > commit 68de2fe57a8f ("PM / Domains: Make genpd performance states > orthogonal to the idlestates"). > > As a matter of fact this was quite recently discussed [1], which also > pointed out some issues when using the "required-opps" in combination, > but perhaps that got resolved? Viresh? So I looked again at that thread in detail today. The basic idea was to enable/disable the genpd from within the OPP core and there were doubts on how to do that efficiently as there are cases where domains may be enabled for an OPP, but not for others.. etc. etc. I am not sure if I consider that thread as part of the discussion we are having here, they may be related, but that thread doesn't block anything to be done in the genpd core. > My concern is, if we would make this kind of change to the internals > of genpd, it would lead to the following limitation: A consumer driver > can no longer make its vote for its device to stick around, when the > device becomes runtime suspended - and how do we know that we never > need to support such a case? What about doing this just for the assigned-performance-state case as the clients don't want to play with it at all. -- viresh