On 5/10/2024 8:20 AM, Jesse Zhang wrote: > Check for specific indexes that may be invalid values. > > Signed-off-by: Jesse Zhang <jesse.zh...@amd.com> > --- > drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c > b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c > index 051092f1b1b4..7c343dd12a7f 100644 > --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c > +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c > @@ -2336,6 +2336,8 @@ static int smu_v13_0_6_mode2_reset(struct smu_context > *smu) > > index = smu_cmn_to_asic_specific_index(smu, CMN2ASIC_MAPPING_MSG, > SMU_MSG_GfxDeviceDriverReset); > + if (index < 0) > + ret = -EINVAL; > This check is unnecessary. This is IP specific logic and the index is expected to exist. See this entry in smu_v13_0_6_message_map MSG_MAP(GfxDeviceDriverReset, PPSMC_MSG_GfxDriverReset, SMU_MSG_RAS_PRI), Thanks, Lijo > mutex_lock(&smu->message_lock); >
- RE: [PATCH 05/22] drm/amd/pm: check specific index ... Wang, Yang(Kevin)
- RE: [PATCH 05/22] drm/amd/pm: check specific index ... Huang, Tim
- [PATCH 06/22] drm/amd/pm: check the return of send smc m... Jesse Zhang
- [PATCH 07/22] drm/amd/pm: check the return of send smc m... Jesse Zhang
- [PATCH 09/22] drm/amd/pm: check specific index for smu13 Jesse Zhang
- RE: [PATCH 09/22] drm/amd/pm: check specific index ... Wang, Yang(Kevin)
- RE: [PATCH 09/22] drm/amd/pm: check specific index ... Huang, Tim
- RE: [PATCH 09/22] drm/amd/pm: check specific in... Zhang, Jesse(Jie)
- Re: [PATCH 09/22] drm/amd/pm: check specific index ... Lazar, Lijo
- [PATCH 08/22] drm/amd/pm: check the return of send smc m... Jesse Zhang
- [PATCH 10/22] drm/amdgpu: remove structurally dead code Jesse Zhang
- [PATCH 13/22] drm/amd/pm: remove logically dead code for... Jesse Zhang
- RE: [PATCH 13/22] drm/amd/pm: remove logically dead... Wang, Yang(Kevin)
- [PATCH 11/22] drm/amdgpu: remove structurally dead code ... Jesse Zhang
- [PATCH 14/22] drm/amdgu: remove unused code Jesse Zhang