Re: [PATCH] drm/amdkfd: return negative error code in svm_ioctl()

2024-03-26 Thread Su Hui
On 2024/3/25 22:09, Philip Yang wrote: On 2024-03-25 02:31, Su Hui wrote: Good catch, ioctl should return -errno. I will apply it to drm-next. Reviewed-by: Philip Yang --- Ps: When I try to compile this file, there is a error : drivers/gpu/drm/amd/amdkfd/kfd_migrate.c:28:10: fatal error

[PATCH] drm/amdkfd: return negative error code in svm_ioctl()

2024-03-25 Thread Su Hui
svm_ioctl() should return negative error code in default case. Fixes: 42de677f7999 ("drm/amdkfd: register svm range") Signed-off-by: Su Hui --- Ps: When I try to compile this file, there is a error : drivers/gpu/drm/amd/amdkfd/kfd_migrate.c:28:10: fatal error: amdgpu_sync.h: No

[PATCH] drm/radeon/ni_dpm: add an error code check in ni_dpm_init

2023-11-01 Thread Su Hui
ni_patch_single_dependency_table_based_on_leakage() return zero or negative error code. But ni_patch_dependency_tables_based_on_leakage() doesn't check the return value of the first function call. It's same for ni_dpm_init(). It's better to add this error code check. Signed-off-by: Su Hui

Re: [PATCH v2] drm/amdgpu: Avoid possible buffer overflow

2023-08-22 Thread Su Hui
On 2023/8/21 17:31, Christian König wrote: Am 21.08.23 um 09:37 schrieb Su Hui: smatch error: drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:1257 amdgpu_discovery_reg_base_init() error: testing array offset 'adev->vcn.num_vcn_inst' after use. change the assignment order to avoid buf

[PATCH v2] drm/amdgpu: Avoid possible buffer overflow

2023-08-21 Thread Su Hui
quot;) Signed-off-by: Su Hui --- changes in v2: - fix the error about ip->revision (thanks to Christophe JAILLET). drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gp

Re: [PATCH] drm/amdgpu: Avoid possible buffer overflow

2023-08-21 Thread Su Hui
On 2023/8/21 14:47, Christophe JAILLET wrote: Le 21/08/2023 à 08:19, Su Hui a écrit : smatch error: drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:1257 amdgpu_discovery_reg_base_init() error: testing array offset 'adev->vcn.num_vcn_inst' after use. change the assignment order to avoid buf

[PATCH] drm/amdgpu: Avoid possible buffer overflow

2023-08-21 Thread Su Hui
quot;) Signed-off-by: Su Hui --- drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c index 8e1cfc87122d..ba95526c3d45 100644 --- a/driver

[PATCH] drm/amd/amdgpu: Use “__packed“ instead of "pragma pack()"

2023-06-21 Thread Su Hui
use "__packed" is clearer amd better than “pragma pack()”. Signed-off-by: Su Hui --- As Dan Carpenter mentioned: '"Mark the associated types properly packed individually, rather than use the disgusting "pragma pack()" that should never be used." https://lore.kernel

Re: [PATCH] drm/amd/amdgpu: Use “__packed“ instead of "pragma pack()"

2023-06-21 Thread Su Hui
r pointers. That's how we used to do it prior to 2003. But these days it feels strange and dangerous to see these sorts of warnings. Got it. And it is really strange when I first saw these warnings. Thanks for your explanation! Su Hui Smatch also disabled some uninitialized variable checks. These

[PATCH] drm/amd/amdgpu: Properly tune the size of struct

2023-06-20 Thread Su Hui
Smatch error: gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" Fixes: 1721bc1b2afa ("drm/amdgpu: Update VF2PF interfac

Re: [PATCH] drm: Remove unnecessary (void*) conversions

2023-05-30 Thread Su Hui
On 2023/5/26 15:27, Christian König wrote: Am 26.05.23 um 05:32 schrieb Su Hui: Pointer variables of (void*) type do not require type cast. Please split that up by subsystem/driver. Taking it through the misc tree might just cause merge conflicts. Sorry for that, I will split it and send

[PATCH] drm: Remove unnecessary (void*) conversions

2023-05-26 Thread Su Hui
Pointer variables of (void*) type do not require type cast. Signed-off-by: Su Hui --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 2 +- drivers/gpu/drm/amd/pm/amdgpu_pm.c| 2 +- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 4 ++-- drivers

[PATCH] drm/radeon: Remove unnecessary (void*) conversions

2023-05-17 Thread Su Hui
No need cast (void*) to (struct radeon_device *) or (struct radeon_ring *). Signed-off-by: Su Hui --- drivers/gpu/drm/radeon/r100.c | 8 drivers/gpu/drm/radeon/r300.c | 2 +- drivers/gpu/drm/radeon/r420.c | 2 +- drivers/gpu/drm/radeon/r600.c | 2

[PATCH] drm/amdgpu: remove unnecessary (void*) conversions

2023-05-15 Thread Su Hui
No need cast (void*) to (struct amdgpu_device *). Signed-off-by: Su Hui --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 2 +- drivers