From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58F9DC19425 for ; Mon, 7 Dec 2020 02:09:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1944D22C9F for ; Mon, 7 Dec 2020 02:09:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728720AbgLGCJE (ORCPT ); Sun, 6 Dec 2020 21:09:04 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:9122 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726400AbgLGCJE (ORCPT ); Sun, 6 Dec 2020 21:09:04 -0500 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Cq6CV6t3mz15Tmr; Mon, 7 Dec 2020 10:07:50 +0800 (CST) Received: from [127.0.0.1] (10.65.95.32) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.487.0; Mon, 7 Dec 2020 10:08:14 +0800 Subject: Re: [PATCH v5] coresight: etm4x: Modify core-commit of cpu to avoid the overflow of HiSilicon ETM To: Mathieu Poirier References: <1606397670-15657-1-git-send-email-liuqi115@huawei.com> <20201204185551.GB1424711@xps15> CC: , , , , , From: Qi Liu Message-ID: <448eb009-da3e-b918-984d-cf563a64f31d@huawei.com> Date: Mon, 7 Dec 2020 10:08:14 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <20201204185551.GB1424711@xps15> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.65.95.32] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mathieu, On 2020/12/5 2:55, Mathieu Poirier wrote: > On Thu, Nov 26, 2020 at 09:34:30PM +0800, 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. >> Change since v4: >> - rename the call back function to a more generic name, and fix some >> compile warnings. >> >> drivers/hwtracing/coresight/Kconfig | 9 +++ >> drivers/hwtracing/coresight/coresight-etm4x-core.c | 88 ++++++++++++++++++++++ >> drivers/hwtracing/coresight/coresight-etm4x.h | 8 ++ >> 3 files changed, 105 insertions(+) >> >> diff --git a/drivers/hwtracing/coresight/Kconfig b/drivers/hwtracing/coresight/Kconfig >> index c119824..1cc3601 100644 >> --- a/drivers/hwtracing/coresight/Kconfig >> +++ b/drivers/hwtracing/coresight/Kconfig >> @@ -110,6 +110,15 @@ config CORESIGHT_SOURCE_ETM4X >> To compile this driver as a module, choose M here: the >> module will be called coresight-etm4x. >> >> +config ETM4X_IMPDEF_FEATURE >> + bool "Control overflow impdef support in CoreSight ETM 4.x driver " >> + depends on CORESIGHT_SOURCE_ETM4X >> + help >> + This control provides overflow implement define for CoreSight >> + ETM 4.x tracer module which could not reduce commit race >> + automatically, and could avoid overflow within ETM tracer module >> + and its cpu core. >> + >> config CORESIGHT_STM >> tristate "CoreSight System Trace Macrocell driver" >> depends on (ARM && !(CPU_32v3 || CPU_32v4 || CPU_32v4T)) || ARM64 >> diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c >> index abd706b..fcee27a 100644 >> --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c >> +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c >> @@ -3,6 +3,7 @@ >> * Copyright (c) 2014, The Linux Foundation. All rights reserved. >> */ >> >> +#include >> #include >> #include >> #include >> @@ -28,7 +29,9 @@ >> #include >> #include >> #include >> + >> #include >> +#include >> #include >> #include >> >> @@ -103,6 +106,87 @@ struct etm4_enable_arg { >> int rc; >> }; >> >> +#ifdef CONFIG_ETM4X_IMPDEF_FEATURE >> + >> +#define HISI_HIP08_AMBA_ID 0x000b6d01 >> +#define ETM4_AMBA_MASK 0xfffff >> +#define HISI_HIP08_CORE_COMMIT_CLEAR 0x3000 > > Here bit 12 and 13 are cleared but in etm4_hisi_config_core_commit() only bit 12 > is set - is this intentional? What is bit 13 for? > bit 12 and 13 are used together to set core-commit, 2'b00 means cpu is at full speed, 2'b01, 2'b10, 2'b11 means reduce the speed of cpu pipeline, and 2'b01 means speed is reduced to minimum value. So bit 12 and 13 should be cleared together in etm4_hisi_config_core_commit(). Qi >> +#define HISI_HIP08_CORE_COMMIT_SHIFT 12 >> +#define HISI_HIP08_CORE_COMMIT_REG sys_reg(3, 1, 15, 2, 5) >> + >> +struct etm4_arch_features { >> + void (*arch_callback)(bool enable); >> +}; >> + >> +static bool etm4_hisi_match_pid(unsigned int id) >> +{ >> + return (id & ETM4_AMBA_MASK) == HISI_HIP08_AMBA_ID; >> +} >> + >> +static void etm4_hisi_config_core_commit(bool enable) >> +{ >> + u64 val; >> + >> + val = read_sysreg_s(HISI_HIP08_CORE_COMMIT_REG); >> + val &= ~HISI_HIP08_CORE_COMMIT_CLEAR; >> + val |= enable << HISI_HIP08_CORE_COMMIT_SHIFT; >> + write_sysreg_s(val, HISI_HIP08_CORE_COMMIT_REG); >> +} >> + >> +static struct etm4_arch_features etm4_features[] = { >> + [ETM4_IMPDEF_HISI_CORE_COMMIT] = { >> + .arch_callback = etm4_hisi_config_core_commit, >> + }, >> + {}, >> +}; >> + >> +static void etm4_enable_arch_specific(struct etmv4_drvdata *drvdata) >> +{ >> + struct etm4_arch_features *ftr; >> + int bit; >> + >> + for_each_set_bit(bit, drvdata->arch_features, ETM4_IMPDEF_FEATURE_MAX) { >> + ftr = &etm4_features[bit]; >> + >> + if (ftr->arch_callback) >> + ftr->arch_callback(true); >> + } >> +} >> + >> +static void etm4_disable_arch_specific(struct etmv4_drvdata *drvdata) >> +{ >> + struct etm4_arch_features *ftr; >> + int bit; >> + >> + for_each_set_bit(bit, drvdata->arch_features, ETM4_IMPDEF_FEATURE_MAX) { >> + ftr = &etm4_features[bit]; >> + >> + if (ftr->arch_callback) >> + ftr->arch_callback(false); >> + } >> +} >> + >> +static void etm4_check_arch_features(struct etmv4_drvdata *drvdata, >> + unsigned int id) >> +{ >> + if (etm4_hisi_match_pid(id)) >> + set_bit(ETM4_IMPDEF_HISI_CORE_COMMIT, drvdata->arch_features); >> +} >> +#else >> +static void etm4_enable_arch_specific(struct etmv4_drvdata *drvdata) >> +{ >> +} >> + >> +static void etm4_disable_arch_specific(struct etmv4_drvdata *drvdata) >> +{ >> +} >> + >> +static void etm4_check_arch_features(struct etmv4_drvdata *drvdata, >> + unsigned int id) >> +{ >> +} >> +#endif /* CONFIG_ETM4X_IMPDEF_FEATURE */ >> + >> static int etm4_enable_hw(struct etmv4_drvdata *drvdata) >> { >> int i, rc; >> @@ -110,6 +194,7 @@ static int etm4_enable_hw(struct etmv4_drvdata *drvdata) >> struct device *etm_dev = &drvdata->csdev->dev; >> >> CS_UNLOCK(drvdata->base); >> + etm4_enable_arch_specific(drvdata); >> >> etm4_os_unlock(drvdata); >> >> @@ -476,6 +561,7 @@ static void etm4_disable_hw(void *info) >> int i; >> >> CS_UNLOCK(drvdata->base); >> + etm4_disable_arch_specific(drvdata); >> >> if (!drvdata->skip_power_up) { >> /* power can be removed from the trace unit now */ >> @@ -1547,6 +1633,8 @@ static int etm4_probe(struct amba_device *adev, const struct amba_id *id) >> drvdata->boot_enable = true; >> } >> >> + etm4_check_arch_features(drvdata, id->id); >> + >> return 0; >> } >> >> diff --git a/drivers/hwtracing/coresight/coresight-etm4x.h b/drivers/hwtracing/coresight/coresight-etm4x.h >> index eefc737..3dd3e06 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,7 @@ 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); >> }; >> >> /* Address comparator access types */ >> -- >> 2.8.1 >> > > . > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6262C433FE for ; Mon, 7 Dec 2020 02:09:44 +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 7E12422C7E for ; Mon, 7 Dec 2020 02:09:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7E12422C7E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.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:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rNathY+1MR7lqyhqqDUozqhKyhbs3YSobCPkVrBRyVo=; b=SVomIiXbyj7jcJJhH43a2bOKK 3agbUmH2ov0np7lz6hUjxm4jRogfmoBL7kZmeaW2YvtSM7dX7xPiVSqq481PWLxPTl0olBYP++ciQ St+tRIzt0+fvTjrMuffPh6Zkyo/ZCdiesZ6vkb4Td6UdF1piSfNTbTRU8A/++4WcRfYiAtKajwVcI J2HXODAWG8nVEEIdKvjg5VHK2KxOljo5lasv7ti2INDkgHYbVIDEoMjb8FMawdjQ99g1zdQ43jq9V s+t2W107DjLdRVGv35SgQEXk5bk+5f5MiYWQiDwTZVIShNXnfLHWHkV8o4LlgqyhVU6uFOuKM+8rv Mzdkd5nww==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1km5x8-00017i-4J; Mon, 07 Dec 2020 02:08:38 +0000 Received: from szxga04-in.huawei.com ([45.249.212.190]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1km5x3-00015Y-1x for linux-arm-kernel@lists.infradead.org; Mon, 07 Dec 2020 02:08:34 +0000 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Cq6CV6t3mz15Tmr; Mon, 7 Dec 2020 10:07:50 +0800 (CST) Received: from [127.0.0.1] (10.65.95.32) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.487.0; Mon, 7 Dec 2020 10:08:14 +0800 Subject: Re: [PATCH v5] coresight: etm4x: Modify core-commit of cpu to avoid the overflow of HiSilicon ETM To: Mathieu Poirier References: <1606397670-15657-1-git-send-email-liuqi115@huawei.com> <20201204185551.GB1424711@xps15> From: Qi Liu Message-ID: <448eb009-da3e-b918-984d-cf563a64f31d@huawei.com> Date: Mon, 7 Dec 2020 10:08:14 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <20201204185551.GB1424711@xps15> X-Originating-IP: [10.65.95.32] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201206_210833_607398_78B8AA3E X-CRM114-Status: GOOD ( 24.51 ) 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: suzuki.poulose@arm.com, coresight@lists.linaro.org, linuxarm@huawei.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, mike.leach@linaro.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Mathieu, On 2020/12/5 2:55, Mathieu Poirier wrote: > On Thu, Nov 26, 2020 at 09:34:30PM +0800, 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. >> Change since v4: >> - rename the call back function to a more generic name, and fix some >> compile warnings. >> >> drivers/hwtracing/coresight/Kconfig | 9 +++ >> drivers/hwtracing/coresight/coresight-etm4x-core.c | 88 ++++++++++++++++++++++ >> drivers/hwtracing/coresight/coresight-etm4x.h | 8 ++ >> 3 files changed, 105 insertions(+) >> >> diff --git a/drivers/hwtracing/coresight/Kconfig b/drivers/hwtracing/coresight/Kconfig >> index c119824..1cc3601 100644 >> --- a/drivers/hwtracing/coresight/Kconfig >> +++ b/drivers/hwtracing/coresight/Kconfig >> @@ -110,6 +110,15 @@ config CORESIGHT_SOURCE_ETM4X >> To compile this driver as a module, choose M here: the >> module will be called coresight-etm4x. >> >> +config ETM4X_IMPDEF_FEATURE >> + bool "Control overflow impdef support in CoreSight ETM 4.x driver " >> + depends on CORESIGHT_SOURCE_ETM4X >> + help >> + This control provides overflow implement define for CoreSight >> + ETM 4.x tracer module which could not reduce commit race >> + automatically, and could avoid overflow within ETM tracer module >> + and its cpu core. >> + >> config CORESIGHT_STM >> tristate "CoreSight System Trace Macrocell driver" >> depends on (ARM && !(CPU_32v3 || CPU_32v4 || CPU_32v4T)) || ARM64 >> diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c >> index abd706b..fcee27a 100644 >> --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c >> +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c >> @@ -3,6 +3,7 @@ >> * Copyright (c) 2014, The Linux Foundation. All rights reserved. >> */ >> >> +#include >> #include >> #include >> #include >> @@ -28,7 +29,9 @@ >> #include >> #include >> #include >> + >> #include >> +#include >> #include >> #include >> >> @@ -103,6 +106,87 @@ struct etm4_enable_arg { >> int rc; >> }; >> >> +#ifdef CONFIG_ETM4X_IMPDEF_FEATURE >> + >> +#define HISI_HIP08_AMBA_ID 0x000b6d01 >> +#define ETM4_AMBA_MASK 0xfffff >> +#define HISI_HIP08_CORE_COMMIT_CLEAR 0x3000 > > Here bit 12 and 13 are cleared but in etm4_hisi_config_core_commit() only bit 12 > is set - is this intentional? What is bit 13 for? > bit 12 and 13 are used together to set core-commit, 2'b00 means cpu is at full speed, 2'b01, 2'b10, 2'b11 means reduce the speed of cpu pipeline, and 2'b01 means speed is reduced to minimum value. So bit 12 and 13 should be cleared together in etm4_hisi_config_core_commit(). Qi >> +#define HISI_HIP08_CORE_COMMIT_SHIFT 12 >> +#define HISI_HIP08_CORE_COMMIT_REG sys_reg(3, 1, 15, 2, 5) >> + >> +struct etm4_arch_features { >> + void (*arch_callback)(bool enable); >> +}; >> + >> +static bool etm4_hisi_match_pid(unsigned int id) >> +{ >> + return (id & ETM4_AMBA_MASK) == HISI_HIP08_AMBA_ID; >> +} >> + >> +static void etm4_hisi_config_core_commit(bool enable) >> +{ >> + u64 val; >> + >> + val = read_sysreg_s(HISI_HIP08_CORE_COMMIT_REG); >> + val &= ~HISI_HIP08_CORE_COMMIT_CLEAR; >> + val |= enable << HISI_HIP08_CORE_COMMIT_SHIFT; >> + write_sysreg_s(val, HISI_HIP08_CORE_COMMIT_REG); >> +} >> + >> +static struct etm4_arch_features etm4_features[] = { >> + [ETM4_IMPDEF_HISI_CORE_COMMIT] = { >> + .arch_callback = etm4_hisi_config_core_commit, >> + }, >> + {}, >> +}; >> + >> +static void etm4_enable_arch_specific(struct etmv4_drvdata *drvdata) >> +{ >> + struct etm4_arch_features *ftr; >> + int bit; >> + >> + for_each_set_bit(bit, drvdata->arch_features, ETM4_IMPDEF_FEATURE_MAX) { >> + ftr = &etm4_features[bit]; >> + >> + if (ftr->arch_callback) >> + ftr->arch_callback(true); >> + } >> +} >> + >> +static void etm4_disable_arch_specific(struct etmv4_drvdata *drvdata) >> +{ >> + struct etm4_arch_features *ftr; >> + int bit; >> + >> + for_each_set_bit(bit, drvdata->arch_features, ETM4_IMPDEF_FEATURE_MAX) { >> + ftr = &etm4_features[bit]; >> + >> + if (ftr->arch_callback) >> + ftr->arch_callback(false); >> + } >> +} >> + >> +static void etm4_check_arch_features(struct etmv4_drvdata *drvdata, >> + unsigned int id) >> +{ >> + if (etm4_hisi_match_pid(id)) >> + set_bit(ETM4_IMPDEF_HISI_CORE_COMMIT, drvdata->arch_features); >> +} >> +#else >> +static void etm4_enable_arch_specific(struct etmv4_drvdata *drvdata) >> +{ >> +} >> + >> +static void etm4_disable_arch_specific(struct etmv4_drvdata *drvdata) >> +{ >> +} >> + >> +static void etm4_check_arch_features(struct etmv4_drvdata *drvdata, >> + unsigned int id) >> +{ >> +} >> +#endif /* CONFIG_ETM4X_IMPDEF_FEATURE */ >> + >> static int etm4_enable_hw(struct etmv4_drvdata *drvdata) >> { >> int i, rc; >> @@ -110,6 +194,7 @@ static int etm4_enable_hw(struct etmv4_drvdata *drvdata) >> struct device *etm_dev = &drvdata->csdev->dev; >> >> CS_UNLOCK(drvdata->base); >> + etm4_enable_arch_specific(drvdata); >> >> etm4_os_unlock(drvdata); >> >> @@ -476,6 +561,7 @@ static void etm4_disable_hw(void *info) >> int i; >> >> CS_UNLOCK(drvdata->base); >> + etm4_disable_arch_specific(drvdata); >> >> if (!drvdata->skip_power_up) { >> /* power can be removed from the trace unit now */ >> @@ -1547,6 +1633,8 @@ static int etm4_probe(struct amba_device *adev, const struct amba_id *id) >> drvdata->boot_enable = true; >> } >> >> + etm4_check_arch_features(drvdata, id->id); >> + >> return 0; >> } >> >> diff --git a/drivers/hwtracing/coresight/coresight-etm4x.h b/drivers/hwtracing/coresight/coresight-etm4x.h >> index eefc737..3dd3e06 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,7 @@ 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); >> }; >> >> /* Address comparator access types */ >> -- >> 2.8.1 >> > > . > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel