* [PATCH][next] drm/amd/amdgpu: Fix a less than zero check on a uint32_t struct field
@ 2025-09-03 8:20 Colin Ian King
2025-09-03 8:55 ` Dan Carpenter
0 siblings, 1 reply; 3+ messages in thread
From: Colin Ian King @ 2025-09-03 8:20 UTC (permalink / raw)
To: Alex Deucher, Christian König, David Airlie, Simona Vetter,
amd-gfx, dri-devel
Cc: kernel-janitors, linux-kernel
Currently the error check from the call to mes_v12_inv_tlb_convert_hub_id
is always false because a uint32_t struct field hub_id is being used to
to perform the less than zero error check. Fix this by using the int
variable ret to perform the check.
Fixes: 87e65052616c ("drm/amd/amdgpu : Use the MES INV_TLBS API for tlb invalidation on gfx12")
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
drivers/gpu/drm/amd/amdgpu/mes_v12_0.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c b/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c
index cd5c966cee95..ff5df28b57ec 100644
--- a/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c
@@ -899,6 +899,7 @@ static int mes_v12_0_inv_tlbs_pasid(struct amdgpu_mes *mes,
struct mes_inv_tlbs_pasid_input *input)
{
union MESAPI__INV_TLBS mes_inv_tlbs;
+ int ret;
memset(&mes_inv_tlbs, 0, sizeof(mes_inv_tlbs));
@@ -911,9 +912,10 @@ static int mes_v12_0_inv_tlbs_pasid(struct amdgpu_mes *mes,
mes_inv_tlbs.invalidate_tlbs.inv_sel_id = input->pasid;
/*convert amdgpu_mes_hub_id to mes expected hub_id */
- mes_inv_tlbs.invalidate_tlbs.hub_id = mes_v12_inv_tlb_convert_hub_id(input->hub_id);
- if (mes_inv_tlbs.invalidate_tlbs.hub_id < 0)
+ ret = mes_v12_inv_tlb_convert_hub_id(input->hub_id);
+ if (ret < 0)
return -EINVAL;
+ mes_inv_tlbs.invalidate_tlbs.hub_id = ret;
return mes_v12_0_submit_pkt_and_poll_completion(mes, AMDGPU_MES_KIQ_PIPE,
&mes_inv_tlbs, sizeof(mes_inv_tlbs),
offsetof(union MESAPI__INV_TLBS, api_status));
--
2.51.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH][next] drm/amd/amdgpu: Fix a less than zero check on a uint32_t struct field
2025-09-03 8:20 [PATCH][next] drm/amd/amdgpu: Fix a less than zero check on a uint32_t struct field Colin Ian King
@ 2025-09-03 8:55 ` Dan Carpenter
2025-09-03 14:28 ` Alex Deucher
0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2025-09-03 8:55 UTC (permalink / raw)
To: Colin Ian King, Shaoyun Liu
Cc: Alex Deucher, Christian König, David Airlie, Simona Vetter,
amd-gfx, dri-devel, kernel-janitors, linux-kernel
Are you editing your CC list? The get_maintainer.pl script gives me a
longer list. The most important thing is that you've left off Shaoyun Liu
from the Fixes tag. Added.
The kbuild-bot did report this bug on Friday so the AMD folks likely have
a patch kicking around on their end, but just haven't sent it out
publicly yet?
https://lore.kernel.org/all/202508290749.ti6u3cLL-lkp@intel.com/
Anyway, the patch is fine.
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
regards,
dan carpenter
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH][next] drm/amd/amdgpu: Fix a less than zero check on a uint32_t struct field
2025-09-03 8:55 ` Dan Carpenter
@ 2025-09-03 14:28 ` Alex Deucher
0 siblings, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2025-09-03 14:28 UTC (permalink / raw)
To: Dan Carpenter
Cc: Colin Ian King, Shaoyun Liu, Alex Deucher, Christian König,
David Airlie, Simona Vetter, amd-gfx, dri-devel, kernel-janitors,
linux-kernel
Applied. Thanks!
Alex
On Wed, Sep 3, 2025 at 7:24 AM Dan Carpenter <dan.carpenter@linaro.org> wrote:
>
> Are you editing your CC list? The get_maintainer.pl script gives me a
> longer list. The most important thing is that you've left off Shaoyun Liu
> from the Fixes tag. Added.
>
> The kbuild-bot did report this bug on Friday so the AMD folks likely have
> a patch kicking around on their end, but just haven't sent it out
> publicly yet?
> https://lore.kernel.org/all/202508290749.ti6u3cLL-lkp@intel.com/
>
> Anyway, the patch is fine.
>
> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
>
> regards,
> dan carpenter
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-09-03 14:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-03 8:20 [PATCH][next] drm/amd/amdgpu: Fix a less than zero check on a uint32_t struct field Colin Ian King
2025-09-03 8:55 ` Dan Carpenter
2025-09-03 14:28 ` Alex Deucher
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).