[PATCH v3 4/5] drm/amdgpu: get xgmi info before ip_init

Skvortsov, Victor Victor.Skvortsov at amd.com
Thu Dec 16 21:15:40 UTC 2021


[AMD Official Use Only]

I will fix the indent issue. There shouldn't be any conflicts between this patch and the xgmi init changes. We've run with those xgmi init patches applied on top of mainline-dkms-5.13 (where this change is already present) and found no issues.

Thanks,
Victor

-----Original Message-----
From: Alex Deucher <alexdeucher at gmail.com> 
Sent: Thursday, December 16, 2021 3:18 PM
To: Skvortsov, Victor <Victor.Skvortsov at amd.com>
Cc: amd-gfx list <amd-gfx at lists.freedesktop.org>; Deng, Emily <Emily.Deng at amd.com>; Liu, Monk <Monk.Liu at amd.com>; Ming, Davis <Davis.Ming at amd.com>; Liu, Shaoyun <Shaoyun.Liu at amd.com>; Zhou, Peng Ju <PengJu.Zhou at amd.com>; Chen, JingWen <JingWen.Chen2 at amd.com>; Chen, Horace <Horace.Chen at amd.com>; Nieto, David M <David.Nieto at amd.com>
Subject: Re: [PATCH v3 4/5] drm/amdgpu: get xgmi info before ip_init

[CAUTION: External Email]

On Thu, Dec 16, 2021 at 2:43 PM Victor Skvortsov <victor.skvortsov at amd.com> wrote:
>
> Driver needs to call get_xgmi_info() before ip_init to determine 
> whether it needs to handle a pending hive reset.
>
> Signed-off-by: Victor Skvortsov <victor.skvortsov at amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 7 +++++++
>  drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c     | 6 ------
>  drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c      | 6 ------
>  3 files changed, 7 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 5bd785cfc5ca..4fd370016834 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -3576,6 +3576,13 @@ int amdgpu_device_init(struct amdgpu_device *adev,
>         if (r)
>                 return r;
>
> +       /* Need to get xgmi info early to decide the reset behavior*/
> +       if (adev->gmc.xgmi.supported) {
> +               r = adev->gfxhub.funcs->get_xgmi_info(adev);
> +       if (r)

Indentation looks off here, please fix that.  Also, will this conflict with Shaoyun's xgmi init patch which may or may not have landed?
Other than that, these patches look pretty good to me.

Alex


> +                       return r;
> +       }
> +
>         /* enable PCIE atomic ops */
>         if (amdgpu_sriov_vf(adev))
>                 adev->have_atomics_support = ((struct 
> amd_sriov_msg_pf2vf_info *) diff --git 
> a/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c 
> b/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
> index ae46eb35b3d7..3d5d47a799e3 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
> @@ -914,12 +914,6 @@ static int gmc_v10_0_sw_init(void *handle)
>                 return r;
>         }
>
> -       if (adev->gmc.xgmi.supported) {
> -               r = adev->gfxhub.funcs->get_xgmi_info(adev);
> -               if (r)
> -                       return r;
> -       }
> -
>         r = gmc_v10_0_mc_init(adev);
>         if (r)
>                 return r;
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c 
> b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> index 2b86c63b032a..57f2729a7bd0 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> @@ -1628,12 +1628,6 @@ static int gmc_v9_0_sw_init(void *handle)
>         }
>         adev->need_swiotlb = drm_need_swiotlb(44);
>
> -       if (adev->gmc.xgmi.supported) {
> -               r = adev->gfxhub.funcs->get_xgmi_info(adev);
> -               if (r)
> -                       return r;
> -       }
> -
>         r = gmc_v9_0_mc_init(adev);
>         if (r)
>                 return r;
> --
> 2.25.1
>


More information about the amd-gfx mailing list