--- zzzz-none-000/linux-4.4.271/drivers/hwtracing/coresight/coresight-etm4x.h 2021-06-03 06:22:09.000000000 +0000 +++ hawkeye-5590-750/linux-4.4.271/drivers/hwtracing/coresight/coresight-etm4x.h 2023-04-19 10:22:28.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved. +/* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -14,7 +14,9 @@ #define _CORESIGHT_CORESIGHT_ETM_H #include +#include #include "coresight-priv.h" +#include /* * Device registers: @@ -185,12 +187,14 @@ * @dev: The device entity associated to this component. * @csdev: Component vitals needed by the framework. * @spinlock: Only one at a time pls. + * @mutex: Avoid race condition between hotplug and probe path. * @cpu: The cpu this component is affined to. * @arch: ETM version number. * @enable: Is this ETM currently tracing. * @sticky_enable: true if ETM base configuration has been done. * @boot_enable:True if we should start tracing at boot time. * @os_unlock: True if access to management registers is allowed. + * @init: True if ETM is initialzied * @nr_pe: The number of processing entity available for tracing. * @nr_pe_cmp: The number of processing entity comparator inputs that are * available for tracing. @@ -280,18 +284,21 @@ * @ns_ex_level:In non-secure state, indicates whether instruction tracing is * supported for the corresponding Exception level. * @ext_inp: External input selection. + * @reg_data: MSM memory dump data */ struct etmv4_drvdata { void __iomem *base; struct device *dev; struct coresight_device *csdev; spinlock_t spinlock; + struct mutex mutex; int cpu; u8 arch; bool enable; bool sticky_enable; bool boot_enable; bool os_unlock; + bool init; u8 nr_pe; u8 nr_pe_cmp; u8 nr_addr_cmp; @@ -366,6 +373,7 @@ u8 s_ex_level; u8 ns_ex_level; u32 ext_inp; + struct msm_dump_data reg_data; }; /* Address comparator access types */