drm/amdgpu: Avoid use KIQ in VM fault ISR for SRIOV support
Subsystems (2)
PATCH 4/6 drm/amdgpu: Avoid use KIQ in VM fault ISR for SRIOV support
Schedule a workqueue for VM fault handler on GMC V8.0 for SRIOV support.
--- drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 40 ++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c +39 -1
@@ -1219,7 +1219,7 @@ static int gmc_v8_0_vm_fault_interrupt_state(struct amdgpu_device *adev,return 0 ; } -static int gmc_v8_0_process_interrupt (struct amdgpu_device *adev, +static int gmc_v8_0_process_vm_fault (struct amdgpu_device *adev,struct amdgpu_irq_src *source,struct amdgpu_iv_entry *entry) {
@@ -1250,6 +1250,44 @@ static int gmc_v8_0_process_interrupt(struct amdgpu_device *adev,return 0 ; } +struct gmc_vm_fault_work { +struct work_struct base; +struct amdgpu_device *adev; +struct amdgpu_irq_src *source; +struct amdgpu_iv_entry *entry; +}; + +static void gmc_v8_0_vm_fault_sched (struct work_struct *work) +{ +struct gmc_vm_fault_work *vm_work = + container_of(work, struct gmc_vm_fault_work, base); +struct amdgpu_device *adev = vm_work->adev; +struct amdgpu_irq_src *source = vm_work->source; +struct amdgpu_iv_entry *entry = vm_work->entry; + +gmc_v8_0_process_vm_fault (adev, source, entry); +kfree (vm_work); +} + +static int gmc_v8_0_process_interrupt (struct amdgpu_device *adev, +struct amdgpu_irq_src *source, +struct amdgpu_iv_entry *entry) +{ +struct gmc_vm_fault_work *work =NULL ; + +if (amdgpu_sriov_vf (adev)) { + work =kmalloc (sizeof (struct gmc_vm_fault_work ),GFP_ATOMIC ); +if (!work) +return -ENOMEM ; +INIT_WORK (&work->base, gmc_v8_0_vm_fault_sched); + work->adev = adev; + work->source = source; + work->entry = entry; +return schedule_work (&work->base); + } +return gmc_v8_0_process_vm_fault (adev, source, entry); +} +static void fiji_update_mc_medium_grain_clock_gating (struct amdgpu_device *adev,bool enable) {
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1480489351-29141-1-git-send-email-Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org
Christian König
NAKAm 30.11.2016 um 08:02 schrieb Xiangliang Yu:
Quoted 5 lines
Schedule a workqueue for VM fault handler on GMC V8.0 for SRIOV support.
Signed-off-by shaoyunl <[email protected]>Signed-off-by Xiangliang Yu <[email protected]>
NAK, it is vital to print the information from the registers and reset them ASAP even under SRIOV.
My last status was that the registers in question shouldn't be subject to KIQ and accessed directly.
Christian.
Quoted 52 lines
--- drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 40 ++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c +32
-1@@ -1219,7 +1219,7 @@ static int gmc_v8_0_vm_fault_interrupt_state(struct amdgpu_device *adev,return 0 ; } -static int gmc_v8_0_process_interrupt (struct amdgpu_device *adev, +static int gmc_v8_0_process_vm_fault (struct amdgpu_device *adev,struct amdgpu_irq_src *source,struct amdgpu_iv_entry *entry) {@@ -1250,6 +1250,44 @@ static int gmc_v8_0_process_interrupt(struct amdgpu_device *adev,return 0 ; } +struct gmc_vm_fault_work { +struct work_struct base; +struct amdgpu_device *adev; +struct amdgpu_irq_src *source; +struct amdgpu_iv_entry *entry; +}; + +static void gmc_v8_0_vm_fault_sched (struct work_struct *work) +{ +struct gmc_vm_fault_work *vm_work = + container_of(work, struct gmc_vm_fault_work, base); +struct amdgpu_device *adev = vm_work->adev; +struct amdgpu_irq_src *source = vm_work->source; +struct amdgpu_iv_entry *entry = vm_work->entry; + +gmc_v8_0_process_vm_fault (adev, source, entry); +kfree (vm_work); +} + +static int gmc_v8_0_process_interrupt (struct amdgpu_device *adev, +struct amdgpu_irq_src *source, +struct amdgpu_iv_entry *entry) +{ +struct gmc_vm_fault_work *work =NULL ; + +if (amdgpu_sriov_vf (adev)) { + work =kmalloc (sizeof (struct gmc_vm_fault_work ),GFP_ATOMIC ); +if (!work) +return -ENOMEM ; +INIT_WORK (&work->base, gmc_v8_0_vm_fault_sched); + work->adev = adev;
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c static int gmc_v8_0_process_interrupt(struct amdgpu_device *adev, · line 1293
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c +7
-0+ work->source = source; + work->entry = entry; +return schedule_work (&work->base); + } +return gmc_v8_0_process_vm_fault (adev, source, entry); +} +static void fiji_update_mc_medium_grain_clock_gating (struct amdgpu_device *adev,bool enable) {
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 779850dd-f16b-6c8c-075d-56d3cee05dfa-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org
Quoted 4 lines
Am 30.11.2016 um 08:02 schrieb Xiangliang Yu:
Quoted 3 lines
Schedule a workqueue for VM fault handler on GMC V8.0 for SRIOV support.
Quoted 8 lines
Quoted 2 lines
Signed-off-by shaoyunl <[email protected]>Signed-off-by Xiangliang Yu <[email protected]>NAK, it is vital to print the information from the registers and reset them ASAP even under SRIOV.
My last status was that the registers in question shouldn't be subject to KIQ and accessed directly.
Ok, please ignore the patch.
Quoted 52 lines
Quoted 3 lines
--- drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 40++++++++++++++++++++++++++++++++++-
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c static int
Quoted 8 lines
1 file changed, 39 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c +0
-0@@ -1219,7 +1219,7 @@ static intgmc_v8_0_vm_fault_interrupt_state(struct
amdgpu_device*adev,drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c static int gmc_v8_0_process_interrupt(struct
Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c +1
-1return 0 ; } -static int gmc_v8_0_process_interrupt (struct amdgpu_device *adev, +static int gmc_v8_0_process_vm_fault (struct amdgpu_device *adev,struct amdgpu_irq_src *source,struct amdgpu_iv_entry *entry) {@@ -1250,6 +1250,44 @@ static int gmc_v8_0_process_interrupt(struct
amdgpu_device*adev,Quoted 18 lines
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c +15
-0return 0 ; } +struct gmc_vm_fault_work { +struct work_struct base; +struct amdgpu_device *adev; +struct amdgpu_irq_src *source; +struct amdgpu_iv_entry *entry; +}; + +static void gmc_v8_0_vm_fault_sched (struct work_struct *work) { +struct gmc_vm_fault_work *vm_work = + container_of(work, struct gmc_vm_fault_work, base); +struct amdgpu_device *adev = vm_work->adev; +struct amdgpu_irq_src *source = vm_work->source; +struct amdgpu_iv_entry *entry = vm_work->entry; + +gmc_v8_0_process_vm_fault (adev, source, entry);drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c static int gmc_v8_0_process_interrupt(struct amdgpu_device *adev,
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c +10
-0+kfree (vm_work); +} + +static int gmc_v8_0_process_interrupt (struct amdgpu_device *adev, +struct amdgpu_irq_src *source, +struct amdgpu_iv_entry *entry) { +struct gmc_vm_fault_work *work =NULL ; + +if (amdgpu_sriov_vf (adev)) { + work = kmalloc(sizeof(struct gmc_vm_fault_work),
GFP_ATOMIC);
Quoted 15 lines
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c static int gmc_v8_0_process_interrupt(struct amdgpu_device *adev,
Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c +10
-0+if (!work) +return -ENOMEM ; +INIT_WORK (&work->base, gmc_v8_0_vm_fault_sched); + work->adev = adev; + work->source = source; + work->entry = entry; +return schedule_work (&work->base); + } +return gmc_v8_0_process_vm_fault (adev, source, entry); } + static void fiji_update_mc_medium_grain_clock_gating(struct
amdgpu_device*adev,Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c +0
-0bool enable) {
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx