mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-18 06:33:43 -04:00
drm/amdgpu: fix amdgpu_need_full_reset (v2)
IP types are not an index. Each asic may have number and type of IPs. Properly check the the type rather than using the type id as an index. v2: fix all the IPs to not use IP type as an idx as well. Reviewed-by: Chunming Zhou <david1.zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
This commit is contained in:
@@ -2075,7 +2075,8 @@ static bool amdgpu_check_soft_reset(struct amdgpu_device *adev)
|
||||
if (!adev->ip_block_status[i].valid)
|
||||
continue;
|
||||
if (adev->ip_blocks[i].funcs->check_soft_reset)
|
||||
adev->ip_blocks[i].funcs->check_soft_reset(adev);
|
||||
adev->ip_block_status[i].hang =
|
||||
adev->ip_blocks[i].funcs->check_soft_reset(adev);
|
||||
if (adev->ip_block_status[i].hang) {
|
||||
DRM_INFO("IP block:%d is hang!\n", i);
|
||||
asic_hang = true;
|
||||
@@ -2104,12 +2105,20 @@ static int amdgpu_pre_soft_reset(struct amdgpu_device *adev)
|
||||
|
||||
static bool amdgpu_need_full_reset(struct amdgpu_device *adev)
|
||||
{
|
||||
if (adev->ip_block_status[AMD_IP_BLOCK_TYPE_GMC].hang ||
|
||||
adev->ip_block_status[AMD_IP_BLOCK_TYPE_SMC].hang ||
|
||||
adev->ip_block_status[AMD_IP_BLOCK_TYPE_ACP].hang ||
|
||||
adev->ip_block_status[AMD_IP_BLOCK_TYPE_DCE].hang) {
|
||||
DRM_INFO("Some block need full reset!\n");
|
||||
return true;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < adev->num_ip_blocks; i++) {
|
||||
if (!adev->ip_block_status[i].valid)
|
||||
continue;
|
||||
if ((adev->ip_blocks[i].type == AMD_IP_BLOCK_TYPE_GMC) ||
|
||||
(adev->ip_blocks[i].type == AMD_IP_BLOCK_TYPE_SMC) ||
|
||||
(adev->ip_blocks[i].type == AMD_IP_BLOCK_TYPE_ACP) ||
|
||||
(adev->ip_blocks[i].type == AMD_IP_BLOCK_TYPE_DCE)) {
|
||||
if (adev->ip_block_status[i].hang) {
|
||||
DRM_INFO("Some block need full reset!\n");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user