From patchwork Tue Mar 22 20:23:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 64201 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp2295006lbc; Tue, 22 Mar 2016 13:24:32 -0700 (PDT) X-Received: by 10.98.18.212 with SMTP id 81mr57238215pfs.104.1458678271932; Tue, 22 Mar 2016 13:24:31 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n3si4380378pfb.123.2016.03.22.13.24.31; Tue, 22 Mar 2016 13:24:31 -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; dkim=pass header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751822AbcCVUYY (ORCPT + 29 others); Tue, 22 Mar 2016 16:24:24 -0400 Received: from mail-io0-f177.google.com ([209.85.223.177]:32900 "EHLO mail-io0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752788AbcCVUYE (ORCPT ); Tue, 22 Mar 2016 16:24:04 -0400 Received: by mail-io0-f177.google.com with SMTP id c63so75976059iof.0 for ; Tue, 22 Mar 2016 13:24:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=yGnpyd1VoH1nVCGsJm7GJnGIdCdbH21mm2XlNPowhb8=; b=TJ0dh/2nhorGzX63gZP8qFVwMXY263gAgGaU9Hb9JvUXfRfHJ8vxXU7eszGJO/TP7G 0pjkt7i2B2W2loi5LAwmcP0CjLDuGfjn0h5f+bVkXE4o/x3XVHl3cheKvnDWkMHoo25k f12rhxddcK/TPRVp7qJk0XYmDx5OAXd+F4vzw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=yGnpyd1VoH1nVCGsJm7GJnGIdCdbH21mm2XlNPowhb8=; b=Is+eH00NsjR7vWZCZlUAQl0VeGswBjOdVjbaKd+rlLMGgmChDts3TYTuTweM7KgmUW WYcCyZ77mGZuNsBmFCF/acHESX+2cw/Sb3bdLBykg1HhX89VhL22sQhQqb2dSqShbACf 6fbWU/+NqRzJb+AsVR1OgVddkTL3rWG+Lc/HwZed3pxaZVAtUZN8AY34NwkHHmYvAwNM Ih7n2CZrrNom20FWBDmpgAp9BLzYYZ912YRDhrOU2jDMscojeB3FvHKblAAdQB+kF83g +jnGoLXwPkcU0hh4tNwPA9EWChRzO9mxwt1YLE2bukJnVRRIVNx5Yiz3Llo6PtGAS8pR nUWQ== X-Gm-Message-State: AD7BkJJRzhMHDzL4LGSO7jDHfV3yhkc+Geyi4rj2fQcr3KJBc7p4D0znJ+OdWdVng368Un1c X-Received: by 10.50.131.233 with SMTP id op9mr21489286igb.0.1458678244226; Tue, 22 Mar 2016 13:24:04 -0700 (PDT) Received: from t430.cg.shawcable.net ([184.64.168.246]) by smtp.gmail.com with ESMTPSA id xo2sm8092061igb.0.2016.03.22.13.24.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 Mar 2016 13:24:03 -0700 (PDT) From: Mathieu Poirier To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 14/14] coresight: configuring ETF in FIFO mode when acting as link Date: Tue, 22 Mar 2016 14:23:22 -0600 Message-Id: <1458678202-3447-15-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1458678202-3447-1-git-send-email-mathieu.poirier@linaro.org> References: <1458678202-3447-1-git-send-email-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When part of a path but not identified as a sink, the EFT has to be configured as a link and placed in HW FIFO mode. As such when enabling a path, call the right configuration function based on the role the ETF if playing in this trace run. Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) -- 2.1.4 diff --git a/drivers/hwtracing/coresight/coresight.c b/drivers/hwtracing/coresight/coresight.c index 6ec2b66af9ee..fa7ecbd99901 100644 --- a/drivers/hwtracing/coresight/coresight.c +++ b/drivers/hwtracing/coresight/coresight.c @@ -287,15 +287,27 @@ int coresight_enable_path(struct list_head *path, u32 mode) { int ret = 0; + u32 type; struct coresight_node *nd; struct coresight_device *csdev, *parent, *child; list_for_each_entry_reverse(nd, path, link) { csdev = nd->csdev; + type = csdev->type; - switch (csdev->type) { + /* + * ETF devices are tricky... They can be a link or a sink, + * depending on how they are configured. If an ETF has been + * "activated" it will be configured as a sink, otherwise + * go ahead with the link configuration. + */ + if (type == CORESIGHT_DEV_TYPE_LINKSINK) + type = (csdev == coresight_get_sink(path)) ? + CORESIGHT_DEV_TYPE_SINK : + CORESIGHT_DEV_TYPE_LINK; + + switch (type) { case CORESIGHT_DEV_TYPE_SINK: - case CORESIGHT_DEV_TYPE_LINKSINK: ret = coresight_enable_sink(csdev, mode); if (ret) goto err; @@ -304,6 +316,7 @@ int coresight_enable_path(struct list_head *path, u32 mode) /* sources are enabled from either sysFS or Perf */ break; case CORESIGHT_DEV_TYPE_LINK: + case CORESIGHT_DEV_TYPE_LINKSINK: parent = list_prev_entry(nd, link)->csdev; child = list_next_entry(nd, link)->csdev; ret = coresight_enable_link(csdev, parent, child);