drm/amdgpu: Use unique CPER record id across devices
Subsystems (2)
PATCH 1/1 drm/amdgpu: Use unique CPER record id across devices
Encode socket id to CPER record id to be unique across devices.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c +5 -1
@@ -57,6 +57,8 @@ void amdgpu_cper_entry_fill_hdr(struct amdgpu_device *adev,enum amdgpu_cper_type type, enum cper_error_severity sev) { + char record_id[16]; + hdr->signature[0 ] ='C' ; hdr->signature[1 ] ='P' ; hdr->signature[2 ] ='E' ;
@@ -71,7 +73,9 @@ void amdgpu_cper_entry_fill_hdr(struct amdgpu_device *adev,amdgpu_cper_get_timestamp (&hdr->timestamp); -snprintf (hdr->record_id,8 ,"%d" ,atomic_inc_return (&adev->cper.unique_id)); +snprintf (record_id,9 ,"%d:%X" , adev->smuio.funcs->get_socket_id (adev), +atomic_inc_return (&adev->cper.unique_id)); +memcpy (hdr->record_id, record_id,8 );snprintf (hdr->platform_id,16 ,"0x%04X:0x%04X" , adev->pdev->vendor, adev->pdev->device);/* pmfw version should be part of creator_id according to CPER spec */
Signature · 1 line
2.34.1
[AMD Official Use Only - AMD Internal Distribution Only]
Quoted 30 lines
-----Original Message-----
From: Liu, Xiang(Dean) <[email protected]>
Sent: Thursday, March 6, 2025 3:25 PM
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Zhou1, Tao <[email protected]>; Liu, Xiang(Dean) <[email protected]>
Subject: [PATCH] drm/amdgpu: Use unique CPER record id across devicesEncode socket id to CPER record id to be unique across devices.
Signed-off-by Xiang Liu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c +2
-0@@ -57,6 +57,8 @@ void amdgpu_cper_entry_fill_hdr(struct amdgpu_device *adev,enum amdgpu_cper_type type, enum cper_error_severity sev) { + char record_id[16]; + hdr->signature[0 ] ='C' ; hdr->signature[1 ] ='P' ; hdr->signature[2 ] ='E' ;
drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c void amdgpu_cper_entry_fill_hdr(struct amdgpu_device *adev, · line 77
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c +2
-1@@ -71,7 +73,9 @@ void amdgpu_cper_entry_fill_hdr(struct amdgpu_device *adev,amdgpu_cper_get_timestamp (&hdr->timestamp); -snprintf (hdr->record_id,8 ,"%d" ,atomic_inc_return (&adev->cper.unique_id)); +snprintf (record_id,9 ,"%d:%X" , adev->smuio.funcs->get_socket_id (adev), +atomic_inc_return (&adev->cper.unique_id));
[Tao] please add pointer check for adev->smuio.funcs->get_socket_id before use it, and we set the id to 0 if adev->smuio.funcs->get_socket_id is NULL.
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c +1
-1+memcpy (hdr->record_id, record_id,8 );snprintf (hdr->platform_id,16 ,"0x%04X:0x%04X" , adev->pdev->vendor, adev->pdev->device);/* pmfw version should be part of creator_id according to CPER spec */ --2.34.1