Re: [PATCH] drm/amdgpu: add error print when failing to add IP block

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 10, 2021 at 10:21 PM Guchun Chen <guchun.chen@xxxxxxx> wrote:
>
> Driver initialization is driven by IP version from IP
> discovery table. So add error print when failing to add
> ip block during driver initialization, this will be more
> friendly to user to know which IP version is not correct.
>
> [   40.467361] [drm] host supports REQ_INIT_DATA handshake
> [   40.474076] [drm] add ip block number 0 <nv_common>
> [   40.474090] [drm] add ip block number 1 <gmc_v10_0>
> [   40.474101] [drm] add ip block number 2 <psp>
> [   40.474103] [drm] add ip block number 3 <navi10_ih>
> [   40.474114] [drm] add ip block number 4 <smu>
> [   40.474119] [drm] add ip block number 5 <amdgpu_vkms>
> [   40.474134] [drm] add ip block number 6 <gfx_v10_0>
> [   40.474143] [drm] add ip block number 7 <sdma_v5_2>
> [   40.474147] amdgpu 0000:00:08.0: amdgpu: Fatal error during GPU init
> [   40.474545] amdgpu 0000:00:08.0: amdgpu: amdgpu: finishing device.
>
> Signed-off-by: Guchun Chen <guchun.chen@xxxxxxx>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 24 +++++++++++++++++++
>  1 file changed, 24 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> index ff70bc233489..b68e5237fd16 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> @@ -587,6 +587,8 @@ static int amdgpu_discovery_set_common_ip_blocks(struct amdgpu_device *adev)
>                 amdgpu_device_ip_block_add(adev, &nv_common_ip_block);
>                 break;
>         default:
> +               DRM_ERROR("Failed to add common ip block(GC_HWIP:0x%x)\n",

dev_err() is more friendly to multi-GPU systems.  With that fixed,
Reviewed-by: Alex Deucher <alexander.deucher@xxxxxxx>

> +                       adev->ip_versions[GC_HWIP][0]);
>                 return -EINVAL;
>         }
>         return 0;
> @@ -619,6 +621,8 @@ static int amdgpu_discovery_set_gmc_ip_blocks(struct amdgpu_device *adev)
>                 amdgpu_device_ip_block_add(adev, &gmc_v10_0_ip_block);
>                 break;
>         default:
> +               DRM_ERROR("Failed to add gmc ip block(GC_HWIP:0x%x)\n",
> +                       adev->ip_versions[GC_HWIP][0]);
>                 return -EINVAL;
>         }
>         return 0;
> @@ -648,6 +652,8 @@ static int amdgpu_discovery_set_ih_ip_blocks(struct amdgpu_device *adev)
>                 amdgpu_device_ip_block_add(adev, &navi10_ih_ip_block);
>                 break;
>         default:
> +               DRM_ERROR("Failed to add ih ip block(OSSSYS_HWIP:0x%x)\n",
> +                       adev->ip_versions[OSSSYS_HWIP][0]);
>                 return -EINVAL;
>         }
>         return 0;
> @@ -688,6 +694,8 @@ static int amdgpu_discovery_set_psp_ip_blocks(struct amdgpu_device *adev)
>                 amdgpu_device_ip_block_add(adev, &psp_v13_0_ip_block);
>                 break;
>         default:
> +               DRM_ERROR("Failed to add psp ip block(MP0_HWIP:0x%x)\n",
> +                       adev->ip_versions[MP0_HWIP][0]);
>                 return -EINVAL;
>         }
>         return 0;
> @@ -726,6 +734,8 @@ static int amdgpu_discovery_set_smu_ip_blocks(struct amdgpu_device *adev)
>                 amdgpu_device_ip_block_add(adev, &smu_v13_0_ip_block);
>                 break;
>         default:
> +               DRM_ERROR("Failed to add smu ip block(MP1_HWIP:0x%x)\n",
> +                       adev->ip_versions[MP1_HWIP][0]);
>                 return -EINVAL;
>         }
>         return 0;
> @@ -753,6 +763,8 @@ static int amdgpu_discovery_set_display_ip_blocks(struct amdgpu_device *adev)
>                         amdgpu_device_ip_block_add(adev, &dm_ip_block);
>                         break;
>                 default:
> +                       DRM_ERROR("Failed to add dm ip block(DCE_HWIP:0x%x)\n",
> +                               adev->ip_versions[DCE_HWIP][0]);
>                         return -EINVAL;
>                 }
>         } else if (adev->ip_versions[DCI_HWIP][0]) {
> @@ -763,6 +775,8 @@ static int amdgpu_discovery_set_display_ip_blocks(struct amdgpu_device *adev)
>                         amdgpu_device_ip_block_add(adev, &dm_ip_block);
>                         break;
>                 default:
> +                       DRM_ERROR("Failed to add dm ip block(DCI_HWIP:0x%x)\n",
> +                               adev->ip_versions[DCI_HWIP][0]);
>                         return -EINVAL;
>                 }
>  #endif
> @@ -796,6 +810,8 @@ static int amdgpu_discovery_set_gc_ip_blocks(struct amdgpu_device *adev)
>                 amdgpu_device_ip_block_add(adev, &gfx_v10_0_ip_block);
>                 break;
>         default:
> +               DRM_ERROR("Failed to add gfx ip block(GC_HWIP:0x%x)\n",
> +                       adev->ip_versions[GC_HWIP][0]);
>                 return -EINVAL;
>         }
>         return 0;
> @@ -829,6 +845,8 @@ static int amdgpu_discovery_set_sdma_ip_blocks(struct amdgpu_device *adev)
>                 amdgpu_device_ip_block_add(adev, &sdma_v5_2_ip_block);
>                 break;
>         default:
> +               DRM_ERROR("Failed to add sdma ip block(SDMA0_HWIP:0x%x)\n",
> +                       adev->ip_versions[SDMA0_HWIP][0]);
>                 return -EINVAL;
>         }
>         return 0;
> @@ -845,6 +863,8 @@ static int amdgpu_discovery_set_mm_ip_blocks(struct amdgpu_device *adev)
>                                 amdgpu_device_ip_block_add(adev, &uvd_v7_0_ip_block);
>                         break;
>                 default:
> +                       DRM_ERROR("Failed to add uvd v7 ip block(UVD_HWIP:0x%x)\n",
> +                               adev->ip_versions[UVD_HWIP][0]);
>                         return -EINVAL;
>                 }
>                 switch (adev->ip_versions[VCE_HWIP][0]) {
> @@ -855,6 +875,8 @@ static int amdgpu_discovery_set_mm_ip_blocks(struct amdgpu_device *adev)
>                                 amdgpu_device_ip_block_add(adev, &vce_v4_0_ip_block);
>                         break;
>                 default:
> +                       DRM_ERROR("Failed to add VCE v4 ip block(VCE_HWIP:0x%x)\n",
> +                               adev->ip_versions[VCE_HWIP][0]);
>                         return -EINVAL;
>                 }
>         } else {
> @@ -893,6 +915,8 @@ static int amdgpu_discovery_set_mm_ip_blocks(struct amdgpu_device *adev)
>                         amdgpu_device_ip_block_add(adev, &vcn_v3_0_ip_block);
>                         break;
>                 default:
> +                       DRM_ERROR("Failed to add vcn/jpeg ip block(UVD_HWIP:0x%x)\n",
> +                               adev->ip_versions[UVD_HWIP][0]);
>                         return -EINVAL;
>                 }
>         }
> --
> 2.17.1
>



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux