Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp868902pxu; Mon, 23 Nov 2020 06:15:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJwOtLU0w4ZOjevc7Oa9F7IDjSRfhRV7dByWCVrT4EZbeiVEz3ApGHinufTC24kW3dU7M6v+ X-Received: by 2002:a17:906:a996:: with SMTP id jr22mr45257833ejb.463.1606140941009; Mon, 23 Nov 2020 06:15:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606140941; cv=none; d=google.com; s=arc-20160816; b=R2BaQud35hV5Wl023gRXD4PP13JNkpk0aKm7CgInkyGydRwoJHoJKS1fd5cfeCOBOP Ju0vgcL9RBEIt2s5f6NLu4qbP9Pu40QMktTUwD8r7JXzest/OJ2GgbtmrMmLK/5c4owt 6v/QUU9Fy7wxHe3vsspypBvPhwX2qZpTwzp5YexnDAlLADp4FIwFqno09yQNWxgM6cZ2 dTc7F5J2g+CHQl3sxNsH4R5/MM6wdF8p5zopi9Vrer4XsvO+vOTWmGr4KO2hHlR11eZ4 Or5nEuE1T3V0nxHvZICq+fcZnGlUITlHiNCGvAXZ9JwhTYfHH+19yDVEps/gKpARH6KS 53uw== 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=PtnFTeRjHfZjFhD4G2WRLbFxwozm0q6mCLurdThNEuE=; b=A2IeyWD8PhjHCKJy3uLa8DS5nwaI+2lyWXZXKy1ltVRIr7O/mBUwoHmZluawvRbbBU TClQlFeDhQirMpWcWGBWqp7KAqxdSVXuR5hf6Y9zG/3Y1bnmu+66x59Y2250Xao5r+ZD bJ97VmNpDVc4a7jAbdByK3/GxSoMAlMhIfqj49/Foh7PFgQw+YdmACd/+ZdLQ29Xcbyw YYPNQavoYnyBHSKEawCgX69YStXwN5SohrWwFw+O/l3vslqhiC2n0Ig7uTVFD3926Hli t3XnyM0yi2Q0dk0nfQyNCI4E5QznERKoWGydEmoA3mIGuRUqAh3fVq6ZCG4NSbCdGiRW ou5w== 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 z61si6791502ede.133.2020.11.23.06.15.15; Mon, 23 Nov 2020 06:15:40 -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 S1730778AbgKWOND (ORCPT + 99 others); Mon, 23 Nov 2020 09:13:03 -0500 Received: from foss.arm.com ([217.140.110.172]:50980 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729562AbgKWONC (ORCPT ); Mon, 23 Nov 2020 09:13:02 -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 02278101E; Mon, 23 Nov 2020 06:13:02 -0800 (PST) Received: from [10.57.53.209] (unknown [10.57.53.209]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8336C3F718; Mon, 23 Nov 2020 06:13:00 -0800 (PST) Subject: Re: [PATCH] coresight: etm4x: Modify core-commit of cpu to avoid the overflow of HiSilicon ETM To: Qi Liu , mathieu.poirier@linaro.org, mike.leach@linaro.org Cc: coresight@lists.linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxarm@huawei.com References: <1606138167-8076-1-git-send-email-liuqi115@huawei.com> From: Suzuki K Poulose Message-ID: Date: Mon, 23 Nov 2020 14:12:54 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <1606138167-8076-1-git-send-email-liuqi115@huawei.com> 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 Hi Qi Thanks for the changes. Mostly looks good to me, except for the name of the call back. On 11/23/20 1:29 PM, Qi Liu wrote: > The ETM device can't keep up with the core pipeline when cpu core > is at full speed. This may cause overflow within core and its ETM. > This is a common phenomenon on ETM devices. > > On HiSilicon Hip08 platform, a specific feature is added to set > core pipeline. So commit rate can be reduced manually to avoid ETM > overflow. > > Signed-off-by: Qi Liu > --- > Change since v1: > - add CONFIG_ETM4X_IMPDEF_FEATURE and CONFIG_ETM4X_IMPDEF_HISILICON > to keep specific feature off platforms which don't use it. > Change since v2: > - remove some unused variable. > Change since v3: > - use read/write_sysreg_s() to access register. > > drivers/hwtracing/coresight/Kconfig | 9 +++ > drivers/hwtracing/coresight/coresight-etm4x-core.c | 84 ++++++++++++++++++++++ > drivers/hwtracing/coresight/coresight-etm4x.h | 12 ++++ > 3 files changed, 105 insertions(+) > > > diff --git a/drivers/hwtracing/coresight/coresight-etm4x.h b/drivers/hwtracing/coresight/coresight-etm4x.h > index eefc737..1784975 100644 > --- a/drivers/hwtracing/coresight/coresight-etm4x.h > +++ b/drivers/hwtracing/coresight/coresight-etm4x.h > @@ -8,6 +8,7 @@ > > #include > #include > +#include > #include "coresight-priv.h" > > /* > @@ -203,6 +204,11 @@ > /* Interpretation of resource numbers change at ETM v4.3 architecture */ > #define ETM4X_ARCH_4V3 0x43 > > +enum etm_impdef_type { > + ETM4_IMPDEF_HISI_CORE_COMMIT, > + ETM4_IMPDEF_FEATURE_MAX, > +}; > + > /** > * struct etmv4_config - configuration information related to an ETMv4 > * @mode: Controls various modes supported by this ETM. > @@ -415,6 +421,7 @@ struct etmv4_save_state { > * @state_needs_restore: True when there is context to restore after PM exit > * @skip_power_up: Indicates if an implementation can skip powering up > * the trace unit. > + * @arch_features: Bitmap of arch features of etmv4 devices. > */ > struct etmv4_drvdata { > void __iomem *base; > @@ -463,6 +470,11 @@ struct etmv4_drvdata { > struct etmv4_save_state *save_state; > bool state_needs_restore; > bool skip_power_up; > + DECLARE_BITMAP(arch_features, ETM4_IMPDEF_FEATURE_MAX); > +}; > + > +struct etm4_arch_features { > + void (*set_commit)(bool enable); The set_commit is too hisilicon specific :-). Could we please rename this to soemthing more generic. The callback for hisilicon etms, could still be xx_commit". May be simply call it callback() ? or may be even arch_callback() ? > }; nit: This need not be part of the header file, as it is not used outside the etm4x-core.c Suzuki