Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp496261ybi; Thu, 13 Jun 2019 21:18:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqxceB0y8crVv5NeoSfzybO3f+PLOezFWIxpIeo7KolPa0Pqo1jbx1Jodh6yqXqyqcmVczf4 X-Received: by 2002:a63:1316:: with SMTP id i22mr34997567pgl.274.1560485890767; Thu, 13 Jun 2019 21:18:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560485890; cv=none; d=google.com; s=arc-20160816; b=Tzz0iQ3txqTRMtD3huPag/INZ4mDbZ4NB2uUWOkT6fVOGvm3hYKP8wSmhE7Yquzdxl gmpJTc93NVQ76yw7Kat9EPHFv5xKEhqkFZJpufaF2jjsLuIAJY2UFLWeKgh5OqphKzQm lFUEkKHsfb69f4s4q4q8MW186tFOakdkihXJg8vLV1HTlbtxXU9bMW/nxW6hhN6KKLej lHczZBaJvIIpi4yPDgFRsQUlgUo+BxtqCcp1yCteEnHVXzeW+z4nqTLDJlwmQt+0DZEQ B8dHuKydU248+p4J6QPaXMka4J+tPftz10QplIkIUDAQmIOV73REhGFXqrRrsiZKDmT3 i3eg== 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=nT/RN++hgSEY1oFXDZU2+2vA7A3kNiWfnEI7MgbZhNk=; b=i4kfX7H5Zb9VjD7JMA9TZEFlmYcWr3ZYQLmlkGjkul8n2u5TtccRRCPMP6GHl7iowO gAYIf1L8PmQFPlVaM1aLpwd0QfU90g5389ZxvnABYfc2PDy0YqYPT9XyWQIYwT3nlASn Y5ilRmG11FNoBkH5z3HHR5Kt4POfWvMRCnFsidfh8zQN2a0kIBTWysnrqj0eowAr3sFK SSamWPEtY60yCQoXLs9tNws1JUsznQlsgr+fg0ouxpHZaUld9bDSw2r/eT8LhNYyJ+Ke FZxJoMEcRYiP4cf+yglizkX4LYJiHB3MKiBz1PeaMZi1O5jX/ybO2bl35FEHpbCX88ta 1O6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="n5yi/fsS"; 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 f3si398760plr.187.2019.06.13.21.17.47; Thu, 13 Jun 2019 21:18:10 -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="n5yi/fsS"; 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 S1725972AbfFNERn (ORCPT + 99 others); Fri, 14 Jun 2019 00:17:43 -0400 Received: from mail-qk1-f201.google.com ([209.85.222.201]:42760 "EHLO mail-qk1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725886AbfFNERm (ORCPT ); Fri, 14 Jun 2019 00:17:42 -0400 Received: by mail-qk1-f201.google.com with SMTP id l16so1002787qkk.9 for ; Thu, 13 Jun 2019 21:17:42 -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=nT/RN++hgSEY1oFXDZU2+2vA7A3kNiWfnEI7MgbZhNk=; b=n5yi/fsSkLPZsXmOhD6VaVWd4K75Sp6QVYZWyYN4AtitTODNfEvka82I6ouh9pIllG dByhWETJ+8aEVnytSO/6g5UZ468kBNbvHIY8phwEkAWG2tZrVyIT0IsUTnuJQzR3aN5e XLV3Bp8RtbiNIhG4M2j+89d4S8rQhOaXxXhPxrP4R3GuFvA3KrIT2TCwKcbf5jWgDRdY hXKGsyRZDlYUqE42uRR1Cxv/vlIoapqsipres07YeHegPtQ6LxBQwOSWtvBOezOpgD3I Qu28AYiZTS3TgBTeUizjfUrhu0yM3b2DuiIp11SST0LVUveEP+ZUo3ggXGNYrpastq/N 2/jA== 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=nT/RN++hgSEY1oFXDZU2+2vA7A3kNiWfnEI7MgbZhNk=; b=Ujt4bRZv7zh70M2vvpNM3n28G1P8235KIMJ9YyKd1e/WRdSRoi1WuppFGd9OWQXM1R Np1fcmWTKD8FYCtM/fNV7Dt1x3r9ZNOHN+Hi4Sok7VOlWaMPaq28h1tS10MxGadDJSmh GgCHaKVVmWiHYzv2i5sC7Be8o4yyI+kiNzjOzXJUyty4qySv3VHK+HDFaBh+dl8ygudC SyOlPkkUeIzXAYtU8wYU9iPjPh5uz5PSffqBOrORdFltpbe7+Z2lDEsNU6w29kCn/Rb9 7D8XSSISrSpnOo38+JcPE6bq7Vhq9KhTylb2zAJIkqh2aGpBJ9ywn7sDjrOD4fEDUGCF xs+g== X-Gm-Message-State: APjAAAUprFGtKj9JmAzJJS5ZccmhlkPJbhh/RBSF0QDwgF9irwUad57c 3hawWbxjwB4r/QfDRd4ke47sP5USKWrk+ao= X-Received: by 2002:ac8:1a9d:: with SMTP id x29mr79446143qtj.128.1560485861512; Thu, 13 Jun 2019 21:17:41 -0700 (PDT) Date: Thu, 13 Jun 2019 21:17:23 -0700 In-Reply-To: <20190614041733.120807-1-saravanak@google.com> Message-Id: <20190614041733.120807-2-saravanak@google.com> Mime-Version: 1.0 References: <20190614041733.120807-1-saravanak@google.com> X-Mailer: git-send-email 2.22.0.rc2.383.gf4fbbf30c2-goog Subject: [PATCH v2 01/11] OPP: Allow required-opps even if the device doesn't have power-domains From: Saravana Kannan To: Georgi Djakov , Rob Herring , Mark Rutland , Viresh Kumar , Nishanth Menon , Stephen Boyd , "Rafael J. Wysocki" , MyungJoo Ham , Kyungmin Park , Chanwoo Choi Cc: Saravana Kannan , Rajendra Nayak , Jordan Crouse , vincent.guittot@linaro.org, bjorn.andersson@linaro.org, amit.kucheria@linaro.org, seansw@qti.qualcomm.com, daidavid1@codeaurora.org, evgreen@chromium.org, sibis@codeaurora.org, kernel-team@android.com, linux-pm@vger.kernel.org, devicetree@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.rc2.383.gf4fbbf30c2-goog