RE: [PATCH 05/10] drm/amdgpu: enable/disable doorbell interrupt in baco entry/exit helper

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

 




> -----Original Message-----
> From: Le Ma <le.ma@xxxxxxx>
> Sent: 2019年11月27日 17:15
> To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx
> Cc: Zhang, Hawking <Hawking.Zhang@xxxxxxx>; Chen, Guchun
> <Guchun.Chen@xxxxxxx>; Zhou1, Tao <Tao.Zhou1@xxxxxxx>; Li, Dennis
> <Dennis.Li@xxxxxxx>; Deucher, Alexander
> <Alexander.Deucher@xxxxxxx>; Ma, Le <Le.Ma@xxxxxxx>
> Subject: [PATCH 05/10] drm/amdgpu: enable/disable doorbell interrupt in
> baco entry/exit helper
> 
> This operation is needed when baco entry/exit for ras recovery
> 
> Change-Id: I535c7231693f3138a8e3d5acd55672e2ac68232f
> Signed-off-by: Le Ma <le.ma@xxxxxxx>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 19 ++++++++++++-------
>  1 file changed, 12 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index b1408c5..bd387bb 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -4308,10 +4308,14 @@ static void amdgpu_device_get_pcie_info(struct
> amdgpu_device *adev)  int amdgpu_device_baco_enter(struct drm_device
> *dev)  {
>  	struct amdgpu_device *adev = dev->dev_private;
> +	struct amdgpu_ras *ras = amdgpu_ras_get_context(adev);
> 
>  	if (!amdgpu_device_supports_baco(adev->ddev))
>  		return -ENOTSUPP;
> 
> +	if (ras && ras->supported)
> +		adev->nbio.funcs->enable_doorbell_interrupt(adev, false);
> +

[Tao] The following code is observed several times, I think we can add a new interface to replace it, I'll do that when I have time.

struct amdgpu_ras *ras = amdgpu_ras_get_context(adev);
if (ras && ras->supported)

>  	if (is_support_sw_smu(adev)) {
>  		struct smu_context *smu = &adev->smu;
>  		int ret;
> @@ -4319,8 +4323,6 @@ int amdgpu_device_baco_enter(struct drm_device
> *dev)
>  		ret = smu_baco_enter(smu);
>  		if (ret)
>  			return ret;
> -
> -		return 0;
>  	} else {
>  		void *pp_handle = adev->powerplay.pp_handle;
>  		const struct amd_pm_funcs *pp_funcs = adev-
> >powerplay.pp_funcs; @@ -4331,14 +4333,15 @@ int
> amdgpu_device_baco_enter(struct drm_device *dev)
>  		/* enter BACO state */
>  		if (pp_funcs->set_asic_baco_state(pp_handle, 1))
>  			return -EIO;
> -
> -		return 0;
>  	}
> +
> +	return 0;
>  }
> 
>  int amdgpu_device_baco_exit(struct drm_device *dev)  {
>  	struct amdgpu_device *adev = dev->dev_private;
> +	struct amdgpu_ras *ras = amdgpu_ras_get_context(adev);
> 
>  	if (!amdgpu_device_supports_baco(adev->ddev))
>  		return -ENOTSUPP;
> @@ -4351,7 +4354,6 @@ int amdgpu_device_baco_exit(struct drm_device
> *dev)
>  		if (ret)
>  			return ret;
> 
> -		return 0;
>  	} else {
>  		void *pp_handle = adev->powerplay.pp_handle;
>  		const struct amd_pm_funcs *pp_funcs = adev-
> >powerplay.pp_funcs; @@ -4362,7 +4364,10 @@ int
> amdgpu_device_baco_exit(struct drm_device *dev)
>  		/* exit BACO state */
>  		if (pp_funcs->set_asic_baco_state(pp_handle, 0))
>  			return -EIO;
> -
> -		return 0;
>  	}
> +
> +	if (ras && ras->supported)
> +		adev->nbio.funcs->enable_doorbell_interrupt(adev, false);
> +
> +	return 0;
>  }
> --
> 2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx




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

  Powered by Linux