From patchwork Mon Aug 17 15:14:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 247811 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp2747933ilo; Mon, 17 Aug 2020 08:52:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwougJIlLslMjL7aAbAxWJ2h1abKgWyEcOGoLEgxaMvIzQgSybzC7028EbvS0CNF0HpfQVf X-Received: by 2002:a05:6402:2212:: with SMTP id cq18mr15807261edb.34.1597679519898; Mon, 17 Aug 2020 08:51:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597679519; cv=none; d=google.com; s=arc-20160816; b=UEazJjd83g9gaS05tIeX2NFzjBFHWkbVZDtWB+8JtzOhQjXUPyBjIZ9j5IYF0Rg75c azqcRYbqZxbjL0pByeDWePzqDtafmZKEZm5hGuE06ryrjP0QpeyZl8SSBuvgj9r4VqBw R9rN1t4Ox0g5snPxXNs5BJJDkfbJK6SrAHyriOGQXfU4Cm1qYAAhSRxrrqgQoViADQqj ZbvG6oTFR46b91Err0BXr+j2FL5ht7oL5fBD3aArKVnckzmcCzdTN+tWdLMuxVgx8R65 vZeZL3p8JL5cRccGMuv9yUKXfhk31eWDm2PQvxvlAjr/ZfmZiAh3fXtNbNY29KLsvFz5 cgzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=s6Byal7XbIa/C/xE1fMa3y7KZl3ebcsw5ggLFarKdDo=; b=nm4mJB6qxY5p7kdM2+9tkkZcu1TvtNSCYmb0dygkdu3wilGcNkUBcWoBKvPywUMKMb OaC4Izqp82SfXYAe4L/xRANSz2GyCsmbMrB+ZaBZpKydIcFGN15rTgofIcmcQP8uEQPF H4VywsNra7UN6DUAYJNfAirY23SqyYGnrXXnDyAszH+knbfIV7gzAPHq1SXCNsCkm4g1 G2He7a4RwvK41VuGIdD24MALiNvjCwVw70l5PHcZ7QE6ACkgAb3CnkuM6j8+hIbEGqza kePXl/Wmfk/1nciTYs0dOpzhb7Ds6kvxGPI1lDDxGpc4ZSbT5ogOMI7GUGaSP+BQj8jP 3Rew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Y20XZXAX; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q24si11150787eds.349.2020.08.17.08.51.59; Mon, 17 Aug 2020 08:51:59 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Y20XZXAX; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387816AbgHQPvq (ORCPT + 15 others); Mon, 17 Aug 2020 11:51:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:36732 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730923AbgHQPv0 (ORCPT ); Mon, 17 Aug 2020 11:51:26 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A433920729; Mon, 17 Aug 2020 15:51:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597679486; bh=Ld3YU6n9yLM5vrTVM/ZssuRx8dNGoxeIPIjiABqy/hA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y20XZXAXlyv43agzhsg2WWRBL3dbo8yFbKwDRfEvjLhSrNErxjUDD5tcRtwWzFPOp mu1sucw9XrpT4Q+aYAmvcoFuuKbjKuI0a5YnmWjg+Rzhv+ZaLMSOakCa6LzlXU/Thd f13nd8bMOLYGYl9h+kye4mO3uVYSVNOAJcJIq++o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mike Leach , Mathieu Poirier , Sasha Levin Subject: [PATCH 5.7 229/393] coresight: etmv4: Counter values not saved on disable Date: Mon, 17 Aug 2020 17:14:39 +0200 Message-Id: <20200817143830.734681475@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143819.579311991@linuxfoundation.org> References: <20200817143819.579311991@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Mike Leach [ Upstream commit 8fa43700f69703f995ea715b76be6fabdd2f05de ] The counter value registers change during operation, however this change is not reflected in the values seen by the user in sysfs. This fixes the issue by reading back the values on disable. Signed-off-by: Mike Leach Fixes: 2e1cdfe184b52 ("coresight-etm4x: Adding CoreSight ETM4x driver") Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200716175746.3338735-11-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/hwtracing/coresight/coresight-etm4x.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.25.1 diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c index d59e4b1e5ce58..942b362a1f220 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c @@ -507,6 +507,12 @@ static void etm4_disable_hw(void *info) readl_relaxed(drvdata->base + TRCSSCSRn(i)); } + /* read back the current counter values */ + for (i = 0; i < drvdata->nr_cntr; i++) { + config->cntr_val[i] = + readl_relaxed(drvdata->base + TRCCNTVRn(i)); + } + coresight_disclaim_device_unlocked(drvdata->base); CS_LOCK(drvdata->base);