From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4923BC00A89 for ; Mon, 2 Nov 2020 12:04:30 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A07F722226 for ; Mon, 2 Nov 2020 12:04:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="cmMCi/YI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A07F722226 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=njzLc5H9cpBKZT3STJAZ5H7wk5uiCxHXj3ganA4tlVo=; b=cmMCi/YIbRpxXN27yFfZ6uA2h h++KOLYGLpyavTGVHtvzc+Yj39vMrwn59MqvWRkLqBlp+is+PGxg+4PJkCLywNUp26sBcVSjHjXCW n8vldiNsICweGpXa0E5S8h55w8VR/khVKxYFpPZGDDpbp15hg9ds/Eqfew75PY5Wa453wXHmwrPU0 HeBGQch4sQZGyWdcgB9w/Jvz+MzR+VLesneknouUOQe88pRLYtkXm3MNNnWViTOiWzBq2maf1z3dU VJYvsjKpqVC7OuGWEwy/JZXj7ZX/Bv5PwZBdc9wFq58yny0BCQfDyom03x+r3VVuqP85njYs12QkC 5+1LsEImA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kZYXJ-00015P-UI; Mon, 02 Nov 2020 12:02:10 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kZYXE-000142-Qa for linux-arm-kernel@lists.infradead.org; Mon, 02 Nov 2020 12:02:06 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 341E030E; Mon, 2 Nov 2020 04:02:02 -0800 (PST) Received: from ubuntu.arm.com (unknown [10.57.53.184]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id DF3683F66E; Mon, 2 Nov 2020 04:01:59 -0800 (PST) From: Nicola Mazzucato To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, sudeep.holla@arm.com, rjw@rjwysocki.net, vireshk@kernel.org, robh+dt@kernel.org, sboyd@kernel.org, nm@ti.com, daniel.lezcano@linaro.org Subject: [PATCH v3 2/3] opp/of: Allow empty opp-table with opp-shared Date: Mon, 2 Nov 2020 12:01:14 +0000 Message-Id: <20201102120115.29993-3-nicola.mazzucato@arm.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201102120115.29993-1-nicola.mazzucato@arm.com> References: <20201102120115.29993-1-nicola.mazzucato@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201102_070204_994173_A7933367 X-CRM114-Status: GOOD ( 16.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: chris.redpath@arm.com, morten.rasmussen@arm.com, nicola.mazzucato@arm.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The opp binding now allows to have an empty opp table and shared-opp to merely describe a hw connection among devices (f/v lines). When initialising an opp table, allow such case by: - treating some errors as warnings - do not mark empty tables as shared - don't fail on empty table Signed-off-by: Nicola Mazzucato --- drivers/opp/of.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/opp/of.c b/drivers/opp/of.c index 874b58756220..b0230490bb31 100644 --- a/drivers/opp/of.c +++ b/drivers/opp/of.c @@ -157,6 +157,11 @@ static void _opp_table_free_required_tables(struct opp_table *opp_table) /* * Populate all devices and opp tables which are part of "required-opps" list. * Checking only the first OPP node should be enough. + * + * Corner case: empty opp table and opp-shared found. In this case we set + * unconditionally the opp table access to exclusive, as the opp-shared property + * is used purely to describe hw connections. Such information will be retrieved + * via dev_pm_opp_of_get_sharing_cpus(). */ static void _opp_table_alloc_required_tables(struct opp_table *opp_table, struct device *dev, @@ -169,7 +174,9 @@ static void _opp_table_alloc_required_tables(struct opp_table *opp_table, /* Traversing the first OPP node is all we need */ np = of_get_next_available_child(opp_np, NULL); if (!np) { - dev_err(dev, "Empty OPP table\n"); + dev_warn(dev, "Empty OPP table\n"); + + opp_table->shared_opp = OPP_TABLE_ACCESS_EXCLUSIVE; return; } @@ -377,7 +384,9 @@ int dev_pm_opp_of_find_icc_paths(struct device *dev, struct icc_path **paths; ret = _bandwidth_supported(dev, opp_table); - if (ret <= 0) + if (ret == -EINVAL) + return 0; /* Empty OPP table is a valid corner-case, let's not fail */ + else if (ret <= 0) return ret; ret = 0; -- 2.27.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel