Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp165390pxj; Tue, 15 Jun 2021 23:00:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpVjJCpvqgVeDD8+Nu9TshxofoRg48+DBozDC2aKy72hCYnlHMlUVSH1+wig8z9bSNEUBX X-Received: by 2002:a05:6402:10c6:: with SMTP id p6mr2074298edu.332.1623823207374; Tue, 15 Jun 2021 23:00:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623823207; cv=none; d=google.com; s=arc-20160816; b=AgrYtBtf+1gZevgt0LQxMOou+XysqygwwsAkvmLSRHKaoRCyGb9JIbkBUsBHd3mxTV ODXcBx1tHf0icei/V4RhQgSiLLDFdmg0CmKKj6b97GkbBSKecVzvz8bMI9sAZw8smBDw tp/xMKt6QSHRQKr/FvDVqw7jj5F5s+uYp8ONXGqFTHdfixZg9KiUt4n9/w6zO8CbYtyF Bdtqi8SfywgBpPS/sT4+iLZOCmDCs7C4+FHjdvVTpVxfgl5IdpKPvmdDczAkM+OEE9av 6S75RB4PGYvthLJiPAfTUtukT8sReTp9cIn7rC8XVgYxp3TTKOfuHh3OtG+fGjXO8hZk IfPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=7xvwoO8Ytc6MOpsNDQsCGNHeuXbvkCIDk/kxP7pcjQw=; b=exzttJxhgwA+NmTHGBmgHLj5+WNL8PvHO3KzxQ0HDqhCxGPX0EeHfixCvq0sAfAZub LW+dAGF+ky/+KxIp/nlo1tn6hZAWusTt/bcnGJbRIm5ipbNRzWFD59Xrp6KR4sw8gWOt VXmFa/iP1a/5w58/kCwF5sADN4D3uilKSdirVDjgaodJXU1A7S2QgMHt9Md647HBZ9VP FyxKLzUjoNaRt69SrCug2wkUulyQBOF+tOOLmA7OaWjSmjN8pfx7RlB6GDajBQ6tvPCR 07dB/9vfUyq+h8oQerVJcPLhTzfnon2AUfSjJVJD+dFVSNfcxkoKw4xWM7z9ywHMuZoB Ltaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iiWtZhTE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id fh1si1251627ejc.91.2021.06.15.22.59.45; Tue, 15 Jun 2021 23:00:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iiWtZhTE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231193AbhFPGAv (ORCPT + 99 others); Wed, 16 Jun 2021 02:00:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231162AbhFPGAu (ORCPT ); Wed, 16 Jun 2021 02:00:50 -0400 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39493C061574 for ; Tue, 15 Jun 2021 22:58:44 -0700 (PDT) Received: by mail-pj1-x1032.google.com with SMTP id ei4so1054617pjb.3 for ; Tue, 15 Jun 2021 22:58:44 -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=7xvwoO8Ytc6MOpsNDQsCGNHeuXbvkCIDk/kxP7pcjQw=; b=iiWtZhTEKSWgGjBEaDk01uj2vVqy8X4M33F63CNP79hOR7rBZpln+wYtpS5bvvVFtr BMqbp8n8jtGYVTnOiKN1amjbZKBlrHVPexshpSX6CIWImM/7923hmswcqYM1eidzKS3F HF+rJxOM8mxE7GjAPx2RJLwZXrkFAQZIHXyVlmO30ySOzFgsP7RNkRdFSc+LjohPN7MT CcTWCXzNGVDmw+vCsYZyhyBUMRU5+VR9h+SfVN0HCDu21R0ofQqlrAOsYq6+bbAnEGeA c7KNyOI8ZN5xSlrAw+G8QGgV4qmc7ucYRiXggi1wQrtdHRo6HJ8YqnstWiemdIfsuHxE QDlw== 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=7xvwoO8Ytc6MOpsNDQsCGNHeuXbvkCIDk/kxP7pcjQw=; b=MMMSDU/u9EkhcNLfVX53xJvji/M6YL48fjtSNqAeHJns6Vu40OCUyo4EAlgbgYkNtG ALYDTEV6HKn7QpDJsP8+6a5O41PrCmqt6bRhMNoV9ukeJ5GYbhWK0rGG9ekhCX5dIWak j/TtPfySVvx2eJirxus1KMkJ7zrYIBaNVejn1jh6yzHsBGJOeEVCFi3uJbOG+CAaPFPj g6/DJYw1NGQbMw+/QyjNxX67J+Nb8YtWSkmKaYeNkF0IjSO9qe1iJOW6DboxFFghXvbf XetuctvVp12n+DTATDl1/cuvvqBRvY5Pz34HYvidbBwUZHFbEbr0B/TLodELqdPIOgu3 m7pA== X-Gm-Message-State: AOAM530xCHArzncpxNzz3Plnf7b9vNPgsaQxBqx6sA9SGZR8XZYnPMuT hSPmClHxXg+8sUHFPYa0NeEFpg== X-Received: by 2002:a17:90b:1d06:: with SMTP id on6mr3350997pjb.50.1623823123716; Tue, 15 Jun 2021 22:58:43 -0700 (PDT) Received: from localhost ([136.185.134.182]) by smtp.gmail.com with ESMTPSA id m1sm1010827pgd.78.2021.06.15.22.58.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Jun 2021 22:58:43 -0700 (PDT) Date: Wed, 16 Jun 2021 11:28:41 +0530 From: Viresh Kumar To: Hsin-Yi Wang Cc: "Viresh Kumar )" , Chanwoo Choi , Nishanth Menon , Stephen Boyd , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, "andrew-sh . cheng" Subject: Re: [PATCH] opp: of: Allow lazy-linking of required-opps to non genpd Message-ID: <20210616055841.4m7y6nxnxbgw5rzi@vireshk-i7> References: <20210616053335.4181780-1-hsinyi@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210616053335.4181780-1-hsinyi@chromium.org> User-Agent: NeoMutt/20180716-391-311a52 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16-06-21, 13:33, Hsin-Yi Wang wrote: > Don't limit required_opp_table to genpd only. One possible use case is > cpufreq based devfreq governor, which can use required-opps property to > derive devfreq from cpufreq. > > Suggested-by: Chanwoo Choi > Signed-off-by: Hsin-Yi Wang > --- > This is tested with the non genpd case mt8183-cci with passive > governor[1]. > [1] https://patchwork.kernel.org/project/linux-mediatek/patch/1616499241-4906-2-git-send-email-andrew-sh.cheng@mediatek.com/ > --- > drivers/opp/of.c | 20 +------------------- > 1 file changed, 1 insertion(+), 19 deletions(-) > > diff --git a/drivers/opp/of.c b/drivers/opp/of.c > index aa75a1caf08a3..9573facce53a5 100644 > --- a/drivers/opp/of.c > +++ b/drivers/opp/of.c > @@ -201,17 +201,6 @@ static void _opp_table_alloc_required_tables(struct opp_table *opp_table, > lazy = true; > continue; > } > - > - /* > - * We only support genpd's OPPs in the "required-opps" for now, > - * as we don't know how much about other cases. Error out if the > - * required OPP doesn't belong to a genpd. > - */ > - if (!required_opp_tables[i]->is_genpd) { > - dev_err(dev, "required-opp doesn't belong to genpd: %pOF\n", > - required_np); > - goto free_required_tables; > - } > } > > /* Let's do the linking later on */ > @@ -379,13 +368,6 @@ static void lazy_link_required_opp_table(struct opp_table *new_table) > struct dev_pm_opp *opp; > int i, ret; > > - /* > - * We only support genpd's OPPs in the "required-opps" for now, > - * as we don't know much about other cases. > - */ > - if (!new_table->is_genpd) > - return; > - > mutex_lock(&opp_table_lock); > > list_for_each_entry_safe(opp_table, temp, &lazy_opp_tables, lazy) { > @@ -873,7 +855,7 @@ static struct dev_pm_opp *_opp_add_static_v2(struct opp_table *opp_table, > return ERR_PTR(-ENOMEM); > > ret = _read_opp_key(new_opp, opp_table, np, &rate_not_available); > - if (ret < 0 && !opp_table->is_genpd) { > + if (ret < 0) { > dev_err(dev, "%s: opp key field not found\n", __func__); > goto free_opp; > } How are you setting the required OPPs ? I mean when someone tries to change frequency of a device which has some required-opps, who is configuring those required OPPs ? -- viresh