Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp35786lql; Fri, 12 Apr 2024 02:57:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXJTfcB4VPbp2xFSn9p3wK9Zk9dvFNtXTRVX0ZpRXzp/EUJ/ZCZ864nVnXfqjpxSb6XLmvOnLTEiyOgw1lva2gphE9qdXltdtr/74sxhA== X-Google-Smtp-Source: AGHT+IFHgdsi+GvlwfB41CquUeFvIRRXYcRpjketsh6JRv6CRh1iCSywG+0ciZStq1Lt9E+Lt+7V X-Received: by 2002:a17:906:695:b0:a52:374a:f230 with SMTP id u21-20020a170906069500b00a52374af230mr709139ejb.60.1712915865195; Fri, 12 Apr 2024 02:57:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712915865; cv=pass; d=google.com; s=arc-20160816; b=jKIk+Mfol4gTSSqfc5uKsLtE05FFN1g+Xp9oE8rhTC3OkyG6IcVuQlO3tbw2rAebLB U2613jkpcMGUMxLMMqNUkzYZVwGNyOUhBuGbJl5p6WDAfNujEkiaeI2GNzlsfeiIkpe0 /ei25SfjsuCUK1xWLChW5GIuOt8PFtP7d2GlYTQTs4Gwf86yuzi5Y9wu9fXQUR47QfvW gt82yy1eSen21M33daldF9AedQBdmMo7iAiSdb85gv0TDUHcnJe01n1mfB8DV5MziF7H l5jw9fW968y0hMCc/JN2/VWyqzqmXzbBf6DkJc99TVMnddqdaz8m4/CI8b6xVD+5ZODd GMyg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=tb94KDwbhE63ElhvRhomqiJyytvMvb3QGOpsO2X1tEU=; fh=YNAiqq70QnPugn5eU5QAhF3T7y2Zmnh0aSlShZtNbMA=; b=UVn11ZWXK37C8EhZ7Q+TI/BiMH7GPeilWyU5YvU5NKSnixurDlCSC/BT7GnMYN/Omh 9GxglH3wcKzhLvXmyaoSJ+5L05+uCaPhEk43FUyQKWTBqAB3GLBkWPTQYcnefHRq1eOF Ug/Y3ecld6D8SdjzcZt99mqMepR/jYajHz7jT65ca3RJRbThbZlUVyr0wf2oJdc2Fc8C rz3nCnM8RR5N4ac56NlTsy0btV465JnXXF2ImwX5R2NzN+FadwswSBbKnaUjAKD4mJuU DXsoMYBe0tOOw9wrxJV3OFY+MPpkXtdYz09HH6Eib3tjUoXhMp5ZYKCZ7fYw3l41AIpa K+0w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-142445-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142445-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id y23-20020a170906071700b00a522d380a2csi911726ejb.30.2024.04.12.02.57.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 02:57:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-142445-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-142445-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142445-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E5F4F1F22FCD for ; Fri, 12 Apr 2024 09:57:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 675B653373; Fri, 12 Apr 2024 09:57:35 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 42A3152F92; Fri, 12 Apr 2024 09:57:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712915854; cv=none; b=D0eyPJFLG8V9jniwra8We3gMwW0Bps8Auj6gMWT6Wy7WK9Li0/X+PNS3SKCTfMcaL3EUfHOsUsgITtl6r+EelWlUrlPgaD6gjsSqnyBl94YYXn8wNHCrRL1YAG154QzEWXy8w1v7Jy1WubYayr8K9EJE+aqHEBEzaz73oqIdt7M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712915854; c=relaxed/simple; bh=9ta90R5dH9mhamLwVYs0q7+kUmW2cMPBIFTryHHTN/o=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=oslGiXZsVBypZIXJKkIhHrBimaRuaecz/ddisbNZdD78EYJFx4ymm1pfwYoC3ncCwAwg1BLLuhKwDixjwzQYarK5Bq+ZeaL0a7n7sfxXGCdeTWjlIp5G3IlyzOkrGXIZLF235fdOYl4zZOrpXI7LbDzeiWMjbMFTshUh55PZ93A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E9581339; Fri, 12 Apr 2024 02:58:01 -0700 (PDT) Received: from [192.168.1.100] (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 092CB3F64C; Fri, 12 Apr 2024 02:57:30 -0700 (PDT) Message-ID: <3c5c85d4-8657-4ee0-88fa-ee47dce4cc7c@arm.com> Date: Fri, 12 Apr 2024 10:57:29 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v7 2/7] coresight: tmc-etr: Add support to use reserved trace memory To: Linu Cherian , suzuki.poulose@arm.com Cc: linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org, linux-kernel@vger.kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, devicetree@vger.kernel.org, sgoutham@marvell.com, gcherian@marvell.com, Anil Kumar Reddy , mike.leach@linaro.org, leo.yan@linaro.org References: <20240307033625.325058-1-lcherian@marvell.com> <20240307033625.325058-3-lcherian@marvell.com> Content-Language: en-US From: James Clark In-Reply-To: <20240307033625.325058-3-lcherian@marvell.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 07/03/2024 03:36, Linu Cherian wrote: > Add support to use reserved memory for coresight ETR trace buffer. > > Introduce a new ETR buffer mode called ETR_MODE_RESRV, which > becomes available when ETR device tree node is supplied with a valid > reserved memory region. > > ETR_MODE_RESRV can be selected only by explicit user request. > > $ echo resrv >/sys/bus/coresight/devices/tmc_etr/buf_mode_preferred > > Signed-off-by: Anil Kumar Reddy > Signed-off-by: Linu Cherian > --- > Changelog from v6: > * Removed redundant goto statements > * Setting of etr_buf->size to the reserved memory size is done > after successful dma map inside the alloc function > * Removed the special casing for ETR_MODE_RESRV > * Fixed the tab spacing in struct tmc_drvdata > > .../hwtracing/coresight/coresight-tmc-core.c | 47 +++++++++++ > .../hwtracing/coresight/coresight-tmc-etr.c | 82 ++++++++++++++++++- > drivers/hwtracing/coresight/coresight-tmc.h | 27 ++++++ > 3 files changed, 153 insertions(+), 3 deletions(-) > [...] > static bool etr_can_use_flat_mode(struct etr_buf_hw *buf_hw, ssize_t etr_buf_size) > @@ -874,13 +947,10 @@ static struct etr_buf *tmc_alloc_etr_buf(struct tmc_drvdata *drvdata, > if (!etr_buf) > return ERR_PTR(-ENOMEM); > > - etr_buf->size = size; > - Hi Linu, Not sure if this was left in by mistake? It's not mentioned in the commit message and it doesn't seem to match the description. Please make sure the current tests pass both with and without a reserved buffer defined in the DT. I get lots of failures with this patchset applied on N1SDP. ETF seems to work but ETR doesn't: $ sudo perf test -vvv "arm coresight" Recording trace (only user mode) with path: CPU1 => tmc_etf0 CoreSight path testing (CPU1 -> tmc_etf0): PASS Recording trace (only user mode) with path: CPU1 => tmc_etr0 CoreSight path testing (CPU1 -> tmc_etr0): FAIL ... Dmesg: [ 1938.622091] coresight tmc_etr0: Unable to allocate ETR buffer > /* If there is user directive for buffer mode, try that first */ > if (drvdata->etr_mode != ETR_MODE_AUTO) > rc = tmc_etr_mode_alloc_buf(drvdata->etr_mode, drvdata, > etr_buf, node, pages); > - Whitespace change.