Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4572976imm; Mon, 11 Jun 2018 14:58:19 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIEr0nWPOYC8QWY52XZ7nx51zw+zngATNzJ2k2LUgCX5YDXqWkm7iqw8I8Z/eSqQL5brPWq X-Received: by 2002:a63:27c6:: with SMTP id n189-v6mr800170pgn.164.1528754299457; Mon, 11 Jun 2018 14:58:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528754299; cv=none; d=google.com; s=arc-20160816; b=VwBG8upGwrb3+KFWlyA62F/c/AaRAimKrzKFvaJV+nmWtw3RGbWBpMMazJoimQcJzq j7rUzjm340rB8ZOitu2+eNTFsfBxiyjeMfT5faYcyYoVhvGS/36c1MU+mEfus0NVg1PY My49cBqW55c6brdyHvCQmo9jIp8TAgGO7JkX7LuvG8ubTHYV/BtyOEM3/wGtMu+zw6Yg y2Up0o2largo+ZMPEgjrl23NQ5R0nDmSUYER6rzkusk8cPoSj2tyTuZcHl4JfDgeIYPL vgOHX+TWOtzWZxlO8ZgoAdEYoFugUQZSzR6a6FEUN4fSGW1ECvF7VZrE8SUzXa6kP3zQ c+SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=cDfYUgcbqdWDJ4VcyTWS+v9n0G4kAUF/CFANjJEwcBU=; b=GLKh0PnFeemHxDEvs/dhaqHNvc97VJFK35EBcRc2qiBB4G0uzQuN910uU/XiU1yuAt 9Crq4j3/0JcA0u8xABCHV/vLIQ7kYIAqF6vVqn5A92SXrCmnn0ziGY0W88CE3l/CxLxh gVpF06gfar0QQzop8Q8cH/ZH+Ic2z0lAPv2fJhCc87xcL8WKvyiZbm9lW1gVpQBJu3tb 6hYrtJOYKFOoqFui+HJi54jQqK4xfHHXvVM+mRc+IYtDkoj8fXeGl+w8eTqAmwto3o1d FMJYE1Vgq34KjdwGKiRyXDYRNcPjkRxV2sPj1XWkklZfH2cLb3XNCbz1z1BpoK/4e7l9 2bWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VXl3UgtT; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a8-v6si6589862pgu.544.2018.06.11.14.58.04; Mon, 11 Jun 2018 14:58:19 -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=@linaro.org header.s=google header.b=VXl3UgtT; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934574AbeFKVvP (ORCPT + 99 others); Mon, 11 Jun 2018 17:51:15 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35584 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934508AbeFKVvN (ORCPT ); Mon, 11 Jun 2018 17:51:13 -0400 Received: by mail-wm0-f66.google.com with SMTP id j15-v6so19400299wme.0 for ; Mon, 11 Jun 2018 14:51:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=cDfYUgcbqdWDJ4VcyTWS+v9n0G4kAUF/CFANjJEwcBU=; b=VXl3UgtTpO2BSM1Z7g5fiefMbdWwEfGyF4232joL4A1g9ZCZiAN6ngUGvMkxIYuwUV bBiqLqreHBUQbrDRcWvLCFGMQFwWZVpI1utwd8Y8bNjY32J+dlmLhaLPEvCj0frh/uyJ me7FtJNgS0mUj5YoV5/F4EfYB3IJR8JvMpSic= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=cDfYUgcbqdWDJ4VcyTWS+v9n0G4kAUF/CFANjJEwcBU=; b=pdzrQCzlUih00sTyrMHoVuwE/KzbIOb63oj9+Y3yYL8URv0oathQ0+//QV2mkMAGGr 5VbQo4PbyVKdV9v2KT/HG6hcAj/gLiBhfB1o4rTP1Ls30KwNkWLJ56NZJ7UNbV8a9AY6 mWNsAaQHXlhn3+bhYx/Lj+MDpdrq8g562uCsZFSGfEM28Mskd9bneWrFUh8lhF/uj+rp R9kJ0ekjFJMYEVVv7JmWxaBy6Ow8HHxoTP5VtyRgmex/nXMGorDJBa8oB0UGC3gl8e2l s6HbnlU22J4QTzH87RWePcMwZdSXCxeSxNMHZhYJSnLazNXB5n7CAfKHG6QtukRBXsKC IQEg== X-Gm-Message-State: APt69E0iQ0zQkeopiUhsq1k7EQ/J4gN3hZESAHRtxHTTRYpcRilYIm1T 9mtdNFpDBY67GrePR0OcO6Tg7IzoqdcN4VlxUtS6WQ== X-Received: by 2002:a50:b608:: with SMTP id b8-v6mr759412ede.255.1528753872140; Mon, 11 Jun 2018 14:51:12 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a50:a48a:0:0:0:0:0 with HTTP; Mon, 11 Jun 2018 14:51:11 -0700 (PDT) In-Reply-To: <0a213578-c7d7-0ed3-ffc1-afc97d8d1516@arm.com> References: <1528235011-30691-1-git-send-email-suzuki.poulose@arm.com> <1528235011-30691-9-git-send-email-suzuki.poulose@arm.com> <20180608212211.GG30587@xps15> <0a213578-c7d7-0ed3-ffc1-afc97d8d1516@arm.com> From: Mathieu Poirier Date: Mon, 11 Jun 2018 15:51:11 -0600 Message-ID: Subject: Re: [PATCH 08/20] coresight: dts: Cleanup device tree graph bindings To: Suzuki K Poulose Cc: linux-arm-kernel , Rob Herring , Frank Rowand , Mark Rutland , Sudeep Holla , arm@kernel.org, Linux Kernel Mailing List , Matt Sealey , John Horley , Charles Garcia-Tobin , coresight@lists.linaro.org, devicetree@vger.kernel.org, Mike Leach 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 On 11 June 2018 at 10:55, Suzuki K Poulose wrote: > On 11/06/18 17:52, Mathieu Poirier wrote: >> >> On 11 June 2018 at 03:22, Suzuki K Poulose wrote: >>> >>> On 08/06/18 22:22, Mathieu Poirier wrote: >>>> >>>> >>>> On Tue, Jun 05, 2018 at 10:43:19PM +0100, Suzuki K Poulose wrote: >>>>> >>>>> >>>>> The coresight drivers relied on default bindings for graph >>>>> in DT, while reusing the "reg" field of the "ports" to indicate >>>>> the actual hardware port number for the connections. However, >>>>> with the rules getting stricter w.r.t to the address mismatch >>>>> with the label, it is no longer possible to use the port address >>>>> field for the hardware port number. Hence, we add an explicit >>>>> property to denote the hardware port number, "coresight,hwid" >>>>> which must be specified for each "endpoint". >>>>> >>>>> Cc: Mathieu Poirier >>>>> Cc: Sudeep Holla >>>>> Cc: Rob Herring >>>>> Signed-off-by: Suzuki K Poulose >>>>> --- >>>>> .../devicetree/bindings/arm/coresight.txt | 29 >>>>> ++++++++++--- >>>>> drivers/hwtracing/coresight/of_coresight.c | 49 >>>>> +++++++++++++++++----- >>>>> 2 files changed, 62 insertions(+), 16 deletions(-) >>>>> >>>>> diff --git a/Documentation/devicetree/bindings/arm/coresight.txt >>>>> b/Documentation/devicetree/bindings/arm/coresight.txt >>>>> index ed6b555..bf75ab3 100644 >>>>> --- a/Documentation/devicetree/bindings/arm/coresight.txt >>>>> +++ b/Documentation/devicetree/bindings/arm/coresight.txt >>>>> @@ -108,8 +108,13 @@ following properties to uniquely identify the >>>>> connection details. >>>>> "slave-mode" >>> >>> >>> >>> >>>>> }; >>>> >>>> >>>> >>>> For the binding part: >>>> Reviewed-by: Mathieu Poirier > > > ... > >>>>> @@ -140,9 +166,6 @@ static int of_coresight_parse_endpoint(struct >>>>> device_node *ep, >>>>> rparent = of_graph_get_port_parent(rep); >>>>> if (!rparent) >>>>> break; >>>>> - if (of_graph_parse_endpoint(rep, &rendpoint)) >>>>> - break; >>>>> - >>>>> /* If the remote device is not available, defer >>>>> probing >>>>> */ >>>>> rdev = of_coresight_get_endpoint_device(rparent); >>>>> if (!rdev) { >>>>> @@ -150,9 +173,15 @@ static int of_coresight_parse_endpoint(struct >>>>> device_node *ep, >>>>> break; >>>>> } >>>>> - conn->outport = endpoint.port; >>>>> + child_port = of_coresight_endpoint_get_port_id(rdev, >>>>> rep); >>>>> + if (child_port < 0) { >>>>> + ret = 0; >>>> >>>> >>>> >>>> Why returning '0' on an error condition? Same for 'local_port' above. >>>> >>> >>> If we are unable to parse a port, we can simply ignore the port and >>> continue, which >>> is what we have today with the existing code. I didn't change it and >>> still >>> think >>> it is the best effort thing. We could spit a warning for such cases, if >>> really needed. >>> Also, the parsing code almost never fails at the moment. If it fails to >>> find >>> "reg" field, >>> it is assumed to be '0'. Either way ignoring it seems harmless. That said >>> I >>> am open >>> to suggestions. >> >> >> Looking at the original code I remember not mandating enpoints to be >> valid for debugging purposes. That certainly helps when building up a >> device tree file but also has the side effect of silently overlooking >> specification problems. Fortunately the revamping you did on that >> part of the code makes it very easy to change that, something I think >> we should take advantage of (it can only lead to positive scenarios >> where defective specifications get pointed out). >> >> That being said and because the original behaviour is just as >> permissive, you can leave as is. > > > Thanks. So can I assume the Reviewed-by applies for the code now ? Yes > > Suzuki