> -----Original Message----- > From: amd-gfx [mailto:amd-gfx-bounces at lists.freedesktop.org] On Behalf > Of Chunming Zhou > Sent: Tuesday, June 21, 2016 4:12 AM > To: amd-gfx at lists.freedesktop.org > Cc: Zhou, David(ChunMing) > Subject: [PATCH 2/2] drm/amdgpu: stop/resume fb access when gpu reset > > Change-Id: I86b5c2b8c78a17ef43ade2a97ef8a33853650be0 > Signed-off-by: Chunming Zhou <David1.Zhou at amd.com> > --- > drivers/gpu/drm/amd/amdgpu/cik.c | 9 +++++++++ > drivers/gpu/drm/amd/amdgpu/vi.c | 8 +++++++- > 2 files changed, 16 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c > b/drivers/gpu/drm/amd/amdgpu/cik.c > index 40f4fda..716efa8 100644 > --- a/drivers/gpu/drm/amd/amdgpu/cik.c > +++ b/drivers/gpu/drm/amd/amdgpu/cik.c > @@ -1213,10 +1213,19 @@ static void > cik_set_bios_scratch_engine_hung(struct amdgpu_device *adev, bool hu > static int cik_asic_reset(struct amdgpu_device *adev) > { > int r; > + struct amdgpu_mode_mc_save save; > + > cik_set_bios_scratch_engine_hung(adev, true); > + /* Disable fb access */ > + if (adev->mode_info.num_crtc) > + amdgpu_display_stop_mc_access(adev, &save); You don't need to check if there are crtcs or not before stopping the mc. The stop_mc_access and resume_mc_access callbacks will handle that automatically. Also on chips with no DCE hardware, you still want to stop the mc. Same for vi.c. Alex > > r = cik_gpu_pci_config_reset(adev); > > + /* resume fb access */ > + if (adev->mode_info.num_crtc) > + amdgpu_display_resume_mc_access(adev, &save); > + > cik_set_bios_scratch_engine_hung(adev, false); > > return r; > diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c > b/drivers/gpu/drm/amd/amdgpu/vi.c > index 1ac0c91..497b817 100644 > --- a/drivers/gpu/drm/amd/amdgpu/vi.c > +++ b/drivers/gpu/drm/amd/amdgpu/vi.c > @@ -633,10 +633,16 @@ static void vi_set_bios_scratch_engine_hung(struct > amdgpu_device *adev, bool hun > static int vi_asic_reset(struct amdgpu_device *adev) > { > int r; > + struct amdgpu_mode_mc_save save; > > vi_set_bios_scratch_engine_hung(adev, true); > - > + /* Disable fb access */ > + if (adev->mode_info.num_crtc) > + amdgpu_display_stop_mc_access(adev, &save); > r = vi_gpu_pci_config_reset(adev); > + /* resume fb access */ > + if (adev->mode_info.num_crtc) > + amdgpu_display_resume_mc_access(adev, &save); > > vi_set_bios_scratch_engine_hung(adev, false); > > -- > 1.9.1 > > _______________________________________________ > amd-gfx mailing list > amd-gfx at lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx