[PATCH v2] drm/amdkfd: Print bdf in peer map failure message

Alex Deucher alexdeucher at gmail.com
Tue Feb 22 18:58:49 UTC 2022


On Tue, Feb 22, 2022 at 1:56 PM Harish Kasiviswanathan
<Harish.Kasiviswanathan at amd.com> wrote:
>
> Print alloc node, peer node and memory domain when peer map fails. This
> is more useful
>
> v2: use dev_err instead of pr_err
>     use bdf for identify peer gpu
>
> Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan at amd.com>

Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

> ---
>  drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> index 965af2a08bc0..9141b674947d 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> @@ -1215,8 +1215,15 @@ static int kfd_ioctl_map_memory_to_gpu(struct file *filep,
>                         peer_pdd->dev->adev, (struct kgd_mem *)mem,
>                         peer_pdd->drm_priv, &table_freed);
>                 if (err) {
> -                       pr_err("Failed to map to gpu %d/%d\n",
> -                              i, args->n_devices);
> +                       struct pci_dev *pdev = peer_pdd->dev->adev->pdev;
> +
> +                       dev_err(dev->adev->dev,
> +                              "Failed to map peer:%04x:%02x:%02x.%d mem_domain:%d\n",
> +                              pci_domain_nr(pdev->bus),
> +                              pdev->bus->number,
> +                              PCI_SLOT(pdev->devfn),
> +                              PCI_FUNC(pdev->devfn),
> +                              ((struct kgd_mem *)mem)->domain);
>                         goto map_memory_to_gpu_failed;
>                 }
>                 args->n_success = i+1;
> --
> 2.25.1
>


More information about the amd-gfx mailing list