Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/panfrost: Make re-enabling job interrupts at device reset optional

Rather than remasking interrupts after a device reset in the main reset
path, allow selecting whether to do this with an additional bool parameter.

To this end, split reenabling job interrupts into two functions, one that
clears the interrupts and another one which unmasks them conditionally.

Reviewed-by: Steven Price <steven.price@arm.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
Link: https://lore.kernel.org/r/20251019145225.3621989-9-adrian.larumbe@collabora.com
Signed-off-by: Steven Price <steven.price@arm.com>

authored by

Adrián Larumbe and committed by
Steven Price
42e7ab3b fc237ec8

+16 -13
+6 -3
drivers/gpu/drm/panfrost/panfrost_device.c
··· 400 400 return false; 401 401 } 402 402 403 - void panfrost_device_reset(struct panfrost_device *pfdev) 403 + void panfrost_device_reset(struct panfrost_device *pfdev, bool enable_job_int) 404 404 { 405 405 panfrost_gpu_soft_reset(pfdev); 406 406 407 407 panfrost_gpu_power_on(pfdev); 408 408 panfrost_mmu_reset(pfdev); 409 - panfrost_job_enable_interrupts(pfdev); 409 + 410 + panfrost_job_reset_interrupts(pfdev); 411 + if (enable_job_int) 412 + panfrost_job_enable_interrupts(pfdev); 410 413 } 411 414 412 415 static int panfrost_device_runtime_resume(struct device *dev) ··· 433 430 } 434 431 } 435 432 436 - panfrost_device_reset(pfdev); 433 + panfrost_device_reset(pfdev, true); 437 434 panfrost_devfreq_resume(pfdev); 438 435 439 436 return 0;
+1 -1
drivers/gpu/drm/panfrost/panfrost_device.h
··· 250 250 251 251 int panfrost_device_init(struct panfrost_device *pfdev); 252 252 void panfrost_device_fini(struct panfrost_device *pfdev); 253 - void panfrost_device_reset(struct panfrost_device *pfdev); 253 + void panfrost_device_reset(struct panfrost_device *pfdev, bool enable_job_int); 254 254 255 255 extern const struct dev_pm_ops panfrost_pm_ops; 256 256
+8 -9
drivers/gpu/drm/panfrost/panfrost_job.c
··· 430 430 return fence; 431 431 } 432 432 433 + void panfrost_job_reset_interrupts(struct panfrost_device *pfdev) 434 + { 435 + job_write(pfdev, JOB_INT_CLEAR, ALL_JS_INT_MASK); 436 + } 437 + 433 438 void panfrost_job_enable_interrupts(struct panfrost_device *pfdev) 434 439 { 435 440 clear_bit(PANFROST_COMP_BIT_JOB, pfdev->is_suspended); 436 - 437 - job_write(pfdev, JOB_INT_CLEAR, ALL_JS_INT_MASK); 438 441 job_write(pfdev, JOB_INT_MASK, ALL_JS_INT_MASK); 439 442 } 440 443 ··· 730 727 spin_unlock(&pfdev->js->job_lock); 731 728 732 729 /* Proceed with reset now. */ 733 - panfrost_device_reset(pfdev); 734 - 735 - /* panfrost_device_reset() unmasks job interrupts, but we want to 736 - * keep them masked a bit longer. 737 - */ 738 - job_write(pfdev, JOB_INT_MASK, 0); 730 + panfrost_device_reset(pfdev, false); 739 731 740 732 /* GPU has been reset, we can clear the reset pending bit. */ 741 733 atomic_set(&pfdev->reset.pending, 0); ··· 752 754 drm_sched_start(&pfdev->js->queue[i].sched, 0); 753 755 754 756 /* Re-enable job interrupts now that everything has been restarted. */ 755 - job_write(pfdev, JOB_INT_MASK, ALL_JS_INT_MASK); 757 + panfrost_job_enable_interrupts(pfdev); 756 758 757 759 dma_fence_end_signalling(cookie); 758 760 } ··· 905 907 } 906 908 } 907 909 910 + panfrost_job_reset_interrupts(pfdev); 908 911 panfrost_job_enable_interrupts(pfdev); 909 912 910 913 return 0;
+1
drivers/gpu/drm/panfrost/panfrost_job.h
··· 69 69 int panfrost_job_get_slot(struct panfrost_job *job); 70 70 int panfrost_job_push(struct panfrost_job *job); 71 71 void panfrost_job_put(struct panfrost_job *job); 72 + void panfrost_job_reset_interrupts(struct panfrost_device *pfdev); 72 73 void panfrost_job_enable_interrupts(struct panfrost_device *pfdev); 73 74 void panfrost_job_suspend_irq(struct panfrost_device *pfdev); 74 75 int panfrost_job_is_idle(struct panfrost_device *pfdev);