[AMD Official Use Only - AMD Internal Distribution Only] Reviewed-by: Tao Zhou <tao.zhou1@xxxxxxx> > -----Original Message----- > From: Wang, Yang(Kevin) <KevinYang.Wang@xxxxxxx> > Sent: Monday, December 9, 2024 5:01 PM > To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx > Cc: Zhang, Hawking <Hawking.Zhang@xxxxxxx>; Zhou1, Tao > <Tao.Zhou1@xxxxxxx> > Subject: [PATCH] drm/amdgpu: improve RAS ACA to avoid binding unsupported > RAS blocks > > Improve RAS ACA code to avoid binding unsupported RAS blocks, thus avoiding > invalid ACA Bank to ACA Bank cache, and also reduce system memory > consumption. > > Signed-off-by: Yang Wang <kevinyang.wang@xxxxxxx> > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c > index db081618e85c..54426e04c7bf 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c > @@ -1302,6 +1302,9 @@ int amdgpu_ras_bind_aca(struct amdgpu_device *adev, > enum amdgpu_ras_block blk, > if (adev->in_suspend || amdgpu_reset_in_recovery(adev)) > return 0; > > + if (!amdgpu_ras_is_supported(adev, blk)) > + return 0; > + > obj = get_ras_manager(adev, blk); > if (!obj) > return -EINVAL; > @@ -1313,6 +1316,9 @@ int amdgpu_ras_unbind_aca(struct amdgpu_device > *adev, enum amdgpu_ras_block blk) { > struct ras_manager *obj; > > + if (!amdgpu_ras_is_supported(adev, blk)) > + return 0; > + > obj = get_ras_manager(adev, blk); > if (!obj) > return -EINVAL; > -- > 2.34.1