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

Zhang, Hawking Hawking.Zhang at amd.com
Wed Nov 27 12:04:07 UTC 2019


[AMD Official Use Only - Internal Distribution Only]


Please check my comments inline



Regards,
Hawking



-----Original Message-----
From: Le Ma <le.ma at amd.com>
Sent: 2019年11月27日 17:15
To: amd-gfx at lists.freedesktop.org
Cc: Zhang, Hawking <Hawking.Zhang at amd.com>; Chen, Guchun <Guchun.Chen at amd.com>; Zhou1, Tao <Tao.Zhou1 at amd.com>; Li, Dennis <Dennis.Li at amd.com>; Deucher, Alexander <Alexander.Deucher at amd.com>; Ma, Le <Le.Ma at amd.com>
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 at amd.com<mailto:le.ma at amd.com>>

---

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);

+

               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);

+





[Hawking] Shouldn't be enabled doorbell interrupt after exit baco? Or do I miss something?



+             return 0;

}

--

2.7.4


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20191127/3a7e5f76/attachment.html>


More information about the amd-gfx mailing list