Received: by 10.192.165.148 with SMTP id m20csp4712701imm; Tue, 1 May 2018 02:17:58 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqYzv1XKj8BzBEuw3h9CRAcV3B1gvRIZe8dHLb1oSxw6seJGJpXmsbIyxk+Kyrtaqhi/yX1 X-Received: by 2002:a17:902:7109:: with SMTP id a9-v6mr15649705pll.271.1525166278768; Tue, 01 May 2018 02:17:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525166278; cv=none; d=google.com; s=arc-20160816; b=xHxrELuDlkp3Q3Pev9p923tPDfBgL5fZukhO9yfxTCPqg069n19PRLtHMDqa5EHAYJ hVSjnICQG7jnSKu1vbP1Jl0al4rj+/WLJZ+AlILrwGqCVEx9xhMoFHYfL1KMmWEnaDcv QCke/QvRwmNifDC0MPQ7ojMo2Zj/NBYMtmoHQPh9L6yXis8rxwDRGbBwsbbazd7hFWWA CIWnzGIoDYSpOBmOmgzxTq+h4kWtGA8t9LjSuVpR9aWdb/ZcUrbR8IQXJB2dcTYGBxTz nsu4k/csLDnFVWO94nHd8t0+EiFyC1aME7Mlp2A9U54z3kEFG1VpYpWvRIb8kHVH/NRu qxVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=p1a7Sag5XjaqC8wc47cTWv24cgf4kTzRr/DwZxVp68s=; b=WSLSO7LmJz7rDzWeByn6HZNN8Pq/F/EiD8LmOyes7cAklNylDZZUVpJ7aWHy4LM8Zd Z+0M8ExtS0arCf2wwvN6+Gs9wl09aVPAkAlxSe7ocjBiLPZmgPZdDJ13nxHmxu3wdhoK GE4kbRZMxXYNgv3OAPol3ARL/fSIn2WcJvu3JE8wNpEG+33M9h8bFIGu0loje0sh1lca SgYyg6XPDWdkGMAFslWQZSu2tMAqUiZCVVdxy9IqJywRzBKPbi2p1dyyfAceeai/v9aP Za1+3dq61CBVWY/UeEH/5elzRttdZaL6spi4BO5o473C0V44+T5TA7+5plSzkuS+6Cxs d2nA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t184si9357591pfb.98.2018.05.01.02.17.44; Tue, 01 May 2018 02:17:58 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753072AbeEAJLh (ORCPT + 99 others); Tue, 1 May 2018 05:11:37 -0400 Received: from foss.arm.com ([217.140.101.70]:44132 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754550AbeEAJLe (ORCPT ); Tue, 1 May 2018 05:11:34 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9F8A115BE; Tue, 1 May 2018 02:11:33 -0700 (PDT) Received: from en101.cambridge.arm.com (en101.cambridge.arm.com [10.1.206.73]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 235823F487; Tue, 1 May 2018 02:11:31 -0700 (PDT) From: Suzuki K Poulose To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, mathieu.poirier@linaro.org, mike.leach@linaro.org, robert.walker@arm.com, mark.rutland@arm.com, will.deacon@arm.com, robin.murphy@arm.com, sudeep.holla@arm.com, frowand.list@gmail.com, robh@kernel.org, john.horley@arm.com, Suzuki K Poulose , Mathieu Poirier , devicetree@vger.kernel.org Subject: [PATCH v2 10/27] dts: bindings: Restrict coresight tmc-etr scatter-gather mode Date: Tue, 1 May 2018 10:10:40 +0100 Message-Id: <1525165857-11096-11-git-send-email-suzuki.poulose@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525165857-11096-1-git-send-email-suzuki.poulose@arm.com> References: <1525165857-11096-1-git-send-email-suzuki.poulose@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We are about to add the support for ETR builtin scatter-gather mode for dealing with large amount of trace buffers. However, on some of the platforms, using the ETR SG mode can lock up the system due to the way the ETR is connected to the memory subsystem. In SG mode, the ETR performs READ from the scatter-gather table to fetch the next page and regular WRITE of trace data. If the READ operation doesn't complete(due to the memory subsystem issues, which we have seen on a couple of platforms) the trace WRITE cannot proceed leading to issues. So, we by default do not use the SG mode, unless it is known to be safe on the platform. We define a DT property for the TMC node to specify whether we have a proper SG mode. Cc: Mathieu Poirier Cc: Mike Leach Cc: Mark Rutland Cc: John Horley Cc: Robert Walker Cc: devicetree@vger.kernel.org Cc: frowand.list@gmail.com Cc: Rob Herring Signed-off-by: Suzuki K Poulose --- Documentation/devicetree/bindings/arm/coresight.txt | 3 +++ drivers/hwtracing/coresight/coresight-tmc.c | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/arm/coresight.txt b/Documentation/devicetree/bindings/arm/coresight.txt index cdd84d0..7c0c8f0 100644 --- a/Documentation/devicetree/bindings/arm/coresight.txt +++ b/Documentation/devicetree/bindings/arm/coresight.txt @@ -88,6 +88,9 @@ its hardware characteristcs. * arm,buffer-size: size of contiguous buffer space for TMC ETR (embedded trace router) + * scatter-gather: boolean. Indicates that the TMC-ETR can safely + use the SG mode on this system. + * Optional property for CATU : * interrupts : Exactly one SPI may be listed for reporting the address error diff --git a/drivers/hwtracing/coresight/coresight-tmc.c b/drivers/hwtracing/coresight/coresight-tmc.c index 7a4e84f..e38379c 100644 --- a/drivers/hwtracing/coresight/coresight-tmc.c +++ b/drivers/hwtracing/coresight/coresight-tmc.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -304,6 +305,11 @@ const struct attribute_group *coresight_tmc_groups[] = { NULL, }; +static inline bool tmc_etr_can_use_sg(struct tmc_drvdata *drvdata) +{ + return fwnode_property_present(drvdata->dev->fwnode, "scatter-gather"); +} + /* Detect and initialise the capabilities of a TMC ETR */ static int tmc_etr_setup_caps(struct tmc_drvdata *drvdata, u32 devid, void *dev_caps) @@ -313,7 +319,7 @@ static int tmc_etr_setup_caps(struct tmc_drvdata *drvdata, /* Set the unadvertised capabilities */ tmc_etr_init_caps(drvdata, (u32)(unsigned long)dev_caps); - if (!(devid & TMC_DEVID_NOSCAT)) + if (!(devid & TMC_DEVID_NOSCAT) && tmc_etr_can_use_sg(drvdata)) tmc_etr_set_cap(drvdata, TMC_ETR_SG); /* Check if the AXI address width is available */ -- 2.7.4