On Wed, Feb 2, 2022 at 4:07 AM Rajib Mahapatra <rajib.mahapatra@xxxxxxx> wrote: > > [Why] > amdgpu error observed if suspend is aborted during S0i3 > resume. > > [How] > If suspend is aborted for some reason during S0i3 resume > cycle, it follows amdgpu errors in resume. > Skipping SDMA ip in suspend solves the issue on RENOIR > (green sardine apu) chip. This time, the system is > able to resume gracefully even the suspend is aborted. > > Signed-off-by: Rajib Mahapatra <rajib.mahapatra@xxxxxxx> > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > index 7931132ce6e3..f01b1dffff7f 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > @@ -2927,6 +2927,16 @@ static int amdgpu_device_ip_suspend_phase2(struct amdgpu_device *adev) > adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GFX)) > continue; > > + /* skip suspend of sdma for S0ix > + * Resume has issues if the suspend is aborted during S0i3 cycle. > + * Skipping sdma for RN/CZN/BRC chip - green sardine apu. > + */ > + if (adev->in_s0ix && > + (adev->asic_type == CHIP_RENOIR && > + (adev->pdev->device == 0x15e7 || adev->pdev->device == 0x1638) && The check here seems to contradict the comment above. Is this all Renoir based APUs or just green sardine? If it's just green sardine, you can check the APU flags rather than the PCI ids. E.g., (adev->apu_flags & AMD_APU_IS_GREEN_SARDINE) Also move this to sdma 4 code as Mario suggested. Alex > + adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_SDMA)) > + continue; > + > /* XXX handle errors */ > r = adev->ip_blocks[i].version->funcs->suspend(adev); > /* XXX handle errors */ > -- > 2.25.1 >