From patchwork Mon Nov 5 22:26:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 150224 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3162527ljp; Mon, 5 Nov 2018 14:26:38 -0800 (PST) X-Google-Smtp-Source: AJdET5e4FIaLQgC1bCGRXtQAOUrI9v8kN9AFVFoAuwfYFlKaxjtuorOvJyCqGxo2rMgL8tKpAQ2b X-Received: by 2002:a63:3e05:: with SMTP id l5mr20363824pga.96.1541456798721; Mon, 05 Nov 2018 14:26:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541456798; cv=none; d=google.com; s=arc-20160816; b=O8ivtN/55DcpQEYOmKJzWeQP8enuwHU7w9UoT2nvxJYdndC3Ssae+cFsM6KBHIlLOo /wPkrENpJutUi3K1jFfmmMHPlEbhRDH9QFtXKIueao+7zELyNpOhDAqElLrdwNqnui+h rnHubQp8yNawWgPqCM3l0cIB9TRrvWV9urt229uWgo+8pE+74lJb0bXMVAMd1/aGZft3 5nqYCxQNCgfAG2N57GTa1poXRa5+JbSw1kMKMGC3Hmrc56mdFqSG8nJMnDreJZpjpay1 mH+LAeU+xljqny+eLiizo0ADwMoq47ocL2tE5YKSyILD3V6ZH9a/uboIQJWmUH/fjMN1 HbaQ== 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=czk6Nudv5RkepuEAFasNAuqyPXKfGg6GxLpRP0gwu+A=; b=nL+5ulSufwFOIvxzDLgDap9lHfcOMXfvVy5RR5NC2MdFjXGcAIwUmE5lyg1NdPmFvU Zlu5zfAS90ZmyGo9qQBdeXZPFfZFtvvcb31kbyisczJ83VnQFc0Id66vq9vfM+7RCWOo U3MDcqwzIa1nsmhB9eczcvwxn7UVlepgAE2zpIEqTx7BaTpuqP5XlZCNiXxo74d+f168 1VpLB1ca1/CldVhTth4R9Zl7QnEJ1s/1LEBoQfucbD3RDjimp99r0TYoE5gMJTzrpHDn zSY90qUFBmW84ysYVkuTqNO1Cj8cMU3QbKs6CAgINDoCbLE/IeqbaZOYzjCRRxOpB8DW 4wgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ByL3KEha; 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 97-v6si12567253plb.403.2018.11.05.14.26.38; Mon, 05 Nov 2018 14:26:38 -0800 (PST) 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=ByL3KEha; 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 S2388170AbeKFHsb (ORCPT + 32 others); Tue, 6 Nov 2018 02:48:31 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:33392 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725933AbeKFHsa (ORCPT ); Tue, 6 Nov 2018 02:48:30 -0500 Received: by mail-pg1-f195.google.com with SMTP id q5-v6so4874267pgv.0 for ; Mon, 05 Nov 2018 14:26:35 -0800 (PST) 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=czk6Nudv5RkepuEAFasNAuqyPXKfGg6GxLpRP0gwu+A=; b=ByL3KEhazCZAstZsXQIRX1ZKvzDtDRNwJt7TQWseIuPCLXrAslY0nHP5qe30hx6J5F GCqxfUN7Z6N7OJlLvMlpLG4wIZYMO08K/9dwiXCnA1KshkqQXwRi3toRIuoz6LcjQQ6A sJxaPSYfxHZ5uihMVRMe9VuY1eLaUksBjIw68= 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=czk6Nudv5RkepuEAFasNAuqyPXKfGg6GxLpRP0gwu+A=; b=E8Q5L4RNitPhZgvjztYNFcP1Gra/bq6sFMHF3NyyZRe3bl5JfIhEOsj8TjoqnD2+Rb v8PPUSxqb5kn5wIQN/u1PJ0J9UM+VT84L/m6vBpl6ea1TZxMDaAE+FyPcr1T0RHwsv7v KAzpiEDM2/rJTA4VEFUTHdZm/TEZ8s0FlJu/eCOkLTg8bd2qXTGem4fVcL7YneOpqnep qe2+yLmBRQGRFAHWIQ3NU8v9VMg0nUD+5SetXue4WqR87T8Rq6zjMeZ3AMzmF5dvinaA FaasctDmXJyV+PuAH2KMO4Mawn421BvtMocr2wRdWPPHOGnFej4+ucXRMDBFZep9/oA0 CtYg== X-Gm-Message-State: AGRZ1gLwjzFk+UJzItUg60dtbt3taHEZH0Wqp8WVhmEZ2YDpy5NkeRIM eFjMxlCXgVfCqWfa/r5Uuxj73w== X-Received: by 2002:a63:dd0a:: with SMTP id t10-v6mr21672846pgg.379.1541456795182; Mon, 05 Nov 2018 14:26:35 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id q26-v6sm58669804pfi.165.2018.11.05.14.26.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 Nov 2018 14:26:34 -0800 (PST) From: Mathieu Poirier To: linux-arm-kernel@lists.infradead.org Cc: alexander.shishkin@linux.intel.com, leo.yan@linaro.org, suzuki.poulose@arm.com, coresight@lists.linaro.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] coresight: etb10: Add support for CLAIM tag Date: Mon, 5 Nov 2018 15:26:28 -0700 Message-Id: <1541456790-28282-2-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1541456790-28282-1-git-send-email-mathieu.poirier@linaro.org> References: <1541456790-28282-1-git-send-email-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Following in the footstep of what was done for other CoreSight devices, add CLAIM tag support to ETB10 in order to synchronise access to the HW between the kernel and an external agent. Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-etb10.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) -- 2.7.4 Reviewed-by: Suzuki K Poulose diff --git a/drivers/hwtracing/coresight/coresight-etb10.c b/drivers/hwtracing/coresight/coresight-etb10.c index 824be0c5f592..105782ea64c7 100644 --- a/drivers/hwtracing/coresight/coresight-etb10.c +++ b/drivers/hwtracing/coresight/coresight-etb10.c @@ -136,6 +136,11 @@ static void __etb_enable_hw(struct etb_drvdata *drvdata) static int etb_enable_hw(struct etb_drvdata *drvdata) { + int rc = coresight_claim_device(drvdata->base); + + if (rc) + return rc; + __etb_enable_hw(drvdata); return 0; } @@ -223,7 +228,7 @@ static int etb_enable(struct coresight_device *csdev, u32 mode, void *data) return 0; } -static void etb_disable_hw(struct etb_drvdata *drvdata) +static void __etb_disable_hw(struct etb_drvdata *drvdata) { u32 ffcr; @@ -313,6 +318,13 @@ static void etb_dump_hw(struct etb_drvdata *drvdata) CS_LOCK(drvdata->base); } +static void etb_disable_hw(struct etb_drvdata *drvdata) +{ + __etb_disable_hw(drvdata); + etb_dump_hw(drvdata); + coresight_disclaim_device(drvdata->base); +} + static void etb_disable(struct coresight_device *csdev) { struct etb_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); @@ -323,7 +335,6 @@ static void etb_disable(struct coresight_device *csdev) /* Disable the ETB only if it needs to */ if (drvdata->mode != CS_MODE_DISABLED) { etb_disable_hw(drvdata); - etb_dump_hw(drvdata); drvdata->mode = CS_MODE_DISABLED; } spin_unlock_irqrestore(&drvdata->spinlock, flags); @@ -402,7 +413,7 @@ static unsigned long etb_update_buffer(struct coresight_device *csdev, capacity = drvdata->buffer_depth * ETB_FRAME_SIZE_WORDS; - etb_disable_hw(drvdata); + __etb_disable_hw(drvdata); CS_UNLOCK(drvdata->base); /* unit is in words, not bytes */ @@ -510,7 +521,7 @@ static unsigned long etb_update_buffer(struct coresight_device *csdev, handle->head = (cur * PAGE_SIZE) + offset; to_read = buf->nr_pages << PAGE_SHIFT; } - etb_enable_hw(drvdata); + __etb_enable_hw(drvdata); CS_LOCK(drvdata->base); return to_read; @@ -534,9 +545,9 @@ static void etb_dump(struct etb_drvdata *drvdata) spin_lock_irqsave(&drvdata->spinlock, flags); if (drvdata->mode == CS_MODE_SYSFS) { - etb_disable_hw(drvdata); + __etb_disable_hw(drvdata); etb_dump_hw(drvdata); - etb_enable_hw(drvdata); + __etb_enable_hw(drvdata); } spin_unlock_irqrestore(&drvdata->spinlock, flags); From patchwork Mon Nov 5 22:26:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 150225 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3162538ljp; Mon, 5 Nov 2018 14:26:40 -0800 (PST) X-Google-Smtp-Source: AJdET5fkOw4S/tylrBV6Xg/OA8YhZEZIUSuA0b4aQyReI9GS7gW84C/2nrYYQQFWSrl1ppVqIHWZ X-Received: by 2002:a62:1049:: with SMTP id y70-v6mr16439883pfi.113.1541456800162; Mon, 05 Nov 2018 14:26:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541456800; cv=none; d=google.com; s=arc-20160816; b=iCjtDiK5L/TFQ3z1wsg+wG+PcdOPF7s8tUiQ9GaUDKugU7dgcfoaEevwgFRK5yP26L 2oZyGl6pO/DDSL1MDER6jEHW4zSPJp/uicmu1bJg8BluA5NVl2ASH6ApeuKdtR+LgIKa obNdHXaJqpPHgrvuMYvEFbrQY7Rh+3Cq+9cl7l5F0hBDnrjIejjI1ZvU84HUIj1XqZE1 MvfBkSka8tJKayirR736JKkB8bSmNfEJAKWzA6Y1a74bqBI4KL6ftueF6pHkwozMtNw3 LvBbdW1wKMy/ZrYxK9QAlBNeW3Ja5+08uYj3jJBYo7sXCV2JBi6mi1BBmr0w6OMlQ/VJ lUMw== 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=kbp0i0noSt5NS9yHP1ZXGvz/6q60ME6LEo2FEAmuylE=; b=mZurEY913SKmBRWFylLi+cuLz82/PSoKMKn0Ud1dosk5dLk7/hUoE9adOrOWXKEm7o dVAvtLSkCC58PTwlIgyQdceWLIy6SQbLwfMUdyCnGhFcwpAoNgBDAbRBWxaxW2GLXLq3 CQpxO6f3GR/sFZJzrbgBhEaJNSUrhrOcHNMc8OiSsiL5a4tg0jg2CbXPNCqoLS3wW8Zl mwBA8MqimdV1cR2CAN0TG+ujxMqV1PBULss8mAKhzn3J3FGZ86dRjXQ30XZJOk6pTC0t 8VVGU0dXmMfsIuAgKtdjOVI8RszJmzRoslpnaHtztr7ABU5HAg16/aEMF4/CN7P6f7t3 K+/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QsOtfgvS; 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 s35si10328540pgk.392.2018.11.05.14.26.39; Mon, 05 Nov 2018 14:26:40 -0800 (PST) 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=QsOtfgvS; 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 S2388209AbeKFHsc (ORCPT + 32 others); Tue, 6 Nov 2018 02:48:32 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:46792 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388177AbeKFHsb (ORCPT ); Tue, 6 Nov 2018 02:48:31 -0500 Received: by mail-pg1-f195.google.com with SMTP id w7so4849955pgp.13 for ; Mon, 05 Nov 2018 14:26:37 -0800 (PST) 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=kbp0i0noSt5NS9yHP1ZXGvz/6q60ME6LEo2FEAmuylE=; b=QsOtfgvS2Rsn5IcjKaOBwNBUMSEQ2nNCSl9poPHNXc53jPjaFfva3JOeUkoVXs3Ezt xNTccmekK6m24ej7sEm+pEsnVADixWtuIYkHwOnWRtYCJO1ZzNWo2tz4PiO8BuCTcI7c sktIFH352p1/Pk1hg9K9zwZy3UgvOFCC3gwmE= 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=kbp0i0noSt5NS9yHP1ZXGvz/6q60ME6LEo2FEAmuylE=; b=IVckuM3UgDFL2x5kdp1ARIINZEMu8HqCzN62wcpr628t4KUWr55SNq6jVL8b40s2U8 +CB5ThrvrlRTt+aHZ4R67YcOo0NoFxI6Y6ORa5sZvnLtfRxgMDOrJ+Rc0LWll/TWkXKd inn4huA4VrMKVDUzf+7BbKECBIKXjrw6WbWXZGaICLXv0IvqnbcYT1IQQ/v59r5O+aj4 HSG5R6BziCaH/ulcCfCeQKPmeciM2RWQl5Gmfp/2Uo8OEwvvQVosFwIE/cv/0AcYkZ7d 2JqpvOrIRpf3Mi7RB8aVOcetPkMglBiKFvmYmmjsKfb75eupt36/FDVNcRjqQVpCev4t 2Ecg== X-Gm-Message-State: AGRZ1gJEPTLWKZ477BkNMpTpXeWi4/HAbrMo3XiF35xXs2ljbe6h6GAN 2E1Ab27PiubbBDGZNTSwyRzakw== X-Received: by 2002:a63:7cf:: with SMTP id 198mr19262077pgh.129.1541456796798; Mon, 05 Nov 2018 14:26:36 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id q26-v6sm58669804pfi.165.2018.11.05.14.26.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 Nov 2018 14:26:35 -0800 (PST) From: Mathieu Poirier To: linux-arm-kernel@lists.infradead.org Cc: alexander.shishkin@linux.intel.com, leo.yan@linaro.org, suzuki.poulose@arm.com, coresight@lists.linaro.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] coresight: etf: Release CLAIM tag after disabling the HW Date: Mon, 5 Nov 2018 15:26:29 -0700 Message-Id: <1541456790-28282-3-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1541456790-28282-1-git-send-email-mathieu.poirier@linaro.org> References: <1541456790-28282-1-git-send-email-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch rectifies the sequence of events in function tmc_etb_disable_hw() by disabling the HW first and then releasing the CLAIM tag. Otherwise we could be corrupting the configuration done by an external agent that would have claimed the device after we have released it. Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-tmc-etf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 Reviewed-by: Suzuki K Poulose diff --git a/drivers/hwtracing/coresight/coresight-tmc-etf.c b/drivers/hwtracing/coresight/coresight-tmc-etf.c index 5864ac55e275..a5f053f2db2c 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etf.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etf.c @@ -86,8 +86,8 @@ static void __tmc_etb_disable_hw(struct tmc_drvdata *drvdata) static void tmc_etb_disable_hw(struct tmc_drvdata *drvdata) { - coresight_disclaim_device(drvdata->base); __tmc_etb_disable_hw(drvdata); + coresight_disclaim_device(drvdata->base); } static void __tmc_etf_enable_hw(struct tmc_drvdata *drvdata) From patchwork Mon Nov 5 22:26:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 150226 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3162552ljp; Mon, 5 Nov 2018 14:26:41 -0800 (PST) X-Google-Smtp-Source: AJdET5fOir8AuLcTKfIUWXoJelDvapV4pxUE66nMixIRkZFmj8rAcG8io8KE7mb9QrtlSjlNl73k X-Received: by 2002:a63:9306:: with SMTP id b6mr6198802pge.36.1541456801354; Mon, 05 Nov 2018 14:26:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541456801; cv=none; d=google.com; s=arc-20160816; b=rnwqeP/rwbi3GsDPXJaLFaH79KXebRoA0yTOsYyThRZ4f0pU5dbM+xvTAgTxVmpQzQ 9fY0+s2VliCkp1tHAYMHl50mIlpp4+ey4g3sxti7IyvrNt/9VIwpiF2g6KeO2C8tkb+d ewiC8LMse2zoXl8eXpaoSog88rWFpeCQeTg7kUF/QKmitqo8+3fL2Q6f76MmI6QniQt/ wolixIhE/EIVqboQ57WTupARrEt3ZBLrBxa8zYyXBABMXhDh8sIO3O3OtqB6H2kBnda8 cq+wcZYuJ0m0VEaM+KEkXRkz8rC/7JIzyUanvFDl6qBmqSsL6WxmTsKb8Jhd3cHnGqK2 U5Ww== 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=6VDjqPjW8rYmef6qwOzmJfwOTegdIgPPYLUTUP0LGhs=; b=iOa/Edm4bz2wEWDEx+ZoOd8Nw2GpJyl0SycAz4TCkteS8VdrfJuN4/cfcMbzVWPBLz nTxBYXC4fQvVeHt3AjBVHU99rmk01dYa+cT+zSUwf60qY1NdE49HN4vqdh/xqWaLZ1CM Y9Z9HNXLSya6xBQhXVXG6EieMBj3svO5XLua7aBQdnNhRFFf5VvrYEBL4ykxHNQrLNOR g3e2WerqgqEL70kdHwnfrJjLPo4AAIewt05ZFFdnhH/bXULfpP5jbD0itjlqicCsidaF wU1PEBlK7njRY95Sbz5NKd0YfgF2bKg8q4MkSZb8XxmVcNtAC8bR2ZF8Glq45sL5iNLM DmdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QYFDXvVS; 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 q33-v6si42456529pgk.2.2018.11.05.14.26.41; Mon, 05 Nov 2018 14:26:41 -0800 (PST) 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=QYFDXvVS; 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 S2388226AbeKFHsd (ORCPT + 32 others); Tue, 6 Nov 2018 02:48:33 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:35045 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388210AbeKFHsd (ORCPT ); Tue, 6 Nov 2018 02:48:33 -0500 Received: by mail-pl1-f195.google.com with SMTP id n4-v6so5150991plp.2 for ; Mon, 05 Nov 2018 14:26:38 -0800 (PST) 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=6VDjqPjW8rYmef6qwOzmJfwOTegdIgPPYLUTUP0LGhs=; b=QYFDXvVSGN6LV+stDAwrCDGj9RxxLZ/v07EkMeyefL4pYyg/93L5e/jrywDko1ENl3 9lhlhhW5uCqMQqnDMSmPgQq5j5JV29srtOEiHyju3pg35Fx4aP+bXeOUy22cOs/6/V/6 Fp415Hkxk5GQQYkforfhPaLOd8ZJQAMGeGhF4= 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=6VDjqPjW8rYmef6qwOzmJfwOTegdIgPPYLUTUP0LGhs=; b=Ohm37BQuQz8Q3hWjqlYHmjEW7oFclJzBdDR1J1HNw7E+f+Pgbu3HfgKOxArR1pi8i3 /4DjdK5eaW5FdR4ixyHqphukw3NvGNfwkk1PGtdK+SE4DhXwaLJlxRmVg1lgwqyWcES3 FkjTXv6gLFEz1+TZiKNWy2DZmdIlb8ipTBZmZsCcbYJDNGALPnI66a0bV9KoFWzFYESu 9RnE1vgSMvKrA9+mp2IfUl6fMoCbYwcJVM9xjUS2txaTE++EaUi9nNSeafM6XzHOV69t d0ylrzCF6W5U4HxrSfpuwsHsE1sNAajvtucR9adDYqSRRYcl0YgVjApR26h9WEHYpEey O42w== X-Gm-Message-State: AGRZ1gLQ1EVzSUv58PGPZ7tSCL2vAEj6kuiDmYaAOugqGkVEIbeUu4kC 6we7AKpDrAt0ovmR/wSdOoHjyA== X-Received: by 2002:a17:902:8608:: with SMTP id f8-v6mr18529767plo.95.1541456798236; Mon, 05 Nov 2018 14:26:38 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id q26-v6sm58669804pfi.165.2018.11.05.14.26.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 Nov 2018 14:26:37 -0800 (PST) From: Mathieu Poirier To: linux-arm-kernel@lists.infradead.org Cc: alexander.shishkin@linux.intel.com, leo.yan@linaro.org, suzuki.poulose@arm.com, coresight@lists.linaro.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] coresight: etm3x: Release CLAIM tag when operated from perf Date: Mon, 5 Nov 2018 15:26:30 -0700 Message-Id: <1541456790-28282-4-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1541456790-28282-1-git-send-email-mathieu.poirier@linaro.org> References: <1541456790-28282-1-git-send-email-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch deals with the release of the CLAIM tag when the ETM is operated from perf. Otherwise the tag is left asserted and subsequent requests to use the device fail. Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-etm3x.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.7.4 diff --git a/drivers/hwtracing/coresight/coresight-etm3x.c b/drivers/hwtracing/coresight/coresight-etm3x.c index fd5c4cca7db5..000796394662 100644 --- a/drivers/hwtracing/coresight/coresight-etm3x.c +++ b/drivers/hwtracing/coresight/coresight-etm3x.c @@ -603,6 +603,8 @@ static void etm_disable_perf(struct coresight_device *csdev) */ etm_set_pwrdwn(drvdata); + coresight_disclaim_device_unlocked(drvdata->base); + CS_LOCK(drvdata->base); }