From patchwork Tue May 3 17:34:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 67082 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp719389qge; Tue, 3 May 2016 10:35:52 -0700 (PDT) X-Received: by 10.67.1.233 with SMTP id bj9mr5371065pad.46.1462296952616; Tue, 03 May 2016 10:35:52 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e66si255884pfa.118.2016.05.03.10.35.52; Tue, 03 May 2016 10:35:52 -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; 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 dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934269AbcECRfh (ORCPT + 29 others); Tue, 3 May 2016 13:35:37 -0400 Received: from mail-ig0-f178.google.com ([209.85.213.178]:38442 "EHLO mail-ig0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964956AbcECRew (ORCPT ); Tue, 3 May 2016 13:34:52 -0400 Received: by mail-ig0-f178.google.com with SMTP id m9so26324482ige.1 for ; Tue, 03 May 2016 10:34:52 -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=nJZiUYrwoG76QZy2T3gId8yxY1FuISrwKu0xiE14Ti0=; b=JW2gafg/KWhjHIAMaB9EEvLQxtN7edFe9prPEyUcp1frsFU64fpY/XV9wDSpZNRNCr Vh0CZxyoZxFufMwf0Ri6rWPycKfxEKOhZ0034Vv5wZsl3DHsJTPmdsY2ggQuQhkMicY/ uzsDmYjoNiKQNJlPkbhM5GYZ7khtagP9oQ+8w= 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=nJZiUYrwoG76QZy2T3gId8yxY1FuISrwKu0xiE14Ti0=; b=QX2XAqoQrTv630isKrCzqXNDOpB27+J5QcyVPOSCVncOTm2fPjoapf6SLxhG5BNRoV zr/0c7XhDHtztbW69jXjwrsZ6Rn8WDayUH1OueUnZ50hp5zY1tgfjM6QRI/BZU6DsOs3 +lXW9FmojwUoc40HYtOuYX3xUt9PWLnWplISEanoXIxsAc83R9xR7ZLEQ04TMzK6yx90 gw1lbvweGVMOoCfKSFrsa37xZqS0fTPPxFuQCX8J4G1RHJOHOe+PJ+MyoOGF1+pfg3A0 XDqUl68a505FZQUJ17C/FxDnxA+iWSyith5RIzIbpcjU8shJv33kuhB8tzzeZKsPVCDE JDCA== X-Gm-Message-State: AOPr4FVccmdJtelwJ941kLSSH5YQur7msBplsqlS8GhiXeFoHEvFeVhOHtxxYxHUSy+4wRGI X-Received: by 10.50.193.233 with SMTP id hr9mr28245654igc.40.1462296891896; Tue, 03 May 2016 10:34:51 -0700 (PDT) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id k33sm103957iod.44.2016.05.03.10.34.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 May 2016 10:34:50 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 26/27] coresight: configuring ETF in FIFO mode when acting as link Date: Tue, 3 May 2016 11:34:00 -0600 Message-Id: <1462296841-12327-27-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1462296841-12327-1-git-send-email-mathieu.poirier@linaro.org> References: <1462296841-12327-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 Reviewed-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight.c | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) -- 2.5.0 diff --git a/drivers/hwtracing/coresight/coresight.c b/drivers/hwtracing/coresight/coresight.c index 0995df8f85bc..5443d03a1eec 100644 --- a/drivers/hwtracing/coresight/coresight.c +++ b/drivers/hwtracing/coresight/coresight.c @@ -265,15 +265,27 @@ static void coresight_disable_source(struct coresight_device *csdev) void coresight_disable_path(struct list_head *path) { + u32 type; struct coresight_node *nd; struct coresight_device *csdev, *parent, *child; list_for_each_entry(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: coresight_disable_sink(csdev); break; case CORESIGHT_DEV_TYPE_SOURCE: @@ -294,15 +306,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; + + /* + * 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 (csdev->type) { + switch (type) { case CORESIGHT_DEV_TYPE_SINK: - case CORESIGHT_DEV_TYPE_LINKSINK: ret = coresight_enable_sink(csdev, mode); if (ret) goto err;