drm/amdgpu: enable/disable doorbell interrupt in baco entry/exit helper
This operation is needed when baco entry/exit for ras recovery Signed-off-by: Le Ma <le.ma@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -4306,10 +4306,14 @@ static void amdgpu_device_get_pcie_info(struct amdgpu_device *adev)
|
|||||||
int amdgpu_device_baco_enter(struct drm_device *dev)
|
int amdgpu_device_baco_enter(struct drm_device *dev)
|
||||||
{
|
{
|
||||||
struct amdgpu_device *adev = dev->dev_private;
|
struct amdgpu_device *adev = dev->dev_private;
|
||||||
|
struct amdgpu_ras *ras = amdgpu_ras_get_context(adev);
|
||||||
|
|
||||||
if (!amdgpu_device_supports_baco(adev->ddev))
|
if (!amdgpu_device_supports_baco(adev->ddev))
|
||||||
return -ENOTSUPP;
|
return -ENOTSUPP;
|
||||||
|
|
||||||
|
if (ras && ras->supported)
|
||||||
|
adev->nbio.funcs->enable_doorbell_interrupt(adev, false);
|
||||||
|
|
||||||
if (is_support_sw_smu(adev)) {
|
if (is_support_sw_smu(adev)) {
|
||||||
struct smu_context *smu = &adev->smu;
|
struct smu_context *smu = &adev->smu;
|
||||||
int ret;
|
int ret;
|
||||||
@@ -4317,8 +4321,6 @@ int amdgpu_device_baco_enter(struct drm_device *dev)
|
|||||||
ret = smu_baco_enter(smu);
|
ret = smu_baco_enter(smu);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
return 0;
|
|
||||||
} else {
|
} else {
|
||||||
void *pp_handle = adev->powerplay.pp_handle;
|
void *pp_handle = adev->powerplay.pp_handle;
|
||||||
const struct amd_pm_funcs *pp_funcs = adev->powerplay.pp_funcs;
|
const struct amd_pm_funcs *pp_funcs = adev->powerplay.pp_funcs;
|
||||||
@@ -4329,14 +4331,15 @@ int amdgpu_device_baco_enter(struct drm_device *dev)
|
|||||||
/* enter BACO state */
|
/* enter BACO state */
|
||||||
if (pp_funcs->set_asic_baco_state(pp_handle, 1))
|
if (pp_funcs->set_asic_baco_state(pp_handle, 1))
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int amdgpu_device_baco_exit(struct drm_device *dev)
|
int amdgpu_device_baco_exit(struct drm_device *dev)
|
||||||
{
|
{
|
||||||
struct amdgpu_device *adev = dev->dev_private;
|
struct amdgpu_device *adev = dev->dev_private;
|
||||||
|
struct amdgpu_ras *ras = amdgpu_ras_get_context(adev);
|
||||||
|
|
||||||
if (!amdgpu_device_supports_baco(adev->ddev))
|
if (!amdgpu_device_supports_baco(adev->ddev))
|
||||||
return -ENOTSUPP;
|
return -ENOTSUPP;
|
||||||
@@ -4349,7 +4352,6 @@ int amdgpu_device_baco_exit(struct drm_device *dev)
|
|||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
return 0;
|
|
||||||
} else {
|
} else {
|
||||||
void *pp_handle = adev->powerplay.pp_handle;
|
void *pp_handle = adev->powerplay.pp_handle;
|
||||||
const struct amd_pm_funcs *pp_funcs = adev->powerplay.pp_funcs;
|
const struct amd_pm_funcs *pp_funcs = adev->powerplay.pp_funcs;
|
||||||
@@ -4360,7 +4362,10 @@ int amdgpu_device_baco_exit(struct drm_device *dev)
|
|||||||
/* exit BACO state */
|
/* exit BACO state */
|
||||||
if (pp_funcs->set_asic_baco_state(pp_handle, 0))
|
if (pp_funcs->set_asic_baco_state(pp_handle, 0))
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ras && ras->supported)
|
||||||
|
adev->nbio.funcs->enable_doorbell_interrupt(adev, true);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user