Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp769176rdb; Thu, 19 Oct 2023 20:46:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHQxDWj31znmISLXHmlZsK0K9VxgCuKE0TwpgQ1OF5O1nKwEE5gEnEvj8/TCkdU/UKFrur3 X-Received: by 2002:a9d:74c4:0:b0:6bf:21d3:2de5 with SMTP id a4-20020a9d74c4000000b006bf21d32de5mr742523otl.17.1697773569645; Thu, 19 Oct 2023 20:46:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697773569; cv=none; d=google.com; s=arc-20160816; b=OktuyxL+BgOtra3W6VFHLkfsTq/vOUzfLKCzK49eBeoNYSwFvBwN6cUD2+Y9cDW6ZC fNUNTueR/A1sKAw4wtrvQOcfTj1JDKSVQzAjk8PMbwkEtocp3pSLsX3TLySNoX+07uoL 4Fmbqi3uee0h7Tj0SMLTSeqs0mkDRZhNWBsrUVX+nGCm1vKzQ9M7qqMunWL5+WWrTChi hsQ6uSQ10Ug2QCDdnHINiMWcmTOdxbtqKy6u6OGMRX+4vaf4/RxRVqKBIBh4o4eLTmLd rmWmuMGy86Wl5++3sMF0bhsWd+Yjc203JFW7cVUXOyFGJq8qk7ifiBZlnKi+XPbQqXLY 3KWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=inKXka09GwXcWLXC5wnAFP5z0I1SlJNRWhr0zXVlA4w=; fh=5XTnUzlQXsGVkho5v3w8+4MESdUzxSMTWxIXgidQgXg=; b=pBH3SrVcFd+YNMMuhOwadEUvzgHUCA4YrAZC+KNw/CkrSrA9UW5nqga1L/mRhTzvhq YLlEWxbM14SV3S5lIe7K6jcmGM64vwsJJApyRPM+OPXVzuxaTCHxeEU9kVT3zepc8ipi 2LHBVgt68GjzuGxYdHDFQkw0xQBxM22su3Nyjeepfsi1AKOSImK44LjR5SW+dx/sQiQQ L4uxU8t5+FEpk6bcHTfgUGmzdJz781hijzOZRcpOwNYKyzf0pL/jOYkZcuXo7D8NC0Uh NZpIqv7r5tZ4PX4loJLjQRTzDsOcFH59DjrdlvAxhO3P9uWcEd/thVnYLTtpif77E0z2 TL0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nMFzUO8G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id x26-20020aa7941a000000b006be1f19e5f5si989607pfo.196.2023.10.19.20.46.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 20:46:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nMFzUO8G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 62FEA806AA39; Thu, 19 Oct 2023 20:46:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346903AbjJTDp4 (ORCPT + 99 others); Thu, 19 Oct 2023 23:45:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235606AbjJTDpy (ORCPT ); Thu, 19 Oct 2023 23:45:54 -0400 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55C311A4 for ; Thu, 19 Oct 2023 20:45:50 -0700 (PDT) Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-565334377d0so290232a12.2 for ; Thu, 19 Oct 2023 20:45:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697773550; x=1698378350; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=inKXka09GwXcWLXC5wnAFP5z0I1SlJNRWhr0zXVlA4w=; b=nMFzUO8GJPUxlWfnnfyVKJ2OjtkDwUzYZuP6cUMr/kskyDCeQE5fGfHO0gZwXmh/Up FdWQrhME9g5XnAOlPQ3hfmRJPQS/WIsnzaEo9rzDz1uwxM6/dBUKRMnFEbQGg4iGAhnA tEegiSHXzgtAP+anVCt9IX/tKz9fR3GFuBt1zLrlXUM6nmGIx2ZnYc5KH1rJO8wDMleq uECT0EHYUi1lQSIyWZ6I2esfnWodX19ire//91PEC+9av/z+3TdNGjztB5lUFwd2E2sh m5Z6jrVGp12Rue3/t9WJnQVy9C2wbgSoGfuWUa1zhQKnL7qp/pPEyow/asrgRoPCoz/Z +DHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697773550; x=1698378350; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=inKXka09GwXcWLXC5wnAFP5z0I1SlJNRWhr0zXVlA4w=; b=H95ebugCI8MATWVzPmR1BXxOzTzs44M9Ij6NIPt0xXZlCGGCs8N+84Ws886HEWwkZx IkcI1fwnMZix+coXmf7famj7FaR5HwWA6/g6pKx5tqzwKv+h39+LoCtJd6GC/8zOb9U8 p+sz4Fp/UcqIDAWHHkFm+gpJYlqcy+w4IUjICF/loSiGa86+/iGW3Yq6lBTAp9//gNT3 EhQk2sZSag77G6vWNOR08RLblO0eNZ0osiSiLTQyEN86Rzry+FPuWwOvoavlZoCkQAsF +XdOIfNjwrqBiKX/Au7lrMANfTR1HsyjdiJEGrOpKaiJresUNoFUcSc9Pk4ItSw4sbSK 5RBg== X-Gm-Message-State: AOJu0Yzk36CZokrbLOkqhfjFIiNV6IsQ0lnCFduQt3rD0hAtR5Eu2ohi uupBj15QfFuO4kOgxrZEXirdIQ== X-Received: by 2002:a05:6a20:1450:b0:17b:992c:7653 with SMTP id a16-20020a056a20145000b0017b992c7653mr813092pzi.7.1697773549739; Thu, 19 Oct 2023 20:45:49 -0700 (PDT) Received: from localhost ([122.172.80.14]) by smtp.gmail.com with ESMTPSA id j70-20020a638b49000000b005b44ac59b7bsm500574pge.70.2023.10.19.20.45.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 20:45:49 -0700 (PDT) Date: Fri, 20 Oct 2023 09:15:47 +0530 From: Viresh Kumar To: Ulf Hansson Cc: Viresh Kumar , Nishanth Menon , Stephen Boyd , linux-pm@vger.kernel.org, Vincent Guittot , "Rafael J. Wysocki" , Stephan Gerhold , Konrad Dybcio , Manivannan Sadhasivam , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] OPP: Use _set_opp_level() for single genpd case Message-ID: <20231020034547.suggwoefx5kauek4@vireshk-i7> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 19 Oct 2023 20:46:07 -0700 (PDT) On 19-10-23, 13:16, Ulf Hansson wrote: > On Thu, 19 Oct 2023 at 12:22, Viresh Kumar wrote: > > + /* > > + * There are two genpd (as required-opp) cases that we need to handle, > > + * devices with a single genpd and ones with multiple genpds. > > + * > > + * The single genpd case requires special handling as we need to use the > > + * same `dev` structure (instead of a virtual one provided by genpd > > + * core) for setting the performance state. Lets treat this as a case > > + * where the OPP's level is directly available without required genpd > > + * link in the DT. > > + * > > + * Just update the `level` with the right value, which > > + * dev_pm_opp_set_opp() will take care of in the normal path itself. > > + */ > > + if (required_table->is_genpd && opp_table->required_opp_count == 1 && > > + !opp_table->genpd_virt_devs) { > > + if (!WARN_ON(opp->level)) > > Hmm. Doesn't this introduce an unnecessary limitation? > > An opp node that has a required-opps phande, may have "opp-hz", > "opp-microvolt", etc. Why would we not allow the "opp-level" to be > used too? Such platforms need to call dev_pm_opp_set_config() with genpd names and it should all work just fine. The point is that we can't use the same `dev` pointer with another OPP table, i.e. device's dev pointer for the genpd's table here. -- viresh