From patchwork Thu Apr 4 03:35:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 161735 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1087584jan; Wed, 3 Apr 2019 20:36:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqwRHBVQGHiYWdyluux08VOW3BcAedb4gAPJdY6DzC+5OdUMF5CiFNFj5Fhaqjk6e9yVOTSg X-Received: by 2002:a63:e653:: with SMTP id p19mr3401908pgj.284.1554349011827; Wed, 03 Apr 2019 20:36:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554349011; cv=none; d=google.com; s=arc-20160816; b=Ozqgrgfx4OqbzAXGOGVYDAfgQ5dYSy5bp08zrlkRlXSsC6tdAlyJpbG/ffSdFOT067 qtBkKfTvNBfaaS/s3fm5zOoT1VjibY8lCqXSybYpNQ3D0fnFLehAz26UCY7p+iIIeRGj IbW1Eqv5dHtjh1z4lhUBZXpCzDAXsJph9BvClRv189lJzWuv20YCnPdWEg5FSL4gLTxQ E8qWLM4bdmW5lR32AY/HUTIvbnOm81fkvtQm3cy6NUQERdjH2Sb+K/h7HUnXHLReSAa7 0m7lV2Xsu4woVIBAuOlpAjXGTUPT3tpcPHVFrrSZ7PwnuT5Hcunj2Usy2L3ZQS2I0o2s QdMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=G1pTCL1CVW1J8+zqGHl3aMQK3cea75KFYLLVGa3aTuo=; b=gWymcUHwZAqx5kOC1/CL2AQ0DvNZf4o7l1XnPIvYDgj77AHROG47YPObeh+2jCACGP iqUNkd95SydLxr5CNv7DmtfcPAO5MzGUZ+lpQpdUlBCgJmz8xC3HiRi73636EBFklb6i iTjZGh9hCcmgbg4+oLQc3M7gKa4gsCDLoTBJzb8X7vlM2w3VcSCTNvt4LgdBjAZl6njX 0kSEzb2K7wuasRRBPLUXye0wARnkndJr4CudzDdyuvIUxnx4Df7KXVIlvITGg7tKEEzK UUPqMCaNSx2IgBZvTnMt/IywfAoD4PYIC0ZCwDYSuVUY9xwgIrvo5jFA44mCHysmtlz7 cs6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KIHCnaFt; 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 sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z31si15750482plb.333.2019.04.03.20.36.51; Wed, 03 Apr 2019 20:36:51 -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 header.s=google header.b=KIHCnaFt; 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 sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728708AbfDDDgu (ORCPT + 31 others); Wed, 3 Apr 2019 23:36:50 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:40485 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728671AbfDDDgs (ORCPT ); Wed, 3 Apr 2019 23:36:48 -0400 Received: by mail-pg1-f196.google.com with SMTP id u9so498995pgo.7 for ; Wed, 03 Apr 2019 20:36:47 -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=G1pTCL1CVW1J8+zqGHl3aMQK3cea75KFYLLVGa3aTuo=; b=KIHCnaFtf0a36bnPS1J+zRFSumqsRdPPbVoWXwkeL1HXNwKWYsPasnJusJSH03de+g YrYEb2wJ/Xo+H/vWqEJdTjnFc4lejO+cXoI+Ur4SJwyNlqjDUm26N/hW4Lc7A7IRI8XE lHKqxmC/Fw69ZTS80V/oH5wYXxLlRR0MPw/3FbSQ9ivbTy8Z4M8ymHbgmxsEl+IAQ1Si DMF/oFhJMU8DXvkAC6SIB3Or8Rn+q4B0tTvNwmHYpT9Mx2TGfPWV5EUCbVNwyMyoWydI +XOQuiUO6i0q0zajwu3HaZNsiGLbgW9TWBgLUVMYb6u2i8Su233iQdtMSbCoZOVjHzgL hA8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=G1pTCL1CVW1J8+zqGHl3aMQK3cea75KFYLLVGa3aTuo=; b=K5I1D0owCinwDeKj0PbsLxMh6tAuKiO6ckDGCzvDpQdcVRGqpC9D3TI+FjaP01Jd9H 0YaNsOe6jt9P+m9wmcC33sZjeeFcanb8k02NWkDB+dgSh3Vv3qUrhFcbxcrqgKI5OZxp V5mrn8+dRz+xJAKX3JUssfkjFpIXfy3D83lGRxO9sjkmIJhE4FFA5d40hllBA9OBwsUA 98lX7GQMQ1PUHH1RgkRXm4Rg5ZPgnjy3asayEiOOIvyGDy2dcORlFejPZk5Kn7K6qp59 k0bC98e7HJTDCzwwIUCKU6MA1BunFinQIU1E7ILM/jLNrgSZgXF0nOzT/IG7okV0fU4y VXTA== X-Gm-Message-State: APjAAAWZVRunQ2yHGQuemktnsT27nPCA60L95Rt+hYPBFZnLitnAhxFb PdHs7ZG23I/qk2Nsvxe3DDlF4g== X-Received: by 2002:a63:c204:: with SMTP id b4mr3346998pgd.335.1554349007439; Wed, 03 Apr 2019 20:36:47 -0700 (PDT) Received: from xps15.imgcgcw.net ([147.50.13.10]) by smtp.gmail.com with ESMTPSA id u5sm12212780pfm.121.2019.04.03.20.36.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Apr 2019 20:36:46 -0700 (PDT) From: Mathieu Poirier To: linux-arm-kernel@lists.infradead.org Cc: alexander.shishkin@linux.intel.com, peterz@infradead.org, suzuki.poulose@arm.com, mike.leach@arm.com, leo.yan@linaro.org, coresight@lists.linaro.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 16/20] coresight: tmc-etr: Introduce the notion of IDR to ETR devices Date: Wed, 3 Apr 2019 21:35:37 -0600 Message-Id: <20190404033541.14072-17-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190404033541.14072-1-mathieu.poirier@linaro.org> References: <20190404033541.14072-1-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In CPU-wide scenarios with an N:1 source/sink topology, sources share the same sink. In order to reuse the same sink for all sources an IDR is needed to archive events that have already been accounted for. Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-tmc.c | 4 ++++ drivers/hwtracing/coresight/coresight-tmc.h | 6 ++++++ 2 files changed, 10 insertions(+) -- 2.17.1 diff --git a/drivers/hwtracing/coresight/coresight-tmc.c b/drivers/hwtracing/coresight/coresight-tmc.c index 2a02da3d630f..71c86cffc021 100644 --- a/drivers/hwtracing/coresight/coresight-tmc.c +++ b/drivers/hwtracing/coresight/coresight-tmc.c @@ -8,10 +8,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include #include @@ -447,6 +449,8 @@ static int tmc_probe(struct amba_device *adev, const struct amba_id *id) coresight_get_uci_data(id)); if (ret) goto out; + idr_init(&drvdata->idr); + mutex_init(&drvdata->idr_mutex); break; case TMC_CONFIG_TYPE_ETF: desc.type = CORESIGHT_DEV_TYPE_LINKSINK; diff --git a/drivers/hwtracing/coresight/coresight-tmc.h b/drivers/hwtracing/coresight/coresight-tmc.h index ee44906dffe8..c1b1700b2df7 100644 --- a/drivers/hwtracing/coresight/coresight-tmc.h +++ b/drivers/hwtracing/coresight/coresight-tmc.h @@ -8,7 +8,9 @@ #define _CORESIGHT_TMC_H #include +#include #include +#include #include #define TMC_RSZ 0x004 @@ -173,6 +175,8 @@ struct etr_buf { * @trigger_cntr: amount of words to store after a trigger. * @etr_caps: Bitmask of capabilities of the TMC ETR, inferred from the * device configuration register (DEVID) + * @idr: Holds etr_bufs allocated for this ETR. + * @idr_mutex: Access serialisation for idr. * @perf_data: PERF buffer for ETR. * @sysfs_data: SYSFS buffer for ETR. */ @@ -194,6 +198,8 @@ struct tmc_drvdata { enum tmc_mem_intf_width memwidth; u32 trigger_cntr; u32 etr_caps; + struct idr idr; + struct mutex idr_mutex; struct etr_buf *sysfs_buf; void *perf_data; };