[PATCH 6/6] drm/amdgpu: add ip dump for each ip in devcoredump

Khatri, Sunil sukhatri at amd.com
Tue Apr 16 17:37:01 UTC 2024


On 4/16/2024 7:29 PM, Alex Deucher wrote:
> On Tue, Apr 16, 2024 at 8:08 AM Sunil Khatri <sunil.khatri at amd.com> wrote:
>> Add ip dump for each ip of the asic in the
>> devcoredump for all the ips where a callback
>> is registered for register dump.
>>
>> Signed-off-by: Sunil Khatri <sunil.khatri at amd.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c | 15 +++++++++++++++
>>   1 file changed, 15 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c
>> index 64fe564b8036..70167f63b4f5 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c
>> @@ -262,6 +262,21 @@ amdgpu_devcoredump_read(char *buffer, loff_t offset, size_t count,
>>          drm_printf(&p, "Faulty page starting at address: 0x%016llx\n", fault_info->addr);
>>          drm_printf(&p, "Protection fault status register: 0x%x\n\n", fault_info->status);
>>
>> +       /* dump the ip state for each ip */
>> +       drm_printf(&p, "Register Dump\n");
>> +       for (int i = 0; i < coredump->adev->num_ip_blocks; i++) {
>> +               if (coredump->adev->ip_blocks[i].version->funcs->print_ip_state) {
>> +                       drm_printf(&p, "IP: %s\n",
>> +                                  coredump->adev->ip_blocks[i]
>> +                                          .version->funcs->name);
>> +                       drm_printf(&p, "Offset \t Value\n");
> I think we can drop the drm_printf line above if we use register names
> rather than offsets in the print functions.  This also allows IPs to
> dump stuff besides registers if they want.

Noted

Sunil

>
> Alex
>
>> +                       coredump->adev->ip_blocks[i]
>> +                               .version->funcs->print_ip_state(
>> +                                       (void *)coredump->adev, &p);
>> +                       drm_printf(&p, "\n");
>> +               }
>> +       }
>> +
>>          /* Add ring buffer information */
>>          drm_printf(&p, "Ring buffer information\n");
>>          for (int i = 0; i < coredump->adev->num_rings; i++) {
>> --
>> 2.34.1
>>


More information about the amd-gfx mailing list