From patchwork Mon Aug 17 15:13:36 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: 247797 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp2732251ilo; Mon, 17 Aug 2020 08:30:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYDVcU/gkv8G2190YbxhyDRf9lqEWU6eMVedo8gy9xB9vLgdfWPva+B+utu4BNrUTHlojw X-Received: by 2002:aa7:d3d9:: with SMTP id o25mr15862479edr.362.1597678235360; Mon, 17 Aug 2020 08:30:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597678235; cv=none; d=google.com; s=arc-20160816; b=jDeH4dVuAamJD/r4hj9NHRwdOd/CdIguyMx11bT3a7gLjsriRvV44aHmJBIY0Bo5sj TGwCDNzTRzug/9pfzytAtLgsSeiWrCnvi88ibN789Vr8VAgxc86X5eNnVnTLjrnvAYSh pPgW7FoiUGe+UaHfTyHwQsQYiotQkD5VrBo3P3+SVEmOZC0xB62mfEiB356cIP5doJ2a 496Hf0IqtRnvFS6mbJAt/oYUG4K30iewX3w3zmbNgNt3nry0cEbO//exM8GPiISMuS9c 4cBjnwuKkQMeM68RYu9vaq1hp2TUHJ6wekrk+Am2A0lNTgouScEmBptvbTNWdTB4U6mG TgUg== 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=WTgpX+uIykG2uIKA0FIlipABscpQOzRxqmUeo9583b4=; b=K1Zifgn22m/qCtqI1ONUgnwSNLpigQ6mVSTdvyz6PtrzL29jnyR1qvkiFnWC6cOa1M OdkuTrUuiLidM63HSjO7lqKjQkq+wQc7nrg/yZfLshgKmBGLa7AS2PaOREdznbbC/o3n Hi/9xdcj2FLWuGQuwVxkH23AYvSvtU8uRD2znZ3ighpnSCZ1IAjW/Hzh9W64ZV3VEhtq dHY5VC052keQb20/zq2jFCA49eHU53j64g6taObNw84o/mWaNEy8+E/4nbfgzEpo4rxs MyQWxapUqsVYsiryn3cvcM2kVPDxbMpv67TbLCVhgyNrhiqQCtzJoddhWeM1hmI/kTp4 0s0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=k2tJ230o; 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 n9si10843288edy.290.2020.08.17.08.30.35; Mon, 17 Aug 2020 08:30:35 -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=k2tJ230o; 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 S1730182AbgHQPac (ORCPT + 15 others); Mon, 17 Aug 2020 11:30:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:51954 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730177AbgHQPaa (ORCPT ); Mon, 17 Aug 2020 11:30:30 -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 D877C20674; Mon, 17 Aug 2020 15:30:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597678230; bh=3NJsjnywdLs82ViXItXubO00zUOfwlMyKJD63NnK0Tc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k2tJ230ooluEcozfhOWwtUVcDqdB8HTxuB8yKNfzcC950z6G+SjOZ+BD2YifVWBhv K3FLeqsPdmK8JTngIShXRphUXoKPFrLI9dSLCg598M/EJk+40NFLcn4UNdS6881n7+ QdpDemJ+K4mj+8aJitkYORxmY3PX/qn59T1owOt0= 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.8 263/464] coresight: etmv4: Counter values not saved on disable Date: Mon, 17 Aug 2020 17:13:36 +0200 Message-Id: <20200817143846.387233751@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143833.737102804@linuxfoundation.org> References: <20200817143833.737102804@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 0c35cd5e0d1d9..007d7c6e91f48 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);