[PATCH 3/3] drm/amdgpu: fix to clear ASIC INIT COMPLETE bit on resuming phase

Huang Rui ray.huang at amd.com
Tue Apr 11 03:41:20 UTC 2017


On Mon, Apr 10, 2017 at 08:09:17PM +0800, Grazvydas Ignotas wrote:
> On Mon, Apr 10, 2017 at 12:37 PM, Huang Rui <ray.huang at amd.com> wrote:
> 
>     ASIC_INIT_COMPLETE bit must be cleared during S3 resuming phase,
>     because VBIOS will check the bit to decide if execute ASIC_Init
>     posting via kernel driver.
> 
>     Signed-off-by: Huang Rui <ray.huang at amd.com>
>     ---
>      drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c     | 5 ++++-
>      drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 6 +++++-
>      2 files changed, 9 insertions(+), 2 deletions(-)
> 
>     diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c b/drivers/gpu/drm
>     /amd/amdgpu/amdgpu_atombios.c
>     index ad43299..b0dd72a8 100644
>     --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
>     +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
>     @@ -1727,8 +1727,11 @@ void amdgpu_atombios_scratch_regs_restore(struct
>     amdgpu_device *adev)
>      {
>             int i;
> 
>     -       for (i = 0; i < AMDGPU_BIOS_NUM_SCRATCH; i++)
>     +       for (i = 0; i < AMDGPU_BIOS_NUM_SCRATCH; i++) {
>     +               if (i == 7)
>     +                       adev->bios_scratch[i] &=
>     ~ATOM_S7_ASIC_INIT_COMPLETE_MASK;
> 
> 
> Maybe move this line before the loop?
> A comment may also be useful so that somebody doesn't delete the code again in
> future.
> 

OK. I'm fine to move it before this loop.

	/*
	 * VBIOS will check ASIC_INIT_COMPLETE bit to decide if
	 * execute ASIC_Init posting via driver
	 */
	adev->bios_scratch[7] &= ~ATOM_S7_ASIC_INIT_COMPLETE_MASK;

Thanks,
Rui


More information about the amd-gfx mailing list