From patchwork Sun Oct 18 18:24:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 55189 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by patches.linaro.org (Postfix) with ESMTPS id 83D0322FFA for ; Sun, 18 Oct 2015 18:26:29 +0000 (UTC) Received: by wiclg3 with SMTP id lg3sf4017883wic.3 for ; Sun, 18 Oct 2015 11:26:28 -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=n7ogMgHIBQ2IevGlMxQzhJ/E/I+1NlGjppp/Z6b0Aww=; b=gPjHhXLbcm2mfNkYHzD+P4K934yIhAHPTWXoajpwqs0lDbXuBwuWwDVj4+0bFLd62O /Yv0/uySxZOyRAEqRCRfbC5LVWL4vQgV5fRBPi7P38JfuyBD0eDHGhecrBzc8arqmDfy 2x2HNiekzGA/OrBDGKuWV03xdf5aaHVYSUojrZFA3yxZkidtgk3pvYZmQY/uGF+p8P4+ bUeLbbd+7MBxr5QjKCeNUYxqhu/8TAJEyr8aVmhf/wemEdWp3fL9OtZ1c/m5Rf4Ih2H6 lZ9ZbyCK56YGUwQBnjKLZIc9FRC70JlA/jiOGp5mpthYDzeHTfLHhVGBUP9fR+ekViq9 IqzA== X-Gm-Message-State: ALoCoQmV597x5u+DKmD17DYluHlaW9rjKp2a+V8Skz+fTApZr3INiTIomL2JboEs6KNBnFJ/6kLB X-Received: by 10.180.35.132 with SMTP id h4mr3484845wij.5.1445192788776; Sun, 18 Oct 2015 11:26:28 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.146.140 with SMTP id u134ls109210lfd.65.gmail; Sun, 18 Oct 2015 11:26:28 -0700 (PDT) X-Received: by 10.112.62.232 with SMTP id b8mr12446656lbs.27.1445192788596; Sun, 18 Oct 2015 11:26:28 -0700 (PDT) Received: from mail-lf0-f42.google.com (mail-lf0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id k90si20114873lfi.90.2015.10.18.11.26.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Oct 2015 11:26:28 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by lffy185 with SMTP id y185so97438861lff.2 for ; Sun, 18 Oct 2015 11:26:28 -0700 (PDT) X-Received: by 10.25.205.198 with SMTP id d189mr8295083lfg.72.1445192788114; Sun, 18 Oct 2015 11:26:28 -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 w3csp1078031lbq; Sun, 18 Oct 2015 11:26:27 -0700 (PDT) X-Received: by 10.66.190.6 with SMTP id gm6mr29506675pac.27.1445192783811; Sun, 18 Oct 2015 11:26:23 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yj10si46408823pab.237.2015.10.18.11.26.23; Sun, 18 Oct 2015 11:26:23 -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 S1752473AbbJRS0G (ORCPT + 28 others); Sun, 18 Oct 2015 14:26:06 -0400 Received: from mail-pa0-f53.google.com ([209.85.220.53]:32915 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752409AbbJRS0A (ORCPT ); Sun, 18 Oct 2015 14:26:00 -0400 Received: by pabrc13 with SMTP id rc13so167569526pab.0 for ; Sun, 18 Oct 2015 11:26:00 -0700 (PDT) X-Received: by 10.66.230.169 with SMTP id sz9mr29530982pac.136.1445192760278; Sun, 18 Oct 2015 11:26:00 -0700 (PDT) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [184.64.168.246]) by smtp.gmail.com with ESMTPSA id hq1sm20402076pbb.43.2015.10.18.11.25.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 18 Oct 2015 11:25:59 -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, nicolas.pitre@linaro.org 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, mathieu.poirier@linaro.org Subject: [PATCH V2 16/30] coresight: keeping track of enabled sink buffers Date: Sun, 18 Oct 2015 12:24:33 -0600 Message-Id: <1445192687-24112-17-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1445192687-24112-1-git-send-email-mathieu.poirier@linaro.org> References: <1445192687-24112-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.215.42 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 a path between source and sinks is 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 | 16 ++++++++++------ include/linux/coresight.h | 2 ++ 3 files changed, 14 insertions(+), 7 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 083080d435af..a40519d5a9e2 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; @@ -312,15 +313,18 @@ int coresight_build_paths(struct coresight_device *csdev, if ((csdev->type == CORESIGHT_DEV_TYPE_SINK || csdev->type == CORESIGHT_DEV_TYPE_LINKSINK) && csdev->activated) { - if (enable) + if (enable) { ret = coresight_enable_path(path); - else + 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 +351,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 +377,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 0601da01eeb2..dd530a6d3e21 100644 --- a/include/linux/coresight.h +++ b/include/linux/coresight.h @@ -153,6 +153,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: link 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 @@ -169,6 +170,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 */