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: 8645181 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5FFCD9F294 for ; Tue, 22 Mar 2016 20:33:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 728AF201FA for ; Tue, 22 Mar 2016 20:33:04 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8C361201ED for ; Tue, 22 Mar 2016 20:33:03 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aiSxa-0000SM-RX; Tue, 22 Mar 2016 20:31:26 +0000 Received: from mail-io0-x233.google.com ([2607:f8b0:4001:c06::233]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aiSql-0008Ca-B8 for linux-arm-kernel@lists.infradead.org; Tue, 22 Mar 2016 20:24:26 +0000 Received: by mail-io0-x233.google.com with SMTP id m184so255408385iof.1 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=k6pk+dCVqHAmEVu3M0jlSOMFYfXd8yTTENHsW6b7R27ojNz2On0qQJfYe+vX9NUQcB iad8ACz8RTsnz/ySOQtNMLqtgs5qt3wVUp8s9BpxL6YXBsmhFS/vlNMLQDXvoe3SUmfx F3latraBVuXCZ8uXVkIDfJ+IVE2Rkt6/0np7s5jwE4wwJD78WgMFB4oiUsigUPXwH4pw E6YiRAaxkYhixM3rWQ8ITdKqpU0XDbq40JIvqT5PF6ZzocLruroEwER0Dk3gjpaz74Uo Ly3STM4i1hkwcw0b7BdxnuPo30adpWrAGcYz2JfdfyQaSKtU47X/33tFkSuxUOwZnXna 4nRQ== X-Gm-Message-State: AD7BkJJA8OYCVFSFHfiwDKxv7r+JzByJdfR2PJtisbjdLX+Jdag6xKp327GylMyhOmMyitZa 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160322_132423_736955_5D453FFA X-CRM114-Status: GOOD ( 12.40 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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);