Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp390767pxb; Wed, 3 Feb 2021 07:54:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJwyaBYJgEZYp7hXEosbplsSOq8281ekDyH2HBZcVzHh23KsT1N4ZRsw/TIMZG+mMUAHxw9J X-Received: by 2002:aa7:c7c8:: with SMTP id o8mr3673431eds.137.1612367652856; Wed, 03 Feb 2021 07:54:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612367652; cv=none; d=google.com; s=arc-20160816; b=0/n94qZlxqSq7eocQtF5r6387Rx0PVmgiwjIS5B4Etk3uN20CTdz0Z380mb4D15ffN x+/uTvtA/1Cza8GJsMOOzDs943FJHvv4thWqAcOuJhYD+ZVkpxkYSA1tQ3p2VELTRvf4 q6z5vPfbX+VraN8QcEmAVoUptJ+PPazOj1fu51FlpPuXBG3V1z6pOD+S8WWRKqwrLiXc n0x2XUXeijNw7lYkRNSTlbX+gCl8kRhvUloKdxRgohN6Vjc2rz9Zhv5yu+eguLYG/NnF BKikWPkpW06v8Lxv5WuM0SKDDqesIlhd/2itiYF+GvQXkClbjtYPDLx7XYRELpPappFo mhfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=be7oYVp7f4Zgptdh0y/k0PnJ68v0p8tPwwMdd5FSHVA=; b=sUtwa81Q+AQerBTTj68daEgIRqrCvZvY5gJgRui8fBS3bMmcSVw21b7VgZmkTcxciR mumkleXVzl2luHV9JfOeQ4AXzYaOoDi6LgkrGVhU8+7Na6U/GsW5bPb5sfXKT44q0QLH r+qZcgrSu0RfmjInoQPeGnqb44q0TuvkIyTkB3jGnAnMD26zZlVjAmoZjn/KN7Q+NFob ULEHj+vozkqzAdAIoYXMN/BecknEPY1LExzEWZA6vqPKc6mxT3vBcBqG7AN3yE9IQj5B OYYoE8bOwsc7iUOva55J/Gmfgt5s1HJxjTlnJ0nOaeUk6JcM6PN4HIPVRBA48jB0MfMx zXaA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jz15si1527409ejb.290.2021.02.03.07.53.48; Wed, 03 Feb 2021 07:54:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234519AbhBCPxO (ORCPT + 99 others); Wed, 3 Feb 2021 10:53:14 -0500 Received: from foss.arm.com ([217.140.110.172]:42452 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234666AbhBCPwJ (ORCPT ); Wed, 3 Feb 2021 10:52:09 -0500 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 F2D7311FB; Wed, 3 Feb 2021 07:51:23 -0800 (PST) Received: from [10.57.35.108] (unknown [10.57.35.108]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9B4913F719; Wed, 3 Feb 2021 07:51:22 -0800 (PST) Subject: Re: [PATCH V3 04/14] coresight: ete: Add support for ETE sysreg access To: Mathieu Poirier , Anshuman Khandual Cc: linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org, mike.leach@linaro.org, lcherian@marvell.com, linux-kernel@vger.kernel.org References: <1611737738-1493-1-git-send-email-anshuman.khandual@arm.com> <1611737738-1493-5-git-send-email-anshuman.khandual@arm.com> <20210202175241.GC1536093@xps15> From: Suzuki K Poulose Message-ID: Date: Wed, 3 Feb 2021 15:51:09 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <20210202175241.GC1536093@xps15> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/2/21 5:52 PM, Mathieu Poirier wrote: > On Wed, Jan 27, 2021 at 02:25:28PM +0530, Anshuman Khandual wrote: >> From: Suzuki K Poulose >> >> Add support for handling the system registers for Embedded Trace >> Extensions (ETE). ETE shares most of the registers with ETMv4 except >> for some and also adds some new registers. Re-arrange the ETMv4x list >> to share the common definitions and add the ETE sysreg support. >> >> Cc: Mike Leach >> Cc: Mathieu Poirier >> Signed-off-by: Suzuki K Poulose >> Signed-off-by: Anshuman Khandual >> --- >> drivers/hwtracing/coresight/coresight-etm4x-core.c | 32 +++++++++++++ >> drivers/hwtracing/coresight/coresight-etm4x.h | 52 ++++++++++++++++++---- >> 2 files changed, 75 insertions(+), 9 deletions(-) >> >> diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c >> index 9edf8be..9e92d2a 100644 >> --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c >> +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c >> @@ -114,6 +114,38 @@ void etm4x_sysreg_write(u64 val, u32 offset, bool _relaxed, bool _64bit) >> } >> } >> >> +u64 ete_sysreg_read(u32 offset, bool _relaxed, bool _64bit) >> +{ >> + u64 res = 0; >> + >> + switch (offset) { >> + ETE_READ_CASES(res) >> + default : >> + WARN_ONCE(1, "ete: trying to read unsupported register @%x\n", >> + offset); > > Alignment > >> + } >> + >> + if (!_relaxed) >> + __iormb(res); /* Imitate the !relaxed I/O helpers */ >> + >> + return res; >> +} >> + >> +void ete_sysreg_write(u64 val, u32 offset, bool _relaxed, bool _64bit) >> +{ >> + if (!_relaxed) >> + __iowmb(); /* Imitate the !relaxed I/O helpers */ >> + if (!_64bit) >> + val &= GENMASK(31, 0); >> + >> + switch (offset) { >> + ETE_WRITE_CASES(val) >> + default : >> + WARN_ONCE(1, "ete: trying to write to unsupported register @%x\n", >> + offset); > > Alignment > >> + } >> +} > > The etm4x_sysreg_xyz() equivalent of these use a pr_warn_ratelimited() rather > than a WARN_ONE(). > > With that: > > Reviewed-by: Mathieu Poirier Converted to pr_warn_ratelimited() to both instances and fixed Alignment Cheers Suzuki