Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp654068pxb; Tue, 2 Feb 2021 14:29:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJxxsX15NmvVjNa4LvaOpyBwiaBei+n1YYi6fFgC/3nylPCAYqq3TAiY1e3nLnb2nuNlNgWK X-Received: by 2002:a17:906:16c6:: with SMTP id t6mr202526ejd.102.1612304967399; Tue, 02 Feb 2021 14:29:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612304967; cv=none; d=google.com; s=arc-20160816; b=aJGvELN1KtYjQV3Jv3/G5/sle6SLU9hd0rDvxbNyRxleYwYhwrySdtSUYOk1/nPy5I W1Ri7szs65ey8GHTzlA/wb+sAh0u5vAN4qMb8ECAmZ+aAIKNyw+aa8jd1F8vuyTc0g19 QJV73yaZhX+xufGLuhKw22DxQfLBhTEexpsTiXjqG6cMH5ZgG86+V0cX4AGN3zbV0EpZ 3bj09eMxhQKzdRLRWfBE1DwwteOEL2zzpk6CAuzt7zHvI+TBc3ixIHhJdS5VZbDVlurZ IBSqt3VNdnNhor5+e1Q7qS4OEfCAEO8eFZowhAmF0pOS+6BRakShosgI6HgFhmP4qZ/u QDAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=vYUV1ZIX9QHcq7cT4PQeTY0T8+QXvLCCqS+zwBi03zA=; b=bjXROFkWVWtR59GG7ORTcWI9+f6gLQON/uQLpoDYvqqBMAEsDNcWUK7I4D4sCbv5lC 7utNJfJBTA8FCxeXtN0VfBgvN7hCI+lHhAQ3JSham+SD/2wFOArIov4DjyvlWe5Aw3bW gyaDkjWpCROusn3pIN9CRSLmWaxWcLxjC3fvU8kzsz1TiQYzhXJpwn7sOfT/soEc+dh6 DTpPwvBV9NtYnITuLWPFKyYkfe2J0+Z9UWnpM9BFJSQHJNXsoTXSs7zWidi6qybZHVWG SfIY93bRTcffNoV8qbojoYP/o5MrKtdo8sVxu7lgynB2K7O7K6n23Kzn7vmy/1r/rY25 +ohA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s8si50706edd.534.2021.02.02.14.28.59; Tue, 02 Feb 2021 14:29:27 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234765AbhBBOmj (ORCPT + 99 others); Tue, 2 Feb 2021 09:42:39 -0500 Received: from foss.arm.com ([217.140.110.172]:51166 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234479AbhBBOhG (ORCPT ); Tue, 2 Feb 2021 09:37:06 -0500 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 1B98811B3; Tue, 2 Feb 2021 06:36:20 -0800 (PST) Received: from [10.57.35.108] (unknown [10.57.35.108]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 687433F718; Tue, 2 Feb 2021 06:36:18 -0800 (PST) Subject: Re: [PATCH V3 02/14] coresight: Do not scan for graph if none is present To: Mike Leach , Anshuman Khandual Cc: linux-arm-kernel , Coresight ML , Mathieu Poirier , Linu Cherian , Linux Kernel Mailing List References: <1611737738-1493-1-git-send-email-anshuman.khandual@arm.com> <1611737738-1493-3-git-send-email-anshuman.khandual@arm.com> From: Suzuki K Poulose Message-ID: <81648285-a321-173f-a0da-6ba0bc077abf@arm.com> Date: Tue, 2 Feb 2021 14:36:05 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mike On 2/2/21 11:10 AM, Mike Leach wrote: > Hi Ansuman, > > On Wed, 27 Jan 2021 at 08:55, Anshuman Khandual > wrote: >> >> From: Suzuki K Poulose >> >> If a graph node is not found for a given node, of_get_next_endpoint() >> will emit the following error message : >> >> OF: graph: no port node found in / >> >> If the given component doesn't have any explicit connections (e.g, >> ETE) we could simply ignore the graph parsing. >> >> Cc: Mathieu Poirier >> Cc: Mike Leach >> Signed-off-by: Suzuki K Poulose >> Signed-off-by: Anshuman Khandual >> --- >> drivers/hwtracing/coresight/coresight-platform.c | 6 ++++++ >> 1 file changed, 6 insertions(+) >> >> diff --git a/drivers/hwtracing/coresight/coresight-platform.c b/drivers/hwtracing/coresight/coresight-platform.c >> index 3629b78..c594f45 100644 >> --- a/drivers/hwtracing/coresight/coresight-platform.c >> +++ b/drivers/hwtracing/coresight/coresight-platform.c >> @@ -90,6 +90,12 @@ static void of_coresight_get_ports_legacy(const struct device_node *node, >> struct of_endpoint endpoint; >> int in = 0, out = 0; >> >> + /* >> + * Avoid warnings in of_graph_get_next_endpoint() >> + * if the device doesn't have any graph connections >> + */ >> + if (!of_graph_is_present(node)) >> + return; > > The problem here is that you are masking genuine errors. If the graph is not described for a component, where it is mandatory, it won't be usable by the driver and as such using the devices will fail. e.g, if an ETM misses the bindings, tracing will fail. (in either mode). > The solution is to either call this only if the device type is one > that ports are not required - i.e. ETE, or upgrade the .dts bindings The proposed change is too invasive and is not worth the benefit that it brings. The side effect of this patch is, if someone makes a mistake in the bindings they don't see the "warning" in the dmesg. But will definitely hit the issue when trying to use the system. i.e, Functionally there is no change. On the other hand issuing a warning message for ETE is confusing for a well behaved user. > for the rest of the ETM devices to yaml so that the ports requirement > is checked and validated there. This is a step that we must take, but in a separate series. And I don't think this will solve handling non-compliant DTs *immediately*, as there could be : a) DTS that are not upstream (Quite common for CoreSight) b) People are getting used to the schema and running schema checks. So, personally I vote for : 1) Merge this patch in as is 2) Convert the bindings to Yaml in a separate series. Suzuki