Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1127377imu; Mon, 5 Nov 2018 14:27:31 -0800 (PST) X-Google-Smtp-Source: AJdET5eiZrOqbO4xVMUuTNvsCoAeDaUzQViNzOHagndrhaFzP8Zzwd59o79Qu1MYf98vpIzpkGxo X-Received: by 2002:a17:902:4683:: with SMTP id p3-v6mr24174475pld.215.1541456851208; Mon, 05 Nov 2018 14:27:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541456851; cv=none; d=google.com; s=arc-20160816; b=c+oZLpbjp2yo1fH5Oi1Hjn1VHNyoH6SNGB6COMeFScQWf8jWUqhIRsVu0X6uuNj6oC 5Bszb+wGledpwmxqHqMj3TwaxMyg1hP+Fn7TXREK1LFuM0jjtIUu1D2Qg+W7PTexOMdD N5c80Ouyik8Cgeg+T8vsJgxG5PjhQ6Bn7fm32Sfs87nBnivUs0YmO1WAE09NUJTpn0rD A7vs9K6tnV/WIYUEQHfGY0vuueGKfuj/viHbGzEriDb9/Es58MOx2ayyduXw/2tL4LX+ bNVvs8zLC+bztzAzUJ+0djRRQuux2lx/TN3m3AxneELO0YVviL4BuW0A4lJlDNBpIQF0 QLsw== 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 76-v6si6231712pfa.194.2018.11.05.14.27.16; Mon, 05 Nov 2018 14:27:31 -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 S2388205AbeKFHsc (ORCPT + 99 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(-) 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) -- 2.7.4