Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp4119841ybd; Tue, 25 Jun 2019 14:34:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqzzQajQb1XqXivmBm8L5s2OlVg0BWOGwiaYBUoaaw9Vq9WEWJoncyAFl/qU0vn31X5Lu+a9 X-Received: by 2002:a17:902:148:: with SMTP id 66mr827017plb.143.1561498455860; Tue, 25 Jun 2019 14:34:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561498455; cv=none; d=google.com; s=arc-20160816; b=qpU0JUnu9pePUIndQqwyx81TQ7NkP4h8T893OWSSIbsZFlMGS/6vTQmdD8L5BIGs0u 4AV74LqsFgog9AHITQsnzHedj2bNseikrNUm1Ccri4xt4ZKatbK98Sp05F519j085fOO vG10/kw8L8PO3K94gDg7dZYURvIqolUHnCyateLo5qwpDtr1kY61Se6Gt4b+Lgu/Ky22 TA+VLg5yJ96uw/o7yBFjXqt2ilpLRKoGCrVGidpg8T98FSRWk6oLVCn49HKutZpYt1e7 SUEJ4WwKXmDW837jmVe3Ll3AnmHZRjxpjgMrrO8UU5wXeZYksXeZ4yMrcDo0KT+rLk1e 42Ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:references :mime-version:message-id:in-reply-to:date:dkim-signature; bh=diT5j67eq/c/BsDoIxqIkGMzy6KvSDn7bQJLbufPm+c=; b=c91u9243WGg1PiGax696cCHyoHA2BnlC3ao2d2AP+YGUcZ/42G2P3AKXe4Vc+NN7GN MsbOh7ZBjChbulOMTscqoq6jRcSOiAvy0UJtdn3CE/w+eaDjQ7aLOpalz6nQShT6ezxw X+1XGeGt5spyI8CoGz1js/EkM9nXWRj/U1e3/ZqaSrBe1+zjsA1NO3Q4hJHCs8iGvqDS XMwYN42n3AlJqm3gHD3CKaq3WShLfrpeRuv/2apMuxDR/Mm2Olu2ZRNT812ygJ7VJALK zdvErJaLTliONAzqo+GRa54WUkxAUCpAKH8RVTHScObX6RSOaD/VoW0lnfEnLu4u4aAT UsOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Qt2GyuTO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w12si1210433plq.92.2019.06.25.14.33.58; Tue, 25 Jun 2019 14:34:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Qt2GyuTO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726370AbfFYVdr (ORCPT + 99 others); Tue, 25 Jun 2019 17:33:47 -0400 Received: from mail-pl1-f202.google.com ([209.85.214.202]:32982 "EHLO mail-pl1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726331AbfFYVdq (ORCPT ); Tue, 25 Jun 2019 17:33:46 -0400 Received: by mail-pl1-f202.google.com with SMTP id f2so29159plr.0 for ; Tue, 25 Jun 2019 14:33:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=diT5j67eq/c/BsDoIxqIkGMzy6KvSDn7bQJLbufPm+c=; b=Qt2GyuTO7pTaIYstjFLkJ4UcWzoUKoZj4qXob3li6BuGiuKeH50eLMmsx/LxWdsWLA oecwexwecInCXpqVHrwJlB4oAOh+bGLiUQ7Ec4LJU+29OlER1pH1x3YVV0RvrcOgm7KW vI2ZTO9GPmN98FDlAFxgVgIwLUitzndyN5zxbeY1PhbYfBoi8r0f8IIAtmRh6ywTaa76 UpVrAJkLoVqes/Tv9AOUt81P8QMCOlNI3ggTX7v9EgbJIuZiRmlDd1k+MnS3316TxoeS gwcZxmG5mkTa+WNatLkSNvEXmvBi5LZgTzem7X7JYmp2q1tpK8W9NiJk7MDucsTcG70S 3ZwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=diT5j67eq/c/BsDoIxqIkGMzy6KvSDn7bQJLbufPm+c=; b=pQD1qXEmH0nmXR+qpV12GCU6j6XDgPEB9N0LLADxBV0Y3TGq64VvjzRcDpWx/GT18C 8jIO02Xlpihf98S4xdVLxtDCvwKQT0Nd7AsjwRxJK3byiK2S+Ma1YwaeyJxejkjAzHP5 LfrJH/QZb8P7KH5eNW/LXp4875+cFklspQfy1DC8kV37tXo+G4afTweHQNUv/ujKrCXQ 832g+Zs4AjfqTJ5gqdu7WlT14wnmBOfmiKeXBtrbRshZUSUj8gbLNw6CfMMhILpA7gWh x42BgmYK1h2b3/nPLN6Mbfu26HDciW+3o2/VsVyT6a1t35p1LiyG1MhSvNXY5wEdZJPs W6MA== X-Gm-Message-State: APjAAAXT2R9tyQouyRYQbB5D4WjZu3uYECJH85n/Yu7mapFQC8BWTJTi Iix5RL0+TKUzO0HRoSf/v+n7o9Tk5SL56yI= X-Received: by 2002:a63:231a:: with SMTP id j26mr40088869pgj.389.1561498425029; Tue, 25 Jun 2019 14:33:45 -0700 (PDT) Date: Tue, 25 Jun 2019 14:33:34 -0700 In-Reply-To: <20190625213337.157525-1-saravanak@google.com> Message-Id: <20190625213337.157525-2-saravanak@google.com> Mime-Version: 1.0 References: <20190625213337.157525-1-saravanak@google.com> X-Mailer: git-send-email 2.22.0.410.gd8fdbe21b5-goog Subject: [PATCH v2 1/4] OPP: Allow required-opps even if the device doesn't have power-domains From: Saravana Kannan To: MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Viresh Kumar , Nishanth Menon , Stephen Boyd , "Rafael J. Wysocki" Cc: Saravana Kannan , kernel-team@android.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A Device-A can have a (minimum) performance requirement on another Device-B to be able to function correctly. This performance requirement on Device-B can also change based on the current performance level of Device-A. The existing required-opps feature fits well to describe this need. So, instead of limiting required-opps to point to only PM-domain devices, allow it to point to any device. Signed-off-by: Saravana Kannan --- drivers/opp/core.c | 2 +- drivers/opp/of.c | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/opp/core.c b/drivers/opp/core.c index 0e7703fe733f..74c7bdc6f463 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -710,7 +710,7 @@ static int _set_required_opps(struct device *dev, return 0; /* Single genpd case */ - if (!genpd_virt_devs) { + if (!genpd_virt_devs && required_opp_tables[0]->is_genpd) { pstate = opp->required_opps[0]->pstate; ret = dev_pm_genpd_set_performance_state(dev, pstate); if (ret) { diff --git a/drivers/opp/of.c b/drivers/opp/of.c index c10c782d15aa..7c8336e94aff 100644 --- a/drivers/opp/of.c +++ b/drivers/opp/of.c @@ -195,9 +195,6 @@ static void _opp_table_alloc_required_tables(struct opp_table *opp_table, */ count_pd = of_count_phandle_with_args(dev->of_node, "power-domains", "#power-domain-cells"); - if (!count_pd) - goto put_np; - if (count_pd > 1) { genpd_virt_devs = kcalloc(count, sizeof(*genpd_virt_devs), GFP_KERNEL); @@ -226,17 +223,6 @@ static void _opp_table_alloc_required_tables(struct opp_table *opp_table, if (IS_ERR(required_opp_tables[i])) goto free_required_tables; - - /* - * 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; - } } goto put_np; -- 2.22.0.410.gd8fdbe21b5-goog