[PATCH v7 08/10] coresight-tpdm: Add timestamp control register support for the CMB

Suzuki K Poulose suzuki.poulose at arm.com
Tue Feb 13 02:22:39 PST 2024


n 13/02/2024 09:50, Arnd Bergmann wrote:
> On Sun, Feb 4, 2024, at 06:30, Tao Zhang wrote:
> 
>> @@ -910,7 +1014,7 @@ static struct attribute *tpdm_dsb_patt_attrs[] = {
>>   	DSB_PATT_MASK_ATTR(5),
>>   	DSB_PATT_MASK_ATTR(6),
>>   	DSB_PATT_MASK_ATTR(7),
>> -	&dev_attr_enable_ts.attr,
>> +	DSB_PATT_ENABLE_TS,
>>   	&dev_attr_set_type.attr,
>>   	NULL,
>>   };
>> @@ -964,6 +1068,7 @@ static struct attribute *tpdm_cmb_patt_attrs[] = {
>>   	CMB_PATT_ATTR(1),
>>   	CMB_PATT_MASK_ATTR(0),
>>   	CMB_PATT_MASK_ATTR(1),
>> +	CMB_PATT_ENABLE_TS,
>>   	NULL,
>>   };
>>
>> @@ -158,6 +175,10 @@
>>   		tpdm_simple_dataset_rw(tpmr##nr,		\
>>   		DSB_PATT_MASK, nr)
>>
>> +#define DSB_PATT_ENABLE_TS					\
>> +		tpdm_patt_enable_ts(enable_ts,			\
>> +		DSB_PATT)
>> +
>>   #define DSB_MSR_ATTR(nr)					\
>>   		tpdm_simple_dataset_rw(msr##nr,			\
>>   		DSB_MSR, nr)
> 
> This is causing build failures in linux-next now:
> 
> drivers/hwtracing/coresight/coresight-tpdm.c:1055:2: error: missing field 'idx' initializer [-Werror,-Wmissing-field-initializers]
>   1055 |         DSB_PATT_ENABLE_TS,
>        |         ^
> drivers/hwtracing/coresight/coresight-tpdm.h:184:3: note: expanded from macro 'DSB_PATT_ENABLE_TS'
>    184 |                 tpdm_patt_enable_ts(enable_ts,                  \
>        |                 ^
> drivers/hwtracing/coresight/coresight-tpdm.h:156:5: note: expanded from macro 'tpdm_patt_enable_ts'
>    156 |            }                                                    \
>        |            ^
> drivers/hwtracing/coresight/coresight-tpdm.c:1109:2: error: missing field 'idx' initializer [-Werror,-Wmissing-field-initializers]
>   1109 |         CMB_PATT_ENABLE_TS,
>        |         ^
> drivers/hwtracing/coresight/coresight-tpdm.h:208:3: note: expanded from macro 'CMB_PATT_ENABLE_TS'
>    208 |                 tpdm_patt_enable_ts(enable_ts,                  \
>        |                 ^
> drivers/hwtracing/coresight/coresight-tpdm.h:156:5: note: expanded from macro 'tpdm_patt_enable_ts'
>    156 |            }                                                    \
>        |            ^
> 
> Not sure what is going on, so I reverted your patch locally
> for my test setup.
> Can you send a fix to make it build again?

The idx field is not used for the {DSB,CMB}_PATT_ENABLE_TS attributes and
as such the macros do not set it. May be something like this fixes the problem ?
But any uninitiliased fields must be set to 0 implicitly ?

--->8---
coresight: tpdm: Fix build break due to uninitialised field

{CMB/DSB}_PATT_ENABLE_TS attributes do not use an index field.
But some compilers complain for uninitialised "index" field in
the struct tpdm_dataset_attribute:

drivers/hwtracing/coresight/coresight-tpdm.c:1055:2: error: missing field 'idx' initializer [-Werror,-Wmissing-field-initializers]
 1055 |         DSB_PATT_ENABLE_TS,
      |         ^
drivers/hwtracing/coresight/coresight-tpdm.h:184:3: note: expanded from macro 'DSB_PATT_ENABLE_TS'
  184 |                 tpdm_patt_enable_ts(enable_ts,                  \
      |                 ^
drivers/hwtracing/coresight/coresight-tpdm.h:156:5: note: expanded from macro 'tpdm_patt_enable_ts'
  156 |            }                                                    \
      |            ^
drivers/hwtracing/coresight/coresight-tpdm.c:1109:2: error: missing field 'idx' initializer [-Werror,-Wmissing-field-initializers]
 1109 |         CMB_PATT_ENABLE_TS,
      |         ^
drivers/hwtracing/coresight/coresight-tpdm.h:208:3: note: expanded from macro 'CMB_PATT_ENABLE_TS'
  208 |                 tpdm_patt_enable_ts(enable_ts,                  \
      |                 ^
drivers/hwtracing/coresight/coresight-tpdm.h:156:5: note: expanded from macro 'tpdm_patt_enable_ts'
  156 |            }                                                    \
      |            ^

Reported-by: Arnd Bergmann <arnd at arndb.de>
Cc: Tao Zhang <quic_taozha at quicinc.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose at arm.com>
---
 drivers/hwtracing/coresight/coresight-tpdm.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/hwtracing/coresight/coresight-tpdm.h b/drivers/hwtracing/coresight/coresight-tpdm.h
index f3a8f56d0fe7..e08d212642e3 100644
--- a/drivers/hwtracing/coresight/coresight-tpdm.h
+++ b/drivers/hwtracing/coresight/coresight-tpdm.h
@@ -153,6 +153,7 @@
 		__ATTR(name, 0644, enable_ts_show,		\
 		enable_ts_store),		\
 		mem,						\
+		0,						\
 	   }							\
 	})[0].attr.attr)
 
-- 
2.34.1




More information about the linux-arm-kernel mailing list