From patchwork Thu Jul 16 17:57:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11668239 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1BBAE1392 for ; Thu, 16 Jul 2020 18:01:13 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C68A020578 for ; Thu, 16 Jul 2020 18:01:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="hJjw9TeJ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="R5QkqraC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C68A020578 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: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:List-Owner; bh=I20bR4G8j8lw6IMPj0qPGIe7QPB844GGFrWngv3jjeI=; b=hJjw9TeJkOO102dj3evfMEMp1 bpxWxNkJsVpujpxBALu30aIikcSI5dDE9uiiwz9HBJVcBf2kNGCBeiBtTuN7sejx/sB0GBk9Mn8Yb kDv2YGp68dv0UlxI+5/dC5QLve1nw/GekLmRqF1Fb/J+XJ5GqHwrG44R2EoeVdZqJ6ur28Jv5dUyJ 9dvMg3h1vtPe0QeqeJapFELMEzoy2o7jOl0pNxxHp0FIs3WCx8+8vpn0tNBmzNAobmrAsnFHfnHOk 32fUD+vfwDw+H8HDSwKguYEFY8cm69DhM8j3AJ4JFKEIcNbVqxQertWmQGxaRcxCfrO2awkNFyQag Oo0gGvZMw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw8AM-0003pR-6a; Thu, 16 Jul 2020 17:59:30 +0000 Received: from mail-pj1-x1041.google.com ([2607:f8b0:4864:20::1041]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw88w-0003FX-1V for linux-arm-kernel@lists.infradead.org; Thu, 16 Jul 2020 17:58:05 +0000 Received: by mail-pj1-x1041.google.com with SMTP id k5so5036941pjg.3 for ; Thu, 16 Jul 2020 10:58:01 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=M8ZVM9AOAXxNoSAkg37qiYuGNEa/r3piyJp/YtA+jBA=; b=R5QkqraCPr8jSlGMGX8A7B19OlZpVtJ2ZAavuNdKEHbGYWuojbjCqzaO4uwnB7lhcc ABIbO0cyvwG1JrtbnB38df3WJ01JC0hVM9stAPZtYoWR/T1bnW5Ew2ThAyxgHiBcJRC9 +YcgbIhWpM+Px+S0xy9esgRyYyv+bkuo/+IE/FPyoHny0ugzcek6vF41qXvY1yZGX0rz xO10B02DT3ohsbKCKQpSDrL9MnnzPMsc9C1zhndvYcerhIwePw46HyExt4rswmQlxMIX UW4yhNWtvLhi1rGgWjQfnPeObwMvN+3nH5Hqwzj3oVy+x9dHnouR+qito3UhPRfeeIUz 0auA== 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:mime-version:content-transfer-encoding; bh=M8ZVM9AOAXxNoSAkg37qiYuGNEa/r3piyJp/YtA+jBA=; b=AvqKqqiF/jgWUeRMjtYXlIhCaMCcPcbXJfTVQdnXmFjrNv7reGM9S+OdBSrWIRCLve 1yXvIqmN8gdeskwKvKuysSGiEoipJcwZmgPzleMo9jdtrfCWsiyZFn00eqHZ1yH3aB/K Tz257dWlkN8fTXK6XExIoVD5wYR9WC18khMQY3ZjhOMyqxeAgxWwi/EVpP32V0oyZEKG XdHHb87ca8B/T6wFslz0J4vMo9fsS6FSt24EllSfmGY8QLlrrv82p+v+O4uuleNhS8H+ WIsG2IGRExOIjT3C2RmniBjfv5hC4KjNR5fhchiMXvK3WqBmLnAQPXsYs0eZbMf1mO6t M4Tw== X-Gm-Message-State: AOAM531dilkCCsVj+gn8Nygv+S7etjq0vQ7xQri5nHy5yIt/coOgrafz fFffijIU61ImnqJLca/9h7PvWQ== X-Google-Smtp-Source: ABdhPJylUrdzU24B4NFN2owcImL/lZlrrJYG/4IqzRgktsSnzL7khBf2I/NVOOGZLm34CvBAqpNwiw== X-Received: by 2002:a17:90a:fef:: with SMTP id 102mr6141106pjz.104.1594922280032; Thu, 16 Jul 2020 10:58:00 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id 83sm5473253pfu.60.2020.07.16.10.57.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 10:57:59 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 10/17] coresight: etmv4: Counter values not saved on disable Date: Thu, 16 Jul 2020 11:57:39 -0600 Message-Id: <20200716175746.3338735-11-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200716175746.3338735-1-mathieu.poirier@linaro.org> References: <20200716175746.3338735-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200716_135802_193478_C935B1FB X-CRM114-Status: GOOD ( 10.90 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1041 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saiprakash.ranjan@codeaurora.org, suzuki.poulose@arm.com, vulab@iscas.ac.cn, tingwei@codeaurora.org, andriy.shevchenko@linux.intel.com, linux-arm-kernel@lists.infradead.org, mike.leach@linaro.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Mike Leach 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 --- drivers/hwtracing/coresight/coresight-etm4x.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c index 2290f41f0074..2d732af8b3e7 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c @@ -511,6 +511,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);