[Skiboot] [PATCH v2 6/7] hw/npu2: Dump (more) npu2 registers on link error and HMIs

Frederic Barrat fbarrat at linux.ibm.com
Thu Apr 4 22:50:39 AEDT 2019



Le 04/04/2019 à 07:52, Andrew Donnellan a écrit :

>> --- a/hw/npu2-common.c
>> +++ b/hw/npu2-common.c
>> @@ -103,6 +103,304 @@ void npu2_write_mask_4b(struct npu2 *p, uint64_t 
>> reg, uint32_t val, uint32_t mas
>>               (uint64_t)new_val << 32);
>>   }
>> +typedef struct {
>> +    const char *name;
>> +    uint32_t block;
>> +    uint32_t offset;
>> +} npu2_scom_dump_t;
>> +
>> +static npu2_scom_dump_t npu2_scom_dump_global[] = {
>> +#define __NPU2_SCOM_DUMP(name, block, offset) { name, block, offset }
> 
> What's the benefit of using this macro? And if we are going to use it, 
> can we define it outside of the array definition?


You're right, it's now useless and it contributes to making the lines 
longer. I'll remove it.


>> +void npu2_dump_scoms(int chip_id)
> 
> Can we rename this something that's less likely to get mentally confused 
> with "dump_npu2_regs"? I don't have suggestions.


What about keeping npu2_dump_scoms() for the external call (keeping the 
desired npu2_ prefix), but renaming the static subfunctions 
show_global_regs/show_nvlink_regs/show_opencapi_regs ?

  Fred



More information about the Skiboot mailing list