Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4807127pxu; Tue, 22 Dec 2020 01:01:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJySWmbELSY246PTD3ypBMMzsLgj9Gyv8l4fDxMJeTXsr9XVv5nWtBbE6MtREdpuAAqnTwNh X-Received: by 2002:a50:f604:: with SMTP id c4mr20251243edn.307.1608627670851; Tue, 22 Dec 2020 01:01:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608627670; cv=none; d=google.com; s=arc-20160816; b=tyT63LSf6Y0qmR4BtIMigJNK13ouc943a+ZnlU9tqEOP4jtuyAJ/kTaYloLXEg9zLk cNuVovWLESCvnCi1uXR5R9a9JWM/9GoF8+fAUTwTCgBh6PS9w/9vS7ecl8Wtj0TSu7y3 c6HMLzH2Mc3wIxa9Lob0nYQOX2V+4bE1EosFR0Ymv8WPx4vU+LhMWEObi3sD+X7VZjgg ygUs1afReEnkc05q8Wuy6OU2XOEEv6RyTpduDPlqm6Zm5d1ZC9BuwEn+F3CxqpsXCoIf iSDA9Ms1uyMM8GFzzm7a4s/Hw+506CnUSoorEG0hX/d6etlvzB7BP9fNOfFvsT7QUcr0 JMEQ== 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=RHvyko5iU5xg8Cz45AVBchwM4SDGk3Y/8Etp7zQo/0E=; b=UDN3l3TU7XvMiyFRiejZShvm5DLbLBFoXpKguUj/kyR5slywLU27FsUWmwMQ+xJMtU i5+Vd4Qz4u1hsVBGWs7bmd+uaKXeyO8l3/5Ph4K+RPpLST2MhcgZ2QTHFS2ooHWdLILc uK3ngyclX2IwqJ6Nsvl6DEeZCbI+sWfBKx2/oZp6GEQttnvn+DWuPz6zmOi8XvqyUnra mjBKViOaDgclrRJozC5s3VP+gEdOqYOXNDBNpLSB0rjmESr1UjvIEDvv3l3x9k9Gh50+ LSrWSwhZ2S4QoJGZPioL9x2XBl1oVk7OPHTRaaNCF6Zhdr1+Y609VyuzrHfx08Jyrkns GJTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LfPP06TV; 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 ck10si11776332edb.568.2020.12.22.01.00.41; Tue, 22 Dec 2020 01:01:10 -0800 (PST) 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=LfPP06TV; 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 S1726032AbgLVJAY (ORCPT + 99 others); Tue, 22 Dec 2020 04:00:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726021AbgLVJAY (ORCPT ); Tue, 22 Dec 2020 04:00:24 -0500 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E30D3C0613D6 for ; Tue, 22 Dec 2020 00:59:43 -0800 (PST) Received: by mail-pj1-x1035.google.com with SMTP id lj6so986614pjb.0 for ; Tue, 22 Dec 2020 00:59:43 -0800 (PST) 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=RHvyko5iU5xg8Cz45AVBchwM4SDGk3Y/8Etp7zQo/0E=; b=LfPP06TVJTEK4xWL0o4Uusz6IXwXzk8z3S6CPrE/vyZ9qoOMFRUyzQJWUKQxWhuG/E wY5edJUerDgkww2zd4lzbce6lRCficFwzejWrQiDZi/xwHlgy96zpj6C8ioFq0ZrQXBk mSOkM2U+2pDJWLqA+j7R2srsKaCnOdyMwev89OKW8IKEfkAPs6AL+3xqznBpqvwnQ0NT fjm9Rb+Xfn10diw8TlqXQy8/GkenTeXEg9jbL1dOeVHP/+gjymWREs9O4mMhUSRkCgx+ FWO4nhtVc54saAG5QAt6VsqTuAXLPGXWUixoDkMsUGzE1xB0aRN/Z6i4X+no1fBNw+u5 gkcg== 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=RHvyko5iU5xg8Cz45AVBchwM4SDGk3Y/8Etp7zQo/0E=; b=e3TeMeKhEsD/+wMCpQ9nD2Ycv/5YGo99SZk13eNjaSFpfOoU03Yx8c7er3enyVU5zy kapHo8yBg6jZR3vtqggczuxBmdQr9G9sEswHW0h0qJtvUrUGec15VrkIaZQ2H8vzNLhu ecjRV1uogLr+qz++ddeOmP2N8q3CQ2kZnC5IBB2yCi5jbcuaJVCuX/yZmqlsOVFUYzz+ bD1OnXGM3XS8K2io4+BRl9Np3X2bhMt+PFVOt4g3JFsHNg+Txh5v0pTGaq4MccGZfyDv XqM+F8UDElo+LUiTMQ5LTuttYMfsD2VpZ+tKnA0G+4zzuwdt3D2N2fzyUonqMCHTq14r cHiA== X-Gm-Message-State: AOAM5335g9LM6aEuBQ7hP07FPQUVAvy9Juqpn+BBCV7E2LLSm0SIEZKC AqVkRk2uTpW+ZcH95PHaCWDMrQ== X-Received: by 2002:a17:902:c584:b029:da:cc62:22f1 with SMTP id p4-20020a170902c584b02900dacc6222f1mr20408042plx.54.1608627583415; Tue, 22 Dec 2020 00:59:43 -0800 (PST) Received: from localhost ([122.172.20.109]) by smtp.gmail.com with ESMTPSA id x4sm19796659pgg.94.2020.12.22.00.59.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Dec 2020 00:59:42 -0800 (PST) Date: Tue, 22 Dec 2020 14:29:40 +0530 From: Viresh Kumar To: Dmitry Osipenko Cc: Thierry Reding , Jonathan Hunter , Mark Brown , Liam Girdwood , Ulf Hansson , Mauro Carvalho Chehab , Rob Herring , Peter Geis , Nicolas Chauvet , Krzysztof Kozlowski , "Rafael J. Wysocki" , Kevin Hilman , Peter De Schrijver , Viresh Kumar , Stephen Boyd , Michael Turquette , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, linux-tegra@vger.kernel.org, linux-clk@vger.kernel.org Subject: Re: [PATCH v2 14/48] opp: Filter out OPPs based on availability of a required-OPP Message-ID: <20201222085940.y625zxee4tevbqm5@vireshk-i7> References: <20201217180638.22748-1-digetx@gmail.com> <20201217180638.22748-15-digetx@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201217180638.22748-15-digetx@gmail.com> User-Agent: NeoMutt/20180716-391-311a52 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17-12-20, 21:06, Dmitry Osipenko wrote: > A required OPP may not be available, and thus, all OPPs which are using > this required OPP should be unavailable too. > > Signed-off-by: Dmitry Osipenko > --- > drivers/opp/core.c | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) Please send a separate patchset for fixes, as these can also go to 5.11 itself. > diff --git a/drivers/opp/core.c b/drivers/opp/core.c > index d9feb7639598..3d02fe33630b 100644 > --- a/drivers/opp/core.c > +++ b/drivers/opp/core.c > @@ -1588,7 +1588,7 @@ int _opp_add(struct device *dev, struct dev_pm_opp *new_opp, > struct opp_table *opp_table, bool rate_not_available) > { > struct list_head *head; > - int ret; > + int i, ret; > > mutex_lock(&opp_table->lock); > head = &opp_table->opp_list; > @@ -1615,6 +1615,15 @@ int _opp_add(struct device *dev, struct dev_pm_opp *new_opp, > __func__, new_opp->rate); > } > > + for (i = 0; i < opp_table->required_opp_count && new_opp->available; i++) { > + if (new_opp->required_opps[i]->available) > + continue; > + > + new_opp->available = false; > + dev_warn(dev, "%s: OPP not supported by required OPP %pOF (%lu)\n", > + __func__, new_opp->required_opps[i]->np, new_opp->rate); Why not just break from here ? > + } > + > return 0; > } > > -- > 2.29.2 -- viresh