Am 09.03.2017 um 18:04 schrieb Alex Deucher: > From: Rex Zhu <Rex.Zhu at amd.com> > > v2: agd: integrate Christian's comments. > v3: print error message if call fails > > Signed-off-by: Rex Zhu <Rex.Zhu at amd.com> > Signed-off-by: Alex Deucher <alexander.deucher at amd.com> Reviewed-by: Christian König <christian.koenig at amd.com> > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 32 +++++++++++++++++------------- > 1 file changed, 18 insertions(+), 14 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > index b64c2db..3c24bec 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > @@ -1192,13 +1192,15 @@ int amdgpu_set_clockgating_state(struct amdgpu_device *adev, > for (i = 0; i < adev->num_ip_blocks; i++) { > if (!adev->ip_blocks[i].status.valid) > continue; > - if (adev->ip_blocks[i].version->type == block_type) { > - r = adev->ip_blocks[i].version->funcs->set_clockgating_state((void *)adev, > - state); > - if (r) > - return r; > - break; > - } > + if (adev->ip_blocks[i].version->type != block_type) > + continue; > + if (!adev->ip_blocks[i].version->funcs->set_clockgating_state) > + continue; > + r = adev->ip_blocks[i].version->funcs->set_clockgating_state( > + (void *)adev, state); > + if (r) > + DRM_ERROR("set_clockgating_state of IP block <%s> failed %d\n", > + adev->ip_blocks[i].version->funcs->name, r); > } > return r; > } > @@ -1212,13 +1214,15 @@ int amdgpu_set_powergating_state(struct amdgpu_device *adev, > for (i = 0; i < adev->num_ip_blocks; i++) { > if (!adev->ip_blocks[i].status.valid) > continue; > - if (adev->ip_blocks[i].version->type == block_type) { > - r = adev->ip_blocks[i].version->funcs->set_powergating_state((void *)adev, > - state); > - if (r) > - return r; > - break; > - } > + if (adev->ip_blocks[i].version->type != block_type) > + continue; > + if (!adev->ip_blocks[i].version->funcs->set_powergating_state) > + continue; > + r = adev->ip_blocks[i].version->funcs->set_powergating_state( > + (void *)adev, state); > + if (r) > + DRM_ERROR("set_powergating_state of IP block <%s> failed %d\n", > + adev->ip_blocks[i].version->funcs->name, r); > } > return r; > }