From patchwork Fri Sep 18 16:26:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 53937 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by patches.linaro.org (Postfix) with ESMTPS id 303F6218E3 for ; Fri, 18 Sep 2015 16:30:47 +0000 (UTC) Received: by wicgb1 with SMTP id gb1sf10830996wic.3 for ; Fri, 18 Sep 2015 09:30:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=w7JnoU2pm/sHJMRHpXUEtX9Q5RGNstwx/+VONavV33k=; b=NOIN+2gqYIuAqyk2ZwqF/ok5RnW+JZi5KOEWpS+lfyWevP0Ijn83QNE2lzOcGniwaI YMV5QeC2Ed2M6llnR6dRr1oiHnqghyS5D/SSwPIvIDxi/AFlyCB7aQWmcEisz9hXmI+E PHstqAltuf6ZTxSLV3n++Teg2PKCPrB46TCa+bCXZbY6bnK/08oIe1x47GkoIFdFvxJG s29ytFqmEdLQ6lCYe1xR2bX/Sd1okIQkVHCrqmZB7WAGic8DhW6MEVJSSz9IGiYvgwe5 lDvY79Pt5hr0ocQiXYz+6OJ/wBgFNyhxqzXYNDtA0t/UMjnmNeakh4BiFH/XLsz2Ihz+ I6MA== X-Gm-Message-State: ALoCoQmVHzSP1E5SaHw67JIF28dhHmglqq3W5ebPsKUMNNe5AXatgu2danNWw4w0ieXuWFEdx/NB X-Received: by 10.152.22.101 with SMTP id c5mr1081939laf.0.1442593846504; Fri, 18 Sep 2015 09:30:46 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.1.232 with SMTP id 8ls229626lap.103.gmail; Fri, 18 Sep 2015 09:30:46 -0700 (PDT) X-Received: by 10.112.52.168 with SMTP id u8mr3592240lbo.48.1442593846342; Fri, 18 Sep 2015 09:30:46 -0700 (PDT) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id xv11si6751249lab.53.2015.09.18.09.30.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Sep 2015 09:30:45 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by lbpo4 with SMTP id o4so27891618lbp.2 for ; Fri, 18 Sep 2015 09:30:45 -0700 (PDT) X-Received: by 10.112.180.230 with SMTP id dr6mr3577989lbc.72.1442593845855; Fri, 18 Sep 2015 09:30:45 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp403237lbq; Fri, 18 Sep 2015 09:30:44 -0700 (PDT) X-Received: by 10.50.8.3 with SMTP id n3mr34826281iga.26.1442593844651; Fri, 18 Sep 2015 09:30:44 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l4si7534808igx.27.2015.09.18.09.30.43; Fri, 18 Sep 2015 09:30:44 -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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754454AbbIRQaj (ORCPT + 30 others); Fri, 18 Sep 2015 12:30:39 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:34831 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932089AbbIRQ1T (ORCPT ); Fri, 18 Sep 2015 12:27:19 -0400 Received: by pacfv12 with SMTP id fv12so56041940pac.2 for ; Fri, 18 Sep 2015 09:27:18 -0700 (PDT) X-Received: by 10.68.139.226 with SMTP id rb2mr8211681pbb.49.1442593638605; Fri, 18 Sep 2015 09:27:18 -0700 (PDT) Received: from t430.cg.shawcable.net ([184.64.168.246]) by smtp.gmail.com with ESMTPSA id la4sm9847027pbc.76.2015.09.18.09.27.17 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 Sep 2015 09:27:18 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org, a.p.zijlstra@chello.nl, alexander.shishkin@linux.intel.com, acme@kernel.org, mingo@redhat.com, corbet@lwn.net Cc: adrian.hunter@intel.com, zhang.chunyan@linaro.org, mike.leach@arm.com, tor@ti.com, al.grant@arm.com, pawel.moll@arm.com, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 12/20] coresight: keeping track of enabled sink buffers Date: Fri, 18 Sep 2015 10:26:26 -0600 Message-Id: <1442593594-10665-13-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1442593594-10665-1-git-send-email-mathieu.poirier@linaro.org> References: <1442593594-10665-1-git-send-email-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mathieu.poirier@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Keep track of enabled sink buffers as paths between source and sinks are being built. That way sinks associated to a source can be accessed quickly. Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-priv.h | 3 ++- drivers/hwtracing/coresight/coresight.c | 11 +++++++---- include/linux/coresight.h | 2 ++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-priv.h b/drivers/hwtracing/coresight/coresight-priv.h index 8a52fdcb4bd6..3d7467f315ed 100644 --- a/drivers/hwtracing/coresight/coresight-priv.h +++ b/drivers/hwtracing/coresight/coresight-priv.h @@ -53,7 +53,8 @@ static inline void CS_UNLOCK(void __iomem *addr) } int coresight_build_paths(struct coresight_device *csdev, - struct list_head *path, bool enable); + struct list_head *path, + struct list_head *sinks, bool enable); #ifdef CONFIG_CORESIGHT_SOURCE_ETM3X extern int etm_readl_cp14(u32 off, unsigned int *val); diff --git a/drivers/hwtracing/coresight/coresight.c b/drivers/hwtracing/coresight/coresight.c index 7a54d8069670..2e9f6248fb7e 100644 --- a/drivers/hwtracing/coresight/coresight.c +++ b/drivers/hwtracing/coresight/coresight.c @@ -302,7 +302,8 @@ static int coresight_disable_path(struct list_head *path) } int coresight_build_paths(struct coresight_device *csdev, - struct list_head *path, bool enable) + struct list_head *path, + struct list_head *sinks, bool enable) { int i, ret = -EINVAL; struct coresight_connection *conn; @@ -314,13 +315,15 @@ int coresight_build_paths(struct coresight_device *csdev, csdev->activated) { if (enable) ret = coresight_enable_path(path); + if (!ret && sinks) + list_add(&csdev->sinks, sinks); else ret = coresight_disable_path(path); } else { for (i = 0; i < csdev->nr_outport; i++) { conn = &csdev->conns[i]; if (coresight_build_paths(conn->child_dev, - path, enable) == 0) + path, sinks, enable) == 0) ret = 0; } } @@ -347,7 +350,7 @@ int coresight_enable(struct coresight_device *csdev) if (csdev->enable) goto out; - if (coresight_build_paths(csdev, &path, true)) { + if (coresight_build_paths(csdev, &path, NULL, true)) { dev_err(&csdev->dev, "building path(s) failed\n"); goto out; } @@ -373,7 +376,7 @@ void coresight_disable(struct coresight_device *csdev) goto out; coresight_disable_source(csdev); - if (coresight_build_paths(csdev, &path, false)) + if (coresight_build_paths(csdev, &path, NULL, false)) dev_err(&csdev->dev, "releasing path(s) failed\n"); out: diff --git a/include/linux/coresight.h b/include/linux/coresight.h index 48c3b9df0ae0..da76b2951f10 100644 --- a/include/linux/coresight.h +++ b/include/linux/coresight.h @@ -154,6 +154,7 @@ struct coresight_connection { * @dev: The device entity associated to this component. * @refcnt: keep track of what is in use. * @path_link: link of current component into the path being enabled. + * @sinks: list of currently enabled sinks for a source. * @orphan: true if the component has connections that haven't been linked. * @enable: 'true' if component is currently part of an active path. * @activated: 'true' only if a _sink_ has been activated. A sink can be @@ -170,6 +171,7 @@ struct coresight_device { struct device dev; atomic_t *refcnt; struct list_head path_link; + struct list_head sinks; bool orphan; bool enable; /* true only if configured as part of a path */ bool activated; /* true only if a sink is part of a path */