[15/24] drm/amdkfd: Add more error printing to help bringup v2

Submitted by Felix Kuehling on Aug. 16, 2017, 3 a.m.

Details

Message ID 1502852422-19620-16-git-send-email-Felix.Kuehling@amd.com
State Accepted
Commit 4ebc7182743a4bef47cdd9d3e9f08cff943faa4f
Headers show
Series "KFD fixes, cleanups, features to make the runtime happy" ( rev: 1 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Felix Kuehling Aug. 16, 2017, 3 a.m.
From: Yong Zhao <Yong.Zhao@amd.com>

v2: Turned WARN into dev_warn and made the message more helpful

Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_device.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
index f628ac3..fd26d7b 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
@@ -103,6 +103,9 @@  static const struct kfd_device_info *lookup_device_info(unsigned short did)
 		}
 	}
 
+	dev_warn(kfd_device, "DID %04x is missing in supported_devices\n",
+		 did);
+
 	return NULL;
 }
 
@@ -114,8 +117,10 @@  struct kfd_dev *kgd2kfd_probe(struct kgd_dev *kgd,
 	const struct kfd_device_info *device_info =
 					lookup_device_info(pdev->device);
 
-	if (!device_info)
+	if (!device_info) {
+		dev_err(kfd_device, "kgd2kfd_probe failed\n");
 		return NULL;
+	}
 
 	kfd = kzalloc(sizeof(*kfd), GFP_KERNEL);
 	if (!kfd)
@@ -364,8 +369,11 @@  int kgd2kfd_resume(struct kfd_dev *kfd)
 
 	if (kfd->init_complete) {
 		err = amd_iommu_init_device(kfd->pdev, pasid_limit);
-		if (err < 0)
+		if (err < 0) {
+			dev_err(kfd_device, "failed to initialize iommu\n");
 			return -ENXIO;
+		}
+
 		amd_iommu_set_invalidate_ctx_cb(kfd->pdev,
 						iommu_pasid_shutdown_callback);
 		amd_iommu_set_invalid_ppr_cb(kfd->pdev, iommu_invalid_ppr_cb);

Comments

On Wed, Aug 16, 2017 at 6:00 AM, Felix Kuehling <Felix.Kuehling@amd.com> wrote:
> From: Yong Zhao <Yong.Zhao@amd.com>
>
> v2: Turned WARN into dev_warn and made the message more helpful
>
> Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
> Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
> ---
>  drivers/gpu/drm/amd/amdkfd/kfd_device.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
> index f628ac3..fd26d7b 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
> @@ -103,6 +103,9 @@ static const struct kfd_device_info *lookup_device_info(unsigned short did)
>                 }
>         }
>
> +       dev_warn(kfd_device, "DID %04x is missing in supported_devices\n",
> +                did);
> +
>         return NULL;
>  }
>
> @@ -114,8 +117,10 @@ struct kfd_dev *kgd2kfd_probe(struct kgd_dev *kgd,
>         const struct kfd_device_info *device_info =
>                                         lookup_device_info(pdev->device);
>
> -       if (!device_info)
> +       if (!device_info) {
> +               dev_err(kfd_device, "kgd2kfd_probe failed\n");
>                 return NULL;
> +       }
>
>         kfd = kzalloc(sizeof(*kfd), GFP_KERNEL);
>         if (!kfd)
> @@ -364,8 +369,11 @@ int kgd2kfd_resume(struct kfd_dev *kfd)
>
>         if (kfd->init_complete) {
>                 err = amd_iommu_init_device(kfd->pdev, pasid_limit);
> -               if (err < 0)
> +               if (err < 0) {
> +                       dev_err(kfd_device, "failed to initialize iommu\n");
>                         return -ENXIO;
> +               }
> +
>                 amd_iommu_set_invalidate_ctx_cb(kfd->pdev,
>                                                 iommu_pasid_shutdown_callback);
>                 amd_iommu_set_invalid_ppr_cb(kfd->pdev, iommu_invalid_ppr_cb);
> --
> 2.7.4
>
This patch is:
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>