mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-06 07:27:23 -04:00
drm/amdgpu: Add MES KIQ dequeue in MES hw fini
[Why] Need dequeue MES KIQ under SRIOV when unloading driver [How] Modify mes_v11_0_kiq_dequeue_sched which was used to dequeue MES SCHED to support veriable pipe. Add MES KIQ dequeue in hw fini Signed-off-by: Yifan Zha <Yifan.Zha@amd.com> Reviewed-by: Horace Chen <horace.chen@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -1089,13 +1089,14 @@ static int mes_v11_0_sw_fini(void *handle)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void mes_v11_0_kiq_dequeue_sched(struct amdgpu_device *adev)
|
||||
static void mes_v11_0_kiq_dequeue(struct amdgpu_ring *ring)
|
||||
{
|
||||
uint32_t data;
|
||||
int i;
|
||||
struct amdgpu_device *adev = ring->adev;
|
||||
|
||||
mutex_lock(&adev->srbm_mutex);
|
||||
soc21_grbm_select(adev, 3, AMDGPU_MES_SCHED_PIPE, 0, 0);
|
||||
soc21_grbm_select(adev, 3, ring->pipe, 0, 0);
|
||||
|
||||
/* disable the queue if it's active */
|
||||
if (RREG32_SOC15(GC, 0, regCP_HQD_ACTIVE) & 1) {
|
||||
@@ -1121,8 +1122,6 @@ static void mes_v11_0_kiq_dequeue_sched(struct amdgpu_device *adev)
|
||||
|
||||
soc21_grbm_select(adev, 0, 0, 0, 0);
|
||||
mutex_unlock(&adev->srbm_mutex);
|
||||
|
||||
adev->mes.ring.sched.ready = false;
|
||||
}
|
||||
|
||||
static void mes_v11_0_kiq_setting(struct amdgpu_ring *ring)
|
||||
@@ -1176,8 +1175,14 @@ static int mes_v11_0_kiq_hw_init(struct amdgpu_device *adev)
|
||||
|
||||
static int mes_v11_0_kiq_hw_fini(struct amdgpu_device *adev)
|
||||
{
|
||||
if (adev->mes.ring.sched.ready)
|
||||
mes_v11_0_kiq_dequeue_sched(adev);
|
||||
if (adev->mes.ring.sched.ready) {
|
||||
mes_v11_0_kiq_dequeue(&adev->mes.ring);
|
||||
adev->mes.ring.sched.ready = false;
|
||||
}
|
||||
|
||||
if (amdgpu_sriov_vf(adev)) {
|
||||
mes_v11_0_kiq_dequeue(&adev->gfx.kiq.ring);
|
||||
}
|
||||
|
||||
if (!amdgpu_sriov_vf(adev))
|
||||
mes_v11_0_enable(adev, false);
|
||||
|
||||
Reference in New Issue
Block a user