[PATCH 3/6] drm/amdgpu: Fix cg/pg unexpected disabled when hw init failed

Zhu, Rex Rex.Zhu at amd.com
Wed Oct 3 00:25:41 UTC 2018



> -----Original Message-----
> From: Quan, Evan
> Sent: Sunday, September 30, 2018 11:03 AM
> To: Zhu, Rex <Rex.Zhu at amd.com>; amd-gfx at lists.freedesktop.org
> Cc: Zhu, Rex <Rex.Zhu at amd.com>
> Subject: RE: [PATCH 3/6] drm/amdgpu: Fix cg/pg unexpected disabled when
> hw init failed
> 
> Comment inline
> 
> > -----Original Message-----
> > From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of Rex
> > Zhu
> > Sent: 2018年9月30日 0:15
> > To: amd-gfx at lists.freedesktop.org
> > Cc: Zhu, Rex <Rex.Zhu at amd.com>
> > Subject: [PATCH 3/6] drm/amdgpu: Fix cg/pg unexpected disabled when hw
> > init failed
> >
> > Check the ip blocks late_initialized state before enable/disable
> > cg/pg, so if hw init failed, cg/pg function will not be executed.
> >
> > Signed-off-by: Rex Zhu <Rex.Zhu at amd.com>
> > ---
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> > index 95095a8..94c92f5 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> > @@ -1656,7 +1656,7 @@ static int amdgpu_device_set_cg_state(struct
> > amdgpu_device *adev,
> >
> >  	for (j = 0; j < adev->num_ip_blocks; j++) {
> >  		i = state == AMD_CG_STATE_GATE ? j : adev-
> > >num_ip_blocks - j - 1;
> > -		if (!adev->ip_blocks[i].status.valid)
> > +		if (!adev->ip_blocks[i].status.late_initialized)
> >  			continue;
> >  		/* skip CG for VCE/UVD, it's handled specially */
> >  		if (adev->ip_blocks[i].version->type !=
> AMD_IP_BLOCK_TYPE_UVD && @@
> > -1686,7 +1686,7 @@ static int amdgpu_device_set_pg_state(struct
> > amdgpu_device *adev, enum amd_power
> >
> >  	for (j = 0; j < adev->num_ip_blocks; j++) {
> >  		i = state == AMD_PG_STATE_GATE ? j : adev-
> > >num_ip_blocks - j - 1;
> > -		if (!adev->ip_blocks[i].status.valid)
> > +		if (!adev->ip_blocks[i].status.late_initialized)
> >  			continue;
> >  		/* skip CG for VCE/UVD, it's handled specially */
> >  		if (adev->ip_blocks[i].version->type !=
> AMD_IP_BLOCK_TYPE_UVD && @@
> > -1723,7 +1723,7 @@ static int amdgpu_device_ip_late_init(struct
> > amdgpu_device *adev)
> >  	int i = 0, r;
> >
> >  	for (i = 0; i < adev->num_ip_blocks; i++) {
> > -		if (!adev->ip_blocks[i].status.valid)
> > +		if (!adev->ip_blocks[i].status.hw)
> [Quan, Evan] typo?
No, In late_init, we check the hw_init status.

Rex
> >  			continue;
> >  		if (adev->ip_blocks[i].version->funcs->late_init) {
> >  			r = adev->ip_blocks[i].version->funcs->late_init((void
> > *)adev); @@ -1732,8 +1732,8 @@ static int
> > amdgpu_device_ip_late_init(struct amdgpu_device *adev)
> >  					  adev->ip_blocks[i].version->funcs-
> > >name, r);
> >  				return r;
> >  			}
> > -			adev->ip_blocks[i].status.late_initialized = true;
> >  		}
> > +		adev->ip_blocks[i].status.late_initialized = true;
> >  	}
> >
> >  	amdgpu_device_set_cg_state(adev, AMD_CG_STATE_GATE);
> > --
> > 1.9.1
> >
> > _______________________________________________
> > amd-gfx mailing list
> > amd-gfx at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/amd-gfx


More information about the amd-gfx mailing list