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: 10884819 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AEF5313B5 for ; Thu, 4 Apr 2019 03:37:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 937FB28992 for ; Thu, 4 Apr 2019 03:37:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8740E28A1D; Thu, 4 Apr 2019 03:37:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1FD1728992 for ; Thu, 4 Apr 2019 03:37:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=jGrPHTCHybkqLovItFwOccT5qnrhPJaA/6qv/NLBH+s=; b=nHhu9CgxtWOlPNIth7CIuMnJEG CAWEK2uqBHrWQPYvzfAHuFv1veD3CRqf90bCSOWQap5+TmAhKQBV//ezPDaUmGmINFLmmFeOcJ9lG S4ak7pcTvJHmPb+sdQEj43P0bnvEzwOrsthmzKW7nS8nuH0Ul14E1sWleFKmVqoJEoUzRDGteA5Jm YS758o+yFnKQKAZ+D7EH8CzB8Ryc73hDSFQXgu1jitqYIHNRurG8N5xQP5eM67iM3QKTutYB95A33 Bo9FZ8DhX/jhUae6fErPqkvu2kZMDpfPGHvQ4nSznWu9+FVeWkuPDtzfu8jj2l330jhGZte5bedm/ qe5Hi/Yw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBtCB-00054U-7M; Thu, 04 Apr 2019 03:37:43 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBtBI-0003vE-5f for linux-arm-kernel@lists.infradead.org; Thu, 04 Apr 2019 03:37:20 +0000 Received: by mail-pf1-x443.google.com with SMTP id i17so624315pfo.6 for ; Wed, 03 Apr 2019 20:36:48 -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=Qwi5UmsIIPuY+KMtCaCQ69bv0avLhc3L6wr976fItNDA5ZCH/5ueTOLSDtzMU6f3gH Lh9/1R0316OKBjhkYn4gj1dK0uH3ondrL7BzAGNGx28aYnrMblnd4PvB2YEzrSB1QBJ1 EEEzl9eHyorEtQzWXD/XvGdEi2mHFvuuxsxYydcLPUYR1eU5lFw9ylF8stk7hrwVw8iB 5udteBkdywWsQjOedn67oqcj1qHczX3NwLfW53dSUAroijWTYM1WVc3cu1otWKbSBrzs r4cSjPlOAdNVyuzt7VYZGY6+Y7uoWpz9xYU04jkN4mVvRKnJrgtJ8InpLgT3luzcBUhK EEPw== X-Gm-Message-State: APjAAAU21pUdMkjI6nrS0XuHsBsHV6Y32OXCKNwh14yYhAfnyzzbpCYI wDW6w98T+5uXn7hEM4CQJP6esTilckI= X-Google-Smtp-Source: APXvYqzFdxJ3xAwPfEUpTkK2TeH/4oVjymWP8in/V/cF7jFJ/BFx5E59J7JTl/z8GIOprFgiE01Rig== 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190403_203648_761424_EDD8A28E X-CRM114-Status: GOOD ( 13.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: suzuki.poulose@arm.com, alexander.shishkin@linux.intel.com, coresight@lists.linaro.org, linux-kernel@vger.kernel.org, peterz@infradead.org, mike.leach@arm.com, leo.yan@linaro.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-Virus-Scanned: ClamAV using ClamSMTP 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(+) 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; };