From patchwork Mon Aug 6 13:41:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suzuki K Poulose X-Patchwork-Id: 10557169 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 36D7514E2 for ; Mon, 6 Aug 2018 13:43:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2551329502 for ; Mon, 6 Aug 2018 13:43:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 199CE2951F; Mon, 6 Aug 2018 13:43:58 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI 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 95CA729502 for ; Mon, 6 Aug 2018 13:43:57 +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: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:In-Reply-To: References:List-Owner; bh=xYTDmXwDk3yi9I0FQN+SUWPURfdT7juQKsZA9oUzNvg=; b=kKt 3RWltLiLsNMMVvwiuwM+n8emQ9erBRvL16x79IErh2b56Mhfu0As4MaHUhWSJQvrwRxijX2Kj6VlW GVGmS1kpX8GFbrm9Undx6VUkrJq80c7ISkL3vPqIo9abFzSEGR0xj+owMonU1olksUYucyvisLEFq soyc1EA2vtiTZgIgqEcXT3OOhMboILgCSzdMEZNOJ4MBDXx/TsB6zU8o4ki+rej7SXucIdFpjYene jg+mdK/JbwQco5P44bjKTiWalO2FRj087tcAUlkNiH/kjCE/phLgJ1jkt8b+5Sz/5ZWaYfIiFN7aj no+9h/lVr9WyBumZ7NaPNOruImimclA==; 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 1fmfnc-0004VE-Fe; Mon, 06 Aug 2018 13:43:52 +0000 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fmfnD-0003uZ-2G for linux-arm-kernel@lists.infradead.org; Mon, 06 Aug 2018 13:43:29 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id ECC567A9; Mon, 6 Aug 2018 06:43:14 -0700 (PDT) Received: from en101.Emea.Arm.com (en101.emea.arm.com [10.4.13.23]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id BBA783F2EA; Mon, 6 Aug 2018 06:43:13 -0700 (PDT) From: Suzuki K Poulose To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 00/13] coresight: Implement device claim protocol Date: Mon, 6 Aug 2018 14:41:42 +0100 Message-Id: <1533562915-21558-1-git-send-email-suzuki.poulose@arm.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180806_064327_226348_F88CDD3F X-CRM114-Status: GOOD ( 11.34 ) 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: mike.leach@arm.com, robert.walker@arm.com, linux-kernel@vger.kernel.org, mathieu.poirier@linaro.org, Suzuki K Poulose 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 Coresight architecture defines CLAIM tags for a device to negotiate control of the components (external agent vs self-hosted). Each device has a pair of registers (CLAIMSET & CLAIMCLR) for managing the CLAIM tags. However, the protocol for the CLAIM tags is IMPLEMENTATION DEFINED. PSCI has recommendations for the use of the CLAIM tags to negotiate controls for external agent vs self-hosted use, as defined in ARM DEN 0022D, Section "6.8.1 Debug and Trace save and restore". This series implements the recommended protocol by PSCI. There were two options for the implementation. 1) Have the claim/disclaim operations performed from the coresight generic driver - This doesn't work unfortunately for ETM devices as the need cross-CPU calls to access the CLAIM registers. Also, makes it complex for error recovery and reference counting. 2) Have the claim/disclaim operations performed from the device specific drivers. The disadvantage is that the calls are sprinkled in each driver, but this makes the operation much simpler. This series implements the method (2). The first part of the series prepares different drivers to handle errors from the lower layer and clean up the state. Applies on coresight/next: Suzuki K Poulose (13): coresight: tmc-etr: Refactor for handling errors coresight: tmc-etr: Handle errors enabling CATU coresight: tmc-etb/etf: Prepare to handle errors enabling coresight: etm4x: Add support for handling errors coresight: etm3: Add support for handling errors coresight: etb10: Handle errors enabling the device coresight: dynamic-replicator: Handle multiple connections coresight: Add support for CLAIM tag protocol coresight: etmx: Claim devices before use coresight: funnel: Claim devices before use coresight: catu: Claim device before use coresight: dynamic-replicator: Claim device for use coreisght: tmc: Claim device before use drivers/hwtracing/coresight/coresight-catu.c | 6 ++ .../coresight/coresight-dynamic-replicator.c | 79 +++++++++++++----- drivers/hwtracing/coresight/coresight-etb10.c | 18 +++-- drivers/hwtracing/coresight/coresight-etm3x.c | 58 ++++++++++---- drivers/hwtracing/coresight/coresight-etm4x.c | 52 ++++++++---- drivers/hwtracing/coresight/coresight-funnel.c | 26 ++++-- drivers/hwtracing/coresight/coresight-priv.h | 7 ++ drivers/hwtracing/coresight/coresight-tmc-etf.c | 93 +++++++++++++++------- drivers/hwtracing/coresight/coresight-tmc-etr.c | 80 +++++++++++++------ drivers/hwtracing/coresight/coresight.c | 85 ++++++++++++++++++++ include/linux/coresight.h | 20 +++++ 11 files changed, 409 insertions(+), 115 deletions(-)