MISC fixes
Subsystems (3)
cover MISC fixes
Oak Zeng (3):
drm/amdkfd: Disallow debugfs to hang hws when GPU is resetting drm/amdgpu: Fix a printing message
drm/amdgpu: Change a few function names
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 16 ++++++++-------- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 5 +++++ 6 files changed, 17 insertions(+), 12 deletions(-)
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 1/3 drm/amdkfd: Disallow debugfs to hang hws when GPU is resetting
If GPU is during a resetting cycle, writing to GPU can cause unpredictable protection fault, see below call trace. Disallow using kfd debugfs hang_hws to hang hws if GPU is resetting.
[12808.234114] general protection fault: 0000 [#1] SMP NOPTI [12808.234119] CPU: 13 PID: 6334 Comm: tee Tainted: G OE 5.4.0-77-generic #86-Ubuntu [12808.234121] Hardware name: ASUS System Product Name/Pro WS WRX80E-SAGE SE WIFI, BIOS 0211 11/27/2020 [12808.234220] RIP: 0010:kq_submit_packet+0xd/0x50 [amdgpu] [12808.234222] Code: 8b 45 d0 48 c7 00 00 00 00 00 b8 f4 ff ff ff eb df 66 66 2e 0f 1f 84 00 00 00 00 00 90 0f 1f 44 00 00 55 48 8b 17 48 8b 47 48 <48> 8b 52 08 48 89 e5 83 7a 20 08 74 14 8b 77 20 89 30 48 8b 47 10 [12808.234224] RSP: 0018:ffffb0bf4954bdc0 EFLAGS: 00010216 [12808.234226] RAX: ffffb0bf4a1a5a00 RBX: ffff99302895c0c8 RCX: 0000000000000000 [12808.234227] RDX: c3156d43d3a04949 RSI: 0000000000000055 RDI: ffff99302584c300 [12808.234228] RBP: ffffb0bf4954bdf8 R08: 0000000000000543 R09: ffffb0bf4a1a4230 [12808.234229] R10: 000000000000000a R11: f000000000000000 R12: 0000000000000000 [12808.234230] R13: ffff99302895c0d8 R14: 00007ffebb3d18f0 R15: 0000000000000005 [12808.234232] FS: 00007f0d822ef580(0000) GS:ffff99307d340000(0000) knlGS:0000000000000000 [12808.234233] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [12808.234234] CR2: 00007ffebb3d1908 CR3: 0000001efe1ec000 CR4: 0000000000340ee0 [12808.234235] Call Trace: [12808.234324] ? pm_debugfs_hang_hws+0x71/0xd0 [amdgpu] [12808.234408] kfd_debugfs_hang_hws+0x2e/0x50 [amdgpu] [12808.234494] kfd_debugfs_hang_hws_write+0xb6/0xc0 [amdgpu] [12808.234499] full_proxy_write+0x5c/0x90 [12808.234502] __vfs_write+0x1b/0x40 [12808.234504] vfs_write+0xb9/0x1a0 [12808.234506] ksys_write+0x67/0xe0 [12808.234508] __x64_sys_write+0x1a/0x20 [12808.234511] do_syscall_64+0x57/0x190 [12808.234514] entry_SYSCALL_64_after_hwframe+0x44/0xa9
--- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/amdkfd/kfd_device.c +5 -0
@@ -1390,6 +1390,11 @@ int kfd_debugfs_hang_hws(struct kfd_dev *dev)return -EINVAL ; } +if (dev->dqm->is_resetting) { +pr_err ("HWS is already resetting, please wait for the current reset to finish\n" ); +return -EBUSY ; + } + r =pm_debugfs_hang_hws (&dev->dqm->packets);if (!r) r =dqm_debugfs_execute_queues (dev->dqm);
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Felix Kuehling
maintainerRe: [PATCH 1/3] drm/amdkfd: Disallow debugfs to hang hws when GPU is resetting
Am 2021-07-14 um 11:25 a.m. schrieb Oak Zeng:
Quoted 51 lines
If GPU is during a resetting cycle, writing to GPU can cause unpredictable protection fault, see below call trace. Disallow using kfd debugfs
hang_hwsto hang hws if GPU is resetting.[12808.234114] general protection fault: 0000 [#1] SMP NOPTI [12808.234119] CPU: 13 PID: 6334 Comm: tee Tainted: G OE 5.4.0-77-generic #86-Ubuntu [12808.234121] Hardware name: ASUS System Product Name/Pro WS WRX80E-SAGE SE WIFI, BIOS 0211 11/27/2020 [12808.234220] RIP: 0010:kq_submit_packet+0xd/0x50 [amdgpu] [12808.234222] Code: 8b 45 d0 48 c7 00 00 00 00 00 b8 f4 ff ff ff eb df 66 66 2e 0f 1f 84 00 00 00 00 00 90 0f 1f 44 00 00 55 48 8b 17 48 8b 47 48 <48> 8b 52 08 48 89 e5 83 7a 20 08 74 14 8b 77 20 89 30 48 8b 47 10 [12808.234224] RSP: 0018:ffffb0bf4954bdc0 EFLAGS: 00010216 [12808.234226] RAX: ffffb0bf4a1a5a00 RBX: ffff99302895c0c8 RCX: 0000000000000000 [12808.234227] RDX: c3156d43d3a04949 RSI: 0000000000000055 RDI: ffff99302584c300 [12808.234228] RBP: ffffb0bf4954bdf8 R08: 0000000000000543 R09: ffffb0bf4a1a4230 [12808.234229] R10: 000000000000000a R11: f000000000000000 R12: 0000000000000000 [12808.234230] R13: ffff99302895c0d8 R14: 00007ffebb3d18f0 R15: 0000000000000005 [12808.234232] FS: 00007f0d822ef580(0000) GS:ffff99307d340000(0000) knlGS:0000000000000000 [12808.234233] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [12808.234234] CR2: 00007ffebb3d1908 CR3: 0000001efe1ec000 CR4: 0000000000340ee0 [12808.234235] Call Trace: [12808.234324] ? pm_debugfs_hang_hws+0x71/0xd0 [amdgpu] [12808.234408] kfd_debugfs_hang_hws+0x2e/0x50 [amdgpu] [12808.234494] kfd_debugfs_hang_hws_write+0xb6/0xc0 [amdgpu] [12808.234499] full_proxy_write+0x5c/0x90 [12808.234502] __vfs_write+0x1b/0x40 [12808.234504] vfs_write+0xb9/0x1a0 [12808.234506] ksys_write+0x67/0xe0 [12808.234508] __x64_sys_write+0x1a/0x20 [12808.234511] do_syscall_64+0x57/0x190 [12808.234514] entry_SYSCALL_64_after_hwframe+0x44/0xa9Signed-off-by Oak Zeng <[email protected]>--- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/gpu/drm/amd/amdkfd/kfd_device.c +0
-0
drivers/gpu/drm/amd/amdkfd/kfd_device.c int kfd_debugfs_hang_hws(struct kfd_dev *dev) · line 1393
Quoted 4 lines
drivers/gpu/drm/amd/amdkfd/kfd_device.c +1
-0@@ -1390,6 +1390,11 @@ int kfd_debugfs_hang_hws(struct kfd_dev *dev)return -EINVAL ; } +if (dev->dqm->is_resetting) {
Checking dev->dqm->is_resetting without holding the dqm_lock is incorrect. The problem is not really the fact, that it's resetting, but that dqm->packets (the packet manager) is not initialized at that time.
A more general solution would be to move the pm_debugfs_hang_hws call into dqm_debugfs_execute_queues, which does take the dqm_lock, and add a check for dqm->packets while holding the lock.
Regards,
Felix
drivers/gpu/drm/amd/amdkfd/kfd_device.c int kfd_debugfs_hang_hws(struct kfd_dev *dev) · line 1400
Quoted 7 lines
drivers/gpu/drm/amd/amdkfd/kfd_device.c +4
-0+pr_err ("HWS is already resetting, please wait for the current reset to finish\n" ); +return -EBUSY ; + } + r =pm_debugfs_hang_hws (&dev->dqm->packets);if (!r) r =dqm_debugfs_execute_queues (dev->dqm);
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/3 drm/amdgpu: Fix a printing message
In reply to Oak ZengThe printing message "PSP loading VCN firmware" is mis-leading because people might think driver is loading VCN firmware. Actually when this message is printed, driver is just preparing some VCN ucode, not loading VCN firmware yet. The actual VCN firmware loading will be in the PSP block hw_init. Fix the printing message
--- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +1 -1
@@ -119,7 +119,7 @@ static int vcn_v1_0_sw_init(void *handle) adev->firmware.ucode[AMDGPU_UCODE_ID_VCN ].fw = adev->vcn.fw; adev->firmware.fw_size +=ALIGN (le32_to_cpu (hdr->ucode_size_bytes),PAGE_SIZE ); -DRM_INFO ("PSP loading VCN firmware\n" ); +DRM_INFO ("VCN 1.0: Will use PSP to load VCN firmware\n" ); } r =amdgpu_vcn_resume (adev);
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c +1 -1
@@ -122,7 +122,7 @@ static int vcn_v2_0_sw_init(void *handle) adev->firmware.ucode[AMDGPU_UCODE_ID_VCN ].fw = adev->vcn.fw; adev->firmware.fw_size +=ALIGN (le32_to_cpu (hdr->ucode_size_bytes),PAGE_SIZE ); -DRM_INFO ("PSP loading VCN firmware\n" ); +DRM_INFO ("VCN 2.0: Will use PSP to load VCN firmware\n" ); } r =amdgpu_vcn_resume (adev);
drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c +1 -1
@@ -152,7 +152,7 @@ static int vcn_v2_5_sw_init(void *handle) adev->firmware.fw_size +=ALIGN (le32_to_cpu (hdr->ucode_size_bytes),PAGE_SIZE ); } -DRM_INFO ("PSP loading VCN firmware\n" ); +DRM_INFO ("VCN 2.5: Will use PSP to load VCN firmware\n" ); } r =amdgpu_vcn_resume (adev);
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +1 -1
@@ -158,7 +158,7 @@ static int vcn_v3_0_sw_init(void *handle) adev->firmware.fw_size +=ALIGN (le32_to_cpu (hdr->ucode_size_bytes),PAGE_SIZE ); } -DRM_INFO ("PSP loading VCN firmware\n" ); +DRM_INFO ("VCN 3.0: Will use PSP to load VCN firmware\n" ); } r =amdgpu_vcn_resume (adev);
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 2/3] drm/amdgpu: Fix a printing message
Am 14.07.21 um 17:25 schrieb Oak Zeng:
Quoted 19 lines
The printing message "PSP loading VCN firmware" is mis-leading because people might think driver is loading VCN firmware. Actually when this message is printed, driver is just preparing some VCN ucode, not loading VCN firmware yet. The actual VCN firmware loading will be in the PSP block
hw_init. Fix the printing messageSigned-off-by Oak Zeng <[email protected]>--- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +0
-0
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c static int vcn_v1_0_sw_init(void *handle) · line 122
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +1
-1@@ -119,7 +119,7 @@ static int vcn_v1_0_sw_init(void *handle) adev->firmware.ucode[AMDGPU_UCODE_ID_VCN ].fw = adev->vcn.fw; adev->firmware.fw_size +=ALIGN (le32_to_cpu (hdr->ucode_size_bytes),PAGE_SIZE ); -DRM_INFO ("PSP loading VCN firmware\n" ); +DRM_INFO ("VCN 1.0: Will use PSP to load VCN firmware\n" );
Good to have, but I'm not sure if we should have the VCN 1.0 prefix here.
Christian.
Quoted 34 lines
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +0
-0} r =amdgpu_vcn_resume (adev);drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c +1
-1@@ -122,7 +122,7 @@ static int vcn_v2_0_sw_init(void *handle) adev->firmware.ucode[AMDGPU_UCODE_ID_VCN ].fw = adev->vcn.fw; adev->firmware.fw_size +=ALIGN (le32_to_cpu (hdr->ucode_size_bytes),PAGE_SIZE ); -DRM_INFO ("PSP loading VCN firmware\n" ); +DRM_INFO ("VCN 2.0: Will use PSP to load VCN firmware\n" ); } r =amdgpu_vcn_resume (adev);drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c +1
-1@@ -152,7 +152,7 @@ static int vcn_v2_5_sw_init(void *handle) adev->firmware.fw_size +=ALIGN (le32_to_cpu (hdr->ucode_size_bytes),PAGE_SIZE ); } -DRM_INFO ("PSP loading VCN firmware\n" ); +DRM_INFO ("VCN 2.5: Will use PSP to load VCN firmware\n" ); } r =amdgpu_vcn_resume (adev);drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +0
-0
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c static int vcn_v3_0_sw_init(void *handle) · line 164
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +1
-1@@ -158,7 +158,7 @@ static int vcn_v3_0_sw_init(void *handle) adev->firmware.fw_size +=ALIGN (le32_to_cpu (hdr->ucode_size_bytes),PAGE_SIZE ); } -DRM_INFO ("PSP loading VCN firmware\n" ); +DRM_INFO ("VCN 3.0: Will use PSP to load VCN firmware\n" ); } r =amdgpu_vcn_resume (adev);
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 2/3] drm/amdgpu: Fix a printing message
In reply to Oak ZengQuoted 33 lines · Oak Zeng
The printing message "PSP loading VCN firmware" is mis-leading because people might think driver is loading VCN firmware. Actually when this message is printed, driver is just preparing some VCN ucode, not loading VCN firmware yet. The actual VCN firmware loading will be in the PSP block
hw_init. Fix the printing messageSigned-off-by Oak Zeng <[email protected]>--- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +1
-1@@ -119,7 +119,7 @@ static int vcn_v1_0_sw_init(void *handle) adev->firmware.ucode[AMDGPU_UCODE_ID_VCN ].fw = adev->vcn.fw; adev->firmware.fw_size +=ALIGN (le32_to_cpu (hdr->ucode_size_bytes),PAGE_SIZE ); -DRM_INFO ("PSP loading VCN firmware\n" ); +DRM_INFO ("VCN 1.0: Will use PSP to load VCN firmware\n" ); } r =amdgpu_vcn_resume (adev);drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c +0
-0
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c static int vcn_v2_0_sw_init(void *handle) · line 125
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c +1
-1@@ -122,7 +122,7 @@ static int vcn_v2_0_sw_init(void *handle) adev->firmware.ucode[AMDGPU_UCODE_ID_VCN ].fw = adev->vcn.fw; adev->firmware.fw_size +=ALIGN (le32_to_cpu (hdr->ucode_size_bytes),PAGE_SIZE ); -DRM_INFO ("PSP loading VCN firmware\n" ); +DRM_INFO ("VCN 2.0: Will use PSP to load VCN firmware\n" );
While you are here, switch to dev_info() so we get the device information in the output (in case we have multiple GPUs in a system).
Alex
Quoted 32 lines
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c +0
-0} r =amdgpu_vcn_resume (adev);drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c +1
-1@@ -152,7 +152,7 @@ static int vcn_v2_5_sw_init(void *handle) adev->firmware.fw_size +=ALIGN (le32_to_cpu (hdr->ucode_size_bytes),PAGE_SIZE ); } -DRM_INFO ("PSP loading VCN firmware\n" ); +DRM_INFO ("VCN 2.5: Will use PSP to load VCN firmware\n" ); } r =amdgpu_vcn_resume (adev);drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +1
-2@@ -158,7 +158,7 @@ static int vcn_v3_0_sw_init(void *handle) adev->firmware.fw_size +=ALIGN (le32_to_cpu (hdr->ucode_size_bytes),PAGE_SIZE ); } -DRM_INFO ("PSP loading VCN firmware\n" ); +DRM_INFO ("VCN 3.0: Will use PSP to load VCN firmware\n" ); } r =amdgpu_vcn_resume (adev); --2.7.4
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH 2/3] drm/amdgpu: Fix a printing message
[Public]
Hi Alex,
Is DRM_DEV_INFO more suitable than dev_info as far as DRM subsystem is concerned? Thanks!
Regards,
Jiansong
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Wednesday, July 14, 2021 11:48 PM
To: Zeng, Oak <[email protected]>
Cc: Xu, Feifei <[email protected]>; Kuehling, Felix <[email protected]>; Liu, Leo <[email protected]>; amd-gfx list <[email protected]>; Zhang, Hawking <[email protected]>
Subject: Re: [PATCH 2/3] drm/amdgpu: Fix a printing message
Quoted 36 lines · Oak Zeng
The printing message "PSP loading VCN firmware" is mis-leading because people might think driver is loading VCN firmware. Actually when this message is printed, driver is just preparing some VCN ucode, not loading VCN firmware yet. The actual VCN firmware loading will be in the PSP block
hw_init. Fix the printing messageSigned-off-by Oak Zeng <[email protected]>--- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +2
-1@@ -119,7 +119,7 @@ static int vcn_v1_0_sw_init(void *handle) adev->firmware.ucode[AMDGPU_UCODE_ID_VCN ].fw = adev->vcn.fw; adev->firmware.fw_size +=ALIGN (le32_to_cpu (hdr->ucode_size_bytes),PAGE_SIZE ); -DRM_INFO ("PSP loading VCN firmware\n" ); +DRM_INFO ("VCN 1.0: Will use PSP to load VCN + firmware\n"); } r =amdgpu_vcn_resume (adev);drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c +0
-0
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c static int vcn_v2_0_sw_init(void *handle) · line 126
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c +2
-1@@ -122,7 +122,7 @@ static int vcn_v2_0_sw_init(void *handle) adev->firmware.ucode[AMDGPU_UCODE_ID_VCN ].fw = adev->vcn.fw; adev->firmware.fw_size +=ALIGN (le32_to_cpu (hdr->ucode_size_bytes),PAGE_SIZE ); -DRM_INFO ("PSP loading VCN firmware\n" ); +DRM_INFO ("VCN 2.0: Will use PSP to load VCN + firmware\n");
While you are here, switch to dev_info() so we get the device information in the output (in case we have multiple GPUs in a system).
Alex
Quoted 36 lines
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c +0
-0} r =amdgpu_vcn_resume (adev);drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c +2
-1@@ -152,7 +152,7 @@ static int vcn_v2_5_sw_init(void *handle) adev->firmware.fw_size +=ALIGN (le32_to_cpu (hdr->ucode_size_bytes),PAGE_SIZE ); } -DRM_INFO ("PSP loading VCN firmware\n" ); +DRM_INFO ("VCN 2.5: Will use PSP to load VCN + firmware\n"); } r =amdgpu_vcn_resume (adev);drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +2
-2@@ -158,7 +158,7 @@ static int vcn_v3_0_sw_init(void *handle) adev->firmware.fw_size +=ALIGN (le32_to_cpu (hdr->ucode_size_bytes),PAGE_SIZE ); } -DRM_INFO ("PSP loading VCN firmware\n" ); +DRM_INFO ("VCN 3.0: Will use PSP to load VCN + firmware\n"); } r =amdgpu_vcn_resume (adev); --2.7.4
Quoted 10 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7CJi ansong.Chen%40amd.com%7C051da5b064d944f4c0a908d946ded869%7C3dd8961fe48 84e608e11a82d994e183d%7C0%7C0%7C637618745208108548%7CUnknown%7CTWFpbGZ sb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3 D%7C1000&sdata=WpGaXXjVSQEjcRgg0E%2FUjRMZT%2FDRe05nwG6xiDJjRbk%3D& amp;reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7CJiansong.Chen%40amd.com%7C051da5b064d944f4c0a908d946ded869%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637618745208108548%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=WpGaXXjVSQEjcRgg0E%2FUjRMZT%2FDRe05nwG6xiDJjRbk%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Deucher, Alexander
maintainerRe: [PATCH 2/3] drm/amdgpu: Fix a printing message
[Public]
I think it's more consistent to use dev_info since we already use that pretty extensively in the driver.
Alex
________________________________
From: amd-gfx <[email protected]> on behalf of Chen, Jiansong (Simon) <[email protected]>
Sent: Wednesday, July 14, 2021 10:51 PM
To: Alex Deucher <[email protected]>; Zeng, Oak <[email protected]>
Cc: Xu, Feifei <[email protected]>; Kuehling, Felix <[email protected]>; Liu, Leo <[email protected]>; amd-gfx list <[email protected]>; Zhang, Hawking <[email protected]>
Subject: RE: [PATCH 2/3] drm/amdgpu: Fix a printing message
[Public]
[Public]
Hi Alex,
Is DRM_DEV_INFO more suitable than dev_info as far as DRM subsystem is concerned? Thanks!
Regards,
Jiansong
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Wednesday, July 14, 2021 11:48 PM
To: Zeng, Oak <[email protected]>
Cc: Xu, Feifei <[email protected]>; Kuehling, Felix <[email protected]>; Liu, Leo <[email protected]>; amd-gfx list <[email protected]>; Zhang, Hawking <[email protected]>
Subject: Re: [PATCH 2/3] drm/amdgpu: Fix a printing message
Quoted 36 lines · Oak Zeng
The printing message "PSP loading VCN firmware" is mis-leading because people might think driver is loading VCN firmware. Actually when this message is printed, driver is just preparing some VCN ucode, not loading VCN firmware yet. The actual VCN firmware loading will be in the PSP block
hw_init. Fix the printing messageSigned-off-by Oak Zeng <[email protected]>--- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +2
-1@@ -119,7 +119,7 @@ static int vcn_v1_0_sw_init(void *handle) adev->firmware.ucode[AMDGPU_UCODE_ID_VCN ].fw = adev->vcn.fw; adev->firmware.fw_size +=ALIGN (le32_to_cpu (hdr->ucode_size_bytes),PAGE_SIZE ); -DRM_INFO ("PSP loading VCN firmware\n" ); +DRM_INFO ("VCN 1.0: Will use PSP to load VCN + firmware\n"); } r =amdgpu_vcn_resume (adev);drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c +0
-0
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c static int vcn_v2_0_sw_init(void *handle) · line 126
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c +2
-1@@ -122,7 +122,7 @@ static int vcn_v2_0_sw_init(void *handle) adev->firmware.ucode[AMDGPU_UCODE_ID_VCN ].fw = adev->vcn.fw; adev->firmware.fw_size +=ALIGN (le32_to_cpu (hdr->ucode_size_bytes),PAGE_SIZE ); -DRM_INFO ("PSP loading VCN firmware\n" ); +DRM_INFO ("VCN 2.0: Will use PSP to load VCN + firmware\n");
While you are here, switch to dev_info() so we get the device information in the output (in case we have multiple GPUs in a system).
Alex
Quoted 36 lines
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c +0
-0} r =amdgpu_vcn_resume (adev);drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c +2
-1@@ -152,7 +152,7 @@ static int vcn_v2_5_sw_init(void *handle) adev->firmware.fw_size +=ALIGN (le32_to_cpu (hdr->ucode_size_bytes),PAGE_SIZE ); } -DRM_INFO ("PSP loading VCN firmware\n" ); +DRM_INFO ("VCN 2.5: Will use PSP to load VCN + firmware\n"); } r =amdgpu_vcn_resume (adev);drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +2
-2@@ -158,7 +158,7 @@ static int vcn_v3_0_sw_init(void *handle) adev->firmware.fw_size +=ALIGN (le32_to_cpu (hdr->ucode_size_bytes),PAGE_SIZE ); } -DRM_INFO ("PSP loading VCN firmware\n" ); +DRM_INFO ("VCN 3.0: Will use PSP to load VCN + firmware\n"); } r =amdgpu_vcn_resume (adev); --2.7.4
Quoted 10 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7CJi ansong.Chen%40amd.com%7C051da5b064d944f4c0a908d946ded869%7C3dd8961fe48 84e608e11a82d994e183d%7C0%7C0%7C637618745208108548%7CUnknown%7CTWFpbGZ sb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3 D%7C1000&sdata=WpGaXXjVSQEjcRgg0E%2FUjRMZT%2FDRe05nwG6xiDJjRbk%3D& amp;reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Calexander.deucher%40amd.com%7Ce7e186e3c28f4131fdc008d9473b8643%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637619143252510438%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=1rIdDQqiz9t9NVditEbTRR6qeqvucqhCvnsg7obVA9c%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Calexander.deucher%40amd.com%7Ce7e186e3c28f4131fdc008d9473b8643%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637619143252520390%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=ZhcsiGqrIcLHktlp0RBx1qwFJp6RI0nP%2BFFUxddKlRo%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH 2/3] drm/amdgpu: Fix a printing message
[Public]
Ok, I see. Thanks!
Regards,
Jiansong
From: Deucher, Alexander <[email protected]>
Sent: Thursday, July 15, 2021 10:55 AM
To: Chen, Jiansong (Simon) <[email protected]>; Alex Deucher <[email protected]>; Zeng, Oak <[email protected]>
Cc: Xu, Feifei <[email protected]>; Kuehling, Felix <[email protected]>; Liu, Leo <[email protected]>; amd-gfx list <[email protected]>; Zhang, Hawking <[email protected]>
Subject: Re: [PATCH 2/3] drm/amdgpu: Fix a printing message
[Public]
I think it's more consistent to use dev_info since we already use that pretty extensively in the driver.
Alex
________________________________
From: amd-gfx <[email protected]<mailto:[email protected]>> on behalf of Chen, Jiansong (Simon) <[email protected]<mailto:[email protected]>>
Sent: Wednesday, July 14, 2021 10:51 PM
To: Alex Deucher <[email protected]<mailto:[email protected]>>; Zeng, Oak <[email protected]<mailto:[email protected]>>
Cc: Xu, Feifei <[email protected]<mailto:[email protected]>>; Kuehling, Felix <[email protected]<mailto:[email protected]>>; Liu, Leo <[email protected]<mailto:[email protected]>>; amd-gfx list <[email protected]<mailto:[email protected]>>; Zhang, Hawking <[email protected]<mailto:[email protected]>>
Subject: RE: [PATCH 2/3] drm/amdgpu: Fix a printing message
[Public]
[Public]
Hi Alex,
Is DRM_DEV_INFO more suitable than dev_info as far as DRM subsystem is concerned? Thanks!
Regards,
Jiansong
-----Original Message-----
From: amd-gfx <[email protected]<mailto:[email protected]>> On Behalf Of Alex Deucher
Sent: Wednesday, July 14, 2021 11:48 PM
To: Zeng, Oak <[email protected]<mailto:[email protected]>>
Cc: Xu, Feifei <[email protected]<mailto:[email protected]>>; Kuehling, Felix <[email protected]<mailto:[email protected]>>; Liu, Leo <[email protected]<mailto:[email protected]>>; amd-gfx list <[email protected]<mailto:[email protected]>>; Zhang, Hawking <[email protected]<mailto:[email protected]>>
Subject: Re: [PATCH 2/3] drm/amdgpu: Fix a printing message
Quoted 36 lines · On Wed, Jul 14, 2021 at 11:25 AM Oak Zeng…
The printing message "PSP loading VCN firmware" is mis-leading because people might think driver is loading VCN firmware. Actually when this message is printed, driver is just preparing some VCN ucode, not loading VCN firmware yet. The actual VCN firmware loading will be in the PSP block
hw_init. Fix the printing messageSigned-off-by Oak Zeng <[email protected]<mailto:[email protected]>>--- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +2
-1@@ -119,7 +119,7 @@ static int vcn_v1_0_sw_init(void *handle) adev->firmware.ucode[AMDGPU_UCODE_ID_VCN ].fw = adev->vcn.fw; adev->firmware.fw_size +=ALIGN (le32_to_cpu (hdr->ucode_size_bytes),PAGE_SIZE ); -DRM_INFO ("PSP loading VCN firmware\n" ); +DRM_INFO ("VCN 1.0: Will use PSP to load VCN + firmware\n"); } r =amdgpu_vcn_resume (adev);drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c +0
-0
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c static int vcn_v2_0_sw_init(void *handle) · line 126
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c +2
-1@@ -122,7 +122,7 @@ static int vcn_v2_0_sw_init(void *handle) adev->firmware.ucode[AMDGPU_UCODE_ID_VCN ].fw = adev->vcn.fw; adev->firmware.fw_size +=ALIGN (le32_to_cpu (hdr->ucode_size_bytes),PAGE_SIZE ); -DRM_INFO ("PSP loading VCN firmware\n" ); +DRM_INFO ("VCN 2.0: Will use PSP to load VCN + firmware\n");
While you are here, switch to dev_info() so we get the device information in the output (in case we have multiple GPUs in a system).
Alex
Quoted 36 lines
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c +0
-0} r =amdgpu_vcn_resume (adev);drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c +2
-1@@ -152,7 +152,7 @@ static int vcn_v2_5_sw_init(void *handle) adev->firmware.fw_size +=ALIGN (le32_to_cpu (hdr->ucode_size_bytes),PAGE_SIZE ); } -DRM_INFO ("PSP loading VCN firmware\n" ); +DRM_INFO ("VCN 2.5: Will use PSP to load VCN + firmware\n"); } r =amdgpu_vcn_resume (adev);drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +2
-2@@ -158,7 +158,7 @@ static int vcn_v3_0_sw_init(void *handle) adev->firmware.fw_size +=ALIGN (le32_to_cpu (hdr->ucode_size_bytes),PAGE_SIZE ); } -DRM_INFO ("PSP loading VCN firmware\n" ); +DRM_INFO ("VCN 3.0: Will use PSP to load VCN + firmware\n"); } r =amdgpu_vcn_resume (adev); --2.7.4
Quoted 10 lines
_______________________________________________
amd-gfx mailing list [email protected]<mailto:[email protected]>
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7CJi ansong.Chen%40amd.com%7C051da5b064d944f4c0a908d946ded869%7C3dd8961fe48 84e608e11a82d994e183d%7C0%7C0%7C637618745208108548%7CUnknown%7CTWFpbGZ sb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3 D%7C1000&sdata=WpGaXXjVSQEjcRgg0E%2FUjRMZT%2FDRe05nwG6xiDJjRbk%3D& amp;reserved=0
_______________________________________________
amd-gfx mailing list [email protected]<mailto:[email protected]>
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Calexander.deucher%40amd.com%7Ce7e186e3c28f4131fdc008d9473b8643%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637619143252510438%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=1rIdDQqiz9t9NVditEbTRR6qeqvucqhCvnsg7obVA9c%3D&reserved=0
_______________________________________________
amd-gfx mailing list [email protected]<mailto:[email protected]>
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Calexander.deucher%40amd.com%7Ce7e186e3c28f4131fdc008d9473b8643%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637619143252520390%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=ZhcsiGqrIcLHktlp0RBx1qwFJp6RI0nP%2BFFUxddKlRo%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/3 drm/amdgpu: Change a few function names
In reply to Oak ZengFunction name "psp_np_fw_load" is not proper as people don't know _np_fw_ means "non psp firmware". Change the function name to psp_load_non_psp_fw for better understanding. Same thing for function psp_execute_np_fw_load.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +8 -8
@@ -2351,7 +2351,7 @@ static int psp_prep_load_ip_fw_cmd_buf(struct amdgpu_firmware_info *ucode,return ret; } -static int psp_execute_np_fw_load (struct psp_context *psp, +static int psp_execute_non_psp_fw_load (struct psp_context *psp,struct amdgpu_firmware_info *ucode) {int ret =0 ;
@@ -2387,7 +2387,7 @@ static int psp_load_smu_fw(struct psp_context *psp) } } - ret =psp_execute_np_fw_load (psp, ucode); + ret =psp_execute_non_psp_fw_load (psp, ucode);if (ret)DRM_ERROR ("PSP load smu failed!\n" );
@@ -2442,14 +2442,14 @@ int psp_load_fw_list(struct psp_context *psp,for (i =0 ; i < ucode_count; ++i) { ucode = ucode_list[i];psp_print_fw_hdr (psp, ucode); - ret =psp_execute_np_fw_load (psp, ucode); + ret =psp_execute_non_psp_fw_load (psp, ucode);if (ret)return ret; }return ret; } -static int psp_np_fw_load (struct psp_context *psp) +static int psp_load_non_psp_fw (struct psp_context *psp) {int i, ret;struct amdgpu_firmware_info *ucode;
@@ -2488,7 +2488,7 @@ static int psp_np_fw_load(struct psp_context *psp)psp_print_fw_hdr (psp, ucode); - ret =psp_execute_np_fw_load (psp, ucode); + ret =psp_execute_non_psp_fw_load (psp, ucode);if (ret)return ret;
@@ -2565,7 +2565,7 @@ static int psp_load_fw(struct amdgpu_device *adev)if (ret) goto failed; - ret =psp_np_fw_load (psp); + ret =psp_load_non_psp_fw (psp);if (ret) goto failed;
@@ -2765,7 +2765,7 @@ static int psp_resume(void *handle)if (ret) goto failed; - ret =psp_np_fw_load (psp); + ret =psp_load_non_psp_fw (psp);if (ret) goto failed;
@@ -2863,7 +2863,7 @@ int psp_update_vcn_sram(struct amdgpu_device *adev, int inst_idx, ucode.mc_addr = cmd_gpu_addr; ucode.ucode_size = cmd_size; -return psp_execute_np_fw_load (&adev->psp, &ucode); +return psp_execute_non_psp_fw_load (&adev->psp, &ucode); } int psp_ring_cmd_submit(struct psp_context *psp,
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 3/3] drm/amdgpu: Change a few function names
Quoted 7 lines · Oak Zeng
Function name "
psp_np_fw_load" is not proper as people don't know _np_fw_ means "non psp firmware". Change the function name topsp_load_non_psp_fwfor better understanding. Same thing for functionpsp_execute_np_fw_load.Signed-off-by Oak Zeng <[email protected]>
Quoted 82 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +8
-9@@ -2351,7 +2351,7 @@ static int psp_prep_load_ip_fw_cmd_buf(struct amdgpu_firmware_info *ucode,return ret; } -static int psp_execute_np_fw_load (struct psp_context *psp, +static int psp_execute_non_psp_fw_load (struct psp_context *psp,struct amdgpu_firmware_info *ucode) {int ret =0 ;@@ -2387,7 +2387,7 @@ static int psp_load_smu_fw(struct psp_context *psp) } } - ret =psp_execute_np_fw_load (psp, ucode); + ret =psp_execute_non_psp_fw_load (psp, ucode);if (ret)DRM_ERROR ("PSP load smu failed!\n" );@@ -2442,14 +2442,14 @@ int psp_load_fw_list(struct psp_context *psp,for (i =0 ; i < ucode_count; ++i) { ucode = ucode_list[i];psp_print_fw_hdr (psp, ucode); - ret =psp_execute_np_fw_load (psp, ucode); + ret =psp_execute_non_psp_fw_load (psp, ucode);if (ret)return ret; }return ret; } -static int psp_np_fw_load (struct psp_context *psp) +static int psp_load_non_psp_fw (struct psp_context *psp) {int i, ret;struct amdgpu_firmware_info *ucode;@@ -2488,7 +2488,7 @@ static int psp_np_fw_load(struct psp_context *psp)psp_print_fw_hdr (psp, ucode); - ret =psp_execute_np_fw_load (psp, ucode); + ret =psp_execute_non_psp_fw_load (psp, ucode);if (ret)return ret;@@ -2565,7 +2565,7 @@ static int psp_load_fw(struct amdgpu_device *adev)if (ret) goto failed; - ret =psp_np_fw_load (psp); + ret =psp_load_non_psp_fw (psp);if (ret) goto failed;@@ -2765,7 +2765,7 @@ static int psp_resume(void *handle)if (ret) goto failed; - ret =psp_np_fw_load (psp); + ret =psp_load_non_psp_fw (psp);if (ret) goto failed;@@ -2863,7 +2863,7 @@ int psp_update_vcn_sram(struct amdgpu_device *adev, int inst_idx, ucode.mc_addr = cmd_gpu_addr; ucode.ucode_size = cmd_size; -return psp_execute_np_fw_load (&adev->psp, &ucode); +return psp_execute_non_psp_fw_load (&adev->psp, &ucode); } int psp_ring_cmd_submit(struct psp_context *psp, --2.7.4
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx