diff options
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.19.8/0922-drm-amdgpu-remove-VM-fault_credit-handling.patch')
-rw-r--r-- | common/recipes-kernel/linux/linux-yocto-4.19.8/0922-drm-amdgpu-remove-VM-fault_credit-handling.patch | 241 |
1 files changed, 241 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.19.8/0922-drm-amdgpu-remove-VM-fault_credit-handling.patch b/common/recipes-kernel/linux/linux-yocto-4.19.8/0922-drm-amdgpu-remove-VM-fault_credit-handling.patch new file mode 100644 index 00000000..cafb0960 --- /dev/null +++ b/common/recipes-kernel/linux/linux-yocto-4.19.8/0922-drm-amdgpu-remove-VM-fault_credit-handling.patch @@ -0,0 +1,241 @@ +From c414db2b525bbdc686fe26ca33facefe17ff8a81 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com> +Date: Wed, 26 Sep 2018 11:15:36 +0200 +Subject: [PATCH 0922/2940] drm/amdgpu: remove VM fault_credit handling +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +printk_ratelimit() is much better suited to limit the number of reported +VM faults. + +Signed-off-by: Christian König <christian.koenig@amd.com> +Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> +Acked-by: Alex Deucher <alexander.deucher@amd.com> +Signed-off-by: Alex Deucher <alexander.deucher@amd.com> +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 37 ------------------------- + drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 5 ---- + drivers/gpu/drm/amd/amdgpu/cik_ih.c | 18 +----------- + drivers/gpu/drm/amd/amdgpu/cz_ih.c | 18 +----------- + drivers/gpu/drm/amd/amdgpu/iceland_ih.c | 18 +----------- + drivers/gpu/drm/amd/amdgpu/tonga_ih.c | 18 +----------- + drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 7 ++--- + 7 files changed, 6 insertions(+), 115 deletions(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +index aea9488d06fe..98126cc04eeb 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +@@ -3069,7 +3069,6 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm, + } + + INIT_KFIFO(vm->faults); +- vm->fault_credit = 16; + + return 0; + +@@ -3231,42 +3230,6 @@ void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm) + amdgpu_vmid_free_reserved(adev, vm, i); + } + +-/** +- * amdgpu_vm_pasid_fault_credit - Check fault credit for given PASID +- * +- * @adev: amdgpu_device pointer +- * @pasid: PASID do identify the VM +- * +- * This function is expected to be called in interrupt context. +- * +- * Returns: +- * True if there was fault credit, false otherwise +- */ +-bool amdgpu_vm_pasid_fault_credit(struct amdgpu_device *adev, +- unsigned int pasid) +-{ +- struct amdgpu_vm *vm; +- +- spin_lock(&adev->vm_manager.pasid_lock); +- vm = idr_find(&adev->vm_manager.pasid_idr, pasid); +- if (!vm) { +- /* VM not found, can't track fault credit */ +- spin_unlock(&adev->vm_manager.pasid_lock); +- return true; +- } +- +- /* No lock needed. only accessed by IRQ handler */ +- if (!vm->fault_credit) { +- /* Too many faults in this VM */ +- spin_unlock(&adev->vm_manager.pasid_lock); +- return false; +- } +- +- vm->fault_credit--; +- spin_unlock(&adev->vm_manager.pasid_lock); +- return true; +-} +- + /** + * amdgpu_vm_manager_init - init the VM manager + * +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +index 8755f6ec02d3..c5498f3760e8 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +@@ -229,9 +229,6 @@ struct amdgpu_vm { + /* Up to 128 pending retry page faults */ + DECLARE_KFIFO(faults, u64, 128); + +- /* Limit non-retry fault storms */ +- unsigned int fault_credit; +- + /* Points to the KFD process VM info */ + struct amdkfd_process_info *process_info; + +@@ -298,8 +295,6 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm, + int vm_context, unsigned int pasid); + int amdgpu_vm_make_compute(struct amdgpu_device *adev, struct amdgpu_vm *vm); + void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm); +-bool amdgpu_vm_pasid_fault_credit(struct amdgpu_device *adev, +- unsigned int pasid); + void amdgpu_vm_get_pd_bo(struct amdgpu_vm *vm, + struct list_head *validated, + struct amdgpu_bo_list_entry *entry); +diff --git a/drivers/gpu/drm/amd/amdgpu/cik_ih.c b/drivers/gpu/drm/amd/amdgpu/cik_ih.c +index b5775c6a857b..3e6c8c4067cb 100644 +--- a/drivers/gpu/drm/amd/amdgpu/cik_ih.c ++++ b/drivers/gpu/drm/amd/amdgpu/cik_ih.c +@@ -237,23 +237,7 @@ static u32 cik_ih_get_wptr(struct amdgpu_device *adev) + */ + static bool cik_ih_prescreen_iv(struct amdgpu_device *adev) + { +- u32 ring_index = adev->irq.ih.rptr >> 2; +- u16 pasid; +- +- switch (le32_to_cpu(adev->irq.ih.ring[ring_index]) & 0xff) { +- case 146: +- case 147: +- pasid = le32_to_cpu(adev->irq.ih.ring[ring_index + 2]) >> 16; +- if (!pasid || amdgpu_vm_pasid_fault_credit(adev, pasid)) +- return true; +- break; +- default: +- /* Not a VM fault */ +- return true; +- } +- +- adev->irq.ih.rptr += 16; +- return false; ++ return true; + } + + /** +diff --git a/drivers/gpu/drm/amd/amdgpu/cz_ih.c b/drivers/gpu/drm/amd/amdgpu/cz_ih.c +index df5ac4d85a00..447b3cbc47e5 100644 +--- a/drivers/gpu/drm/amd/amdgpu/cz_ih.c ++++ b/drivers/gpu/drm/amd/amdgpu/cz_ih.c +@@ -216,23 +216,7 @@ static u32 cz_ih_get_wptr(struct amdgpu_device *adev) + */ + static bool cz_ih_prescreen_iv(struct amdgpu_device *adev) + { +- u32 ring_index = adev->irq.ih.rptr >> 2; +- u16 pasid; +- +- switch (le32_to_cpu(adev->irq.ih.ring[ring_index]) & 0xff) { +- case 146: +- case 147: +- pasid = le32_to_cpu(adev->irq.ih.ring[ring_index + 2]) >> 16; +- if (!pasid || amdgpu_vm_pasid_fault_credit(adev, pasid)) +- return true; +- break; +- default: +- /* Not a VM fault */ +- return true; +- } +- +- adev->irq.ih.rptr += 16; +- return false; ++ return true; + } + + /** +diff --git a/drivers/gpu/drm/amd/amdgpu/iceland_ih.c b/drivers/gpu/drm/amd/amdgpu/iceland_ih.c +index cf0fc61aebe6..2b94a6d1550e 100644 +--- a/drivers/gpu/drm/amd/amdgpu/iceland_ih.c ++++ b/drivers/gpu/drm/amd/amdgpu/iceland_ih.c +@@ -216,23 +216,7 @@ static u32 iceland_ih_get_wptr(struct amdgpu_device *adev) + */ + static bool iceland_ih_prescreen_iv(struct amdgpu_device *adev) + { +- u32 ring_index = adev->irq.ih.rptr >> 2; +- u16 pasid; +- +- switch (le32_to_cpu(adev->irq.ih.ring[ring_index]) & 0xff) { +- case 146: +- case 147: +- pasid = le32_to_cpu(adev->irq.ih.ring[ring_index + 2]) >> 16; +- if (!pasid || amdgpu_vm_pasid_fault_credit(adev, pasid)) +- return true; +- break; +- default: +- /* Not a VM fault */ +- return true; +- } +- +- adev->irq.ih.rptr += 16; +- return false; ++ return true; + } + + /** +diff --git a/drivers/gpu/drm/amd/amdgpu/tonga_ih.c b/drivers/gpu/drm/amd/amdgpu/tonga_ih.c +index dcdbb4d72472..9d7b43da6acc 100644 +--- a/drivers/gpu/drm/amd/amdgpu/tonga_ih.c ++++ b/drivers/gpu/drm/amd/amdgpu/tonga_ih.c +@@ -227,23 +227,7 @@ static u32 tonga_ih_get_wptr(struct amdgpu_device *adev) + */ + static bool tonga_ih_prescreen_iv(struct amdgpu_device *adev) + { +- u32 ring_index = adev->irq.ih.rptr >> 2; +- u16 pasid; +- +- switch (le32_to_cpu(adev->irq.ih.ring[ring_index]) & 0xff) { +- case 146: +- case 147: +- pasid = le32_to_cpu(adev->irq.ih.ring[ring_index + 2]) >> 16; +- if (!pasid || amdgpu_vm_pasid_fault_credit(adev, pasid)) +- return true; +- break; +- default: +- /* Not a VM fault */ +- return true; +- } +- +- adev->irq.ih.rptr += 16; +- return false; ++ return true; + } + + /** +diff --git a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c +index 7afdb49ffa9f..f0814a8ccb1c 100644 +--- a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c ++++ b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c +@@ -258,12 +258,9 @@ static bool vega10_ih_prescreen_iv(struct amdgpu_device *adev) + if (!pasid) + return true; + +- /* Not a retry fault, check fault credit */ +- if (!(dw5 & 0x80)) { +- if (!amdgpu_vm_pasid_fault_credit(adev, pasid)) +- goto ignore_iv; ++ /* Not a retry fault */ ++ if (!(dw5 & 0x80)) + return true; +- } + + /* Track retry faults in per-VM fault FIFO. */ + spin_lock(&adev->vm_manager.pasid_lock); +-- +2.17.1 + |