<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p>Oded, I agree with you. When I made the change, there was WARN_ON already in the same function lookup_device_info(), so I followed the suit and used WARN again. It is indeed a bit overkill. </p>
<p><br>
</p>
<p>Felix, do I need to fix it or can you fix it directly?</p>
<p><br>
</p>
<p>Yong<br>
</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Oded Gabbay <oded.gabbay@gmail.com><br>
<b>Sent:</b> Saturday, August 12, 2017 10:54:41 AM<br>
<b>To:</b> Kuehling, Felix<br>
<b>Cc:</b> amd-gfx list; Zhao, Yong<br>
<b>Subject:</b> Re: [PATCH 14/19] drm/amdkfd: Add more error printing to help bringup</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">On Sat, Aug 12, 2017 at 12:56 AM, Felix Kuehling <Felix.Kuehling@amd.com> wrote:<br>
> From: Yong Zhao <Yong.Zhao@amd.com><br>
><br>
> Signed-off-by: Yong Zhao <Yong.Zhao@amd.com><br>
> Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com><br>
> ---<br>
>  drivers/gpu/drm/amd/amdkfd/kfd_device.c | 11 +++++++++--<br>
>  1 file changed, 9 insertions(+), 2 deletions(-)<br>
><br>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c<br>
> index f628ac3..e1c2ad2 100644<br>
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c<br>
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c<br>
> @@ -103,6 +103,8 @@ static const struct kfd_device_info *lookup_device_info(unsigned short did)<br>
>                 }<br>
>         }<br>
><br>
> +       WARN(1, "device is not added to supported_devices\n");<br>
> +<br>
I think WARN is a bit excessive here. Its not actually a warning - an<br>
AMD gpu device is present but not supported in amdkfd.<br>
Maybe a dev_info is more appropriate here.<br>
<br>
Oded<br>
<br>
>         return NULL;<br>
>  }<br>
><br>
> @@ -114,8 +116,10 @@ struct kfd_dev *kgd2kfd_probe(struct kgd_dev *kgd,<br>
>         const struct kfd_device_info *device_info =<br>
>                                         lookup_device_info(pdev->device);<br>
><br>
> -       if (!device_info)<br>
> +       if (!device_info) {<br>
> +               dev_err(kfd_device, "kgd2kfd_probe failed\n");<br>
>                 return NULL;<br>
> +       }<br>
><br>
>         kfd = kzalloc(sizeof(*kfd), GFP_KERNEL);<br>
>         if (!kfd)<br>
> @@ -364,8 +368,11 @@ int kgd2kfd_resume(struct kfd_dev *kfd)<br>
><br>
>         if (kfd->init_complete) {<br>
>                 err = amd_iommu_init_device(kfd->pdev, pasid_limit);<br>
> -               if (err < 0)<br>
> +               if (err < 0) {<br>
> +                       dev_err(kfd_device, "failed to initialize iommu\n");<br>
>                         return -ENXIO;<br>
> +               }<br>
> +<br>
>                 amd_iommu_set_invalidate_ctx_cb(kfd->pdev,<br>
>                                                 iommu_pasid_shutdown_callback);<br>
>                 amd_iommu_set_invalid_ppr_cb(kfd->pdev, iommu_invalid_ppr_cb);<br>
> --<br>
> 2.7.4<br>
><br>
With the above fixed, this patch is:<br>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com><br>
</div>
</span></font>
</body>
</html>