* [PATCH v1 0/3] drm/panthor: Fix regressions introduced recently
@ 2025-12-02 13:35 Boris Brezillon
2025-12-02 13:35 ` [PATCH v1 1/3] drm/panthor: Drop a WARN_ON() in group_free_queue() Boris Brezillon
` (3 more replies)
0 siblings, 4 replies; 10+ messages in thread
From: Boris Brezillon @ 2025-12-02 13:35 UTC (permalink / raw)
To: Boris Brezillon, Steven Price, Liviu Dudau, Adrián Larumbe
Cc: dri-devel, Akash Goel, kernel
Hello,
This is a set of fixes for regressions noticed while testing the
drm-misc-next branch against mesa-ci.
Regards,
Boris
Boris Brezillon (3):
drm/panthor: Drop a WARN_ON() in group_free_queue()
drm/panthor: Make sure caches are flushed/invalidated when an AS is
recycled
drm/panthor: Unlock the locked region before disabling an AS
drivers/gpu/drm/panthor/panthor_mmu.c | 37 +++++++++++++++++++++----
drivers/gpu/drm/panthor/panthor_sched.c | 5 ++--
2 files changed, 33 insertions(+), 9 deletions(-)
--
2.51.1
^ permalink raw reply [flat|nested] 10+ messages in thread* [PATCH v1 1/3] drm/panthor: Drop a WARN_ON() in group_free_queue() 2025-12-02 13:35 [PATCH v1 0/3] drm/panthor: Fix regressions introduced recently Boris Brezillon @ 2025-12-02 13:35 ` Boris Brezillon 2025-12-02 14:20 ` Liviu Dudau 2025-12-02 13:35 ` [PATCH v1 2/3] drm/panthor: Make sure caches are flushed/invalidated when an AS is recycled Boris Brezillon ` (2 subsequent siblings) 3 siblings, 1 reply; 10+ messages in thread From: Boris Brezillon @ 2025-12-02 13:35 UTC (permalink / raw) To: Boris Brezillon, Steven Price, Liviu Dudau, Adrián Larumbe Cc: dri-devel, Akash Goel, kernel It appears the timeout can still be enabled when we reach that point, because of the asynchronous progress check done on queues that resets the timer when jobs are still in-flight, but progress was made. We could add more checks to make sure the timer is not re-enabled when a group can't run anymore, but we don't have a group to pass to queue_check_job_completion() in some context. It's just as safe (we just want to be sure the timer is stopped before we destroy the queue) and simpler to drop the WARN_ON() in group_free_queue(). Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> --- drivers/gpu/drm/panthor/panthor_sched.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c index 389d508b3848..203f6a0a6b9a 100644 --- a/drivers/gpu/drm/panthor/panthor_sched.c +++ b/drivers/gpu/drm/panthor/panthor_sched.c @@ -893,9 +893,8 @@ static void group_free_queue(struct panthor_group *group, struct panthor_queue * if (IS_ERR_OR_NULL(queue)) return; - /* This should have been disabled before that point. */ - drm_WARN_ON(&group->ptdev->base, - disable_delayed_work_sync(&queue->timeout.work)); + /* Disable the timeout before tearing down drm_sched components. */ + disable_delayed_work_sync(&queue->timeout.work); if (queue->entity.fence_context) drm_sched_entity_destroy(&queue->entity); -- 2.51.1 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v1 1/3] drm/panthor: Drop a WARN_ON() in group_free_queue() 2025-12-02 13:35 ` [PATCH v1 1/3] drm/panthor: Drop a WARN_ON() in group_free_queue() Boris Brezillon @ 2025-12-02 14:20 ` Liviu Dudau 0 siblings, 0 replies; 10+ messages in thread From: Liviu Dudau @ 2025-12-02 14:20 UTC (permalink / raw) To: Boris Brezillon Cc: Steven Price, Adrián Larumbe, dri-devel, Akash Goel, kernel On Tue, Dec 02, 2025 at 02:35:36PM +0100, Boris Brezillon wrote: > It appears the timeout can still be enabled when we reach that point, > because of the asynchronous progress check done on queues that resets > the timer when jobs are still in-flight, but progress was made. > We could add more checks to make sure the timer is not re-enabled when > a group can't run anymore, but we don't have a group to pass to > queue_check_job_completion() in some context. > > It's just as safe (we just want to be sure the timer is stopped before > we destroy the queue) and simpler to drop the WARN_ON() in > group_free_queue(). > > Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Best regards, Liviu > --- > drivers/gpu/drm/panthor/panthor_sched.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c > index 389d508b3848..203f6a0a6b9a 100644 > --- a/drivers/gpu/drm/panthor/panthor_sched.c > +++ b/drivers/gpu/drm/panthor/panthor_sched.c > @@ -893,9 +893,8 @@ static void group_free_queue(struct panthor_group *group, struct panthor_queue * > if (IS_ERR_OR_NULL(queue)) > return; > > - /* This should have been disabled before that point. */ > - drm_WARN_ON(&group->ptdev->base, > - disable_delayed_work_sync(&queue->timeout.work)); > + /* Disable the timeout before tearing down drm_sched components. */ > + disable_delayed_work_sync(&queue->timeout.work); > > if (queue->entity.fence_context) > drm_sched_entity_destroy(&queue->entity); > -- > 2.51.1 > ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v1 2/3] drm/panthor: Make sure caches are flushed/invalidated when an AS is recycled 2025-12-02 13:35 [PATCH v1 0/3] drm/panthor: Fix regressions introduced recently Boris Brezillon 2025-12-02 13:35 ` [PATCH v1 1/3] drm/panthor: Drop a WARN_ON() in group_free_queue() Boris Brezillon @ 2025-12-02 13:35 ` Boris Brezillon 2025-12-02 14:21 ` Liviu Dudau 2025-12-02 13:35 ` [PATCH v1 3/3] drm/panthor: Unlock the locked region before disabling an AS Boris Brezillon 2025-12-02 23:30 ` [PATCH v1 0/3] drm/panthor: Fix regressions introduced recently Chia-I Wu 3 siblings, 1 reply; 10+ messages in thread From: Boris Brezillon @ 2025-12-02 13:35 UTC (permalink / raw) To: Boris Brezillon, Steven Price, Liviu Dudau, Adrián Larumbe Cc: dri-devel, Akash Goel, kernel When we re-assign a slot to a different VM, we need to make sure the old VM caches are flushed before doing the switch. Specialize panthor_mmu_as_disable() so we can skip the slot programmation while still getting the cache flushing, and call this helper from panthor_vm_active() when an idle slot is recycled. Fixes: 6e2d3b3e8589 ("drm/panthor: Add support for atomic page table updates") Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> --- drivers/gpu/drm/panthor/panthor_mmu.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/panthor/panthor_mmu.c b/drivers/gpu/drm/panthor/panthor_mmu.c index 8ba5259e3d28..3644af1a8e56 100644 --- a/drivers/gpu/drm/panthor/panthor_mmu.c +++ b/drivers/gpu/drm/panthor/panthor_mmu.c @@ -585,7 +585,8 @@ static int panthor_mmu_as_enable(struct panthor_device *ptdev, u32 as_nr, return as_send_cmd_and_wait(ptdev, as_nr, AS_COMMAND_UPDATE); } -static int panthor_mmu_as_disable(struct panthor_device *ptdev, u32 as_nr) +static int panthor_mmu_as_disable(struct panthor_device *ptdev, u32 as_nr, + bool recycle_slot) { int ret; @@ -595,6 +596,12 @@ static int panthor_mmu_as_disable(struct panthor_device *ptdev, u32 as_nr) if (ret) return ret; + /* If the slot is going to be used immediately, don't bother changing + * the config. + */ + if (recycle_slot) + return 0; + gpu_write64(ptdev, AS_TRANSTAB(as_nr), 0); gpu_write64(ptdev, AS_MEMATTR(as_nr), 0); gpu_write64(ptdev, AS_TRANSCFG(as_nr), AS_TRANSCFG_ADRMODE_UNMAPPED); @@ -714,6 +721,11 @@ int panthor_vm_active(struct panthor_vm *vm) drm_WARN_ON(&ptdev->base, refcount_read(&lru_vm->as.active_cnt)); as = lru_vm->as.id; + + ret = panthor_mmu_as_disable(ptdev, as, true); + if (ret) + goto out_unlock; + panthor_vm_release_as_locked(lru_vm); } @@ -853,7 +865,7 @@ static void panthor_vm_declare_unusable(struct panthor_vm *vm) vm->unusable = true; mutex_lock(&ptdev->mmu->as.slots_lock); if (vm->as.id >= 0 && drm_dev_enter(&ptdev->base, &cookie)) { - panthor_mmu_as_disable(ptdev, vm->as.id); + panthor_mmu_as_disable(ptdev, vm->as.id, false); drm_dev_exit(cookie); } mutex_unlock(&ptdev->mmu->as.slots_lock); @@ -1780,7 +1792,7 @@ static void panthor_mmu_irq_handler(struct panthor_device *ptdev, u32 status) ptdev->mmu->as.slots[as].vm->unhandled_fault = true; /* Disable the MMU to kill jobs on this AS. */ - panthor_mmu_as_disable(ptdev, as); + panthor_mmu_as_disable(ptdev, as, false); mutex_unlock(&ptdev->mmu->as.slots_lock); status &= ~mask; @@ -1809,7 +1821,8 @@ void panthor_mmu_suspend(struct panthor_device *ptdev) struct panthor_vm *vm = ptdev->mmu->as.slots[i].vm; if (vm) { - drm_WARN_ON(&ptdev->base, panthor_mmu_as_disable(ptdev, i)); + drm_WARN_ON(&ptdev->base, + panthor_mmu_as_disable(ptdev, i, false)); panthor_vm_release_as_locked(vm); } } @@ -1930,7 +1943,7 @@ static void panthor_vm_free(struct drm_gpuvm *gpuvm) int cookie; if (drm_dev_enter(&ptdev->base, &cookie)) { - panthor_mmu_as_disable(ptdev, vm->as.id); + panthor_mmu_as_disable(ptdev, vm->as.id, false); drm_dev_exit(cookie); } @@ -2790,7 +2803,8 @@ void panthor_mmu_unplug(struct panthor_device *ptdev) struct panthor_vm *vm = ptdev->mmu->as.slots[i].vm; if (vm) { - drm_WARN_ON(&ptdev->base, panthor_mmu_as_disable(ptdev, i)); + drm_WARN_ON(&ptdev->base, + panthor_mmu_as_disable(ptdev, i, false)); panthor_vm_release_as_locked(vm); } } -- 2.51.1 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v1 2/3] drm/panthor: Make sure caches are flushed/invalidated when an AS is recycled 2025-12-02 13:35 ` [PATCH v1 2/3] drm/panthor: Make sure caches are flushed/invalidated when an AS is recycled Boris Brezillon @ 2025-12-02 14:21 ` Liviu Dudau 0 siblings, 0 replies; 10+ messages in thread From: Liviu Dudau @ 2025-12-02 14:21 UTC (permalink / raw) To: Boris Brezillon Cc: Steven Price, Adrián Larumbe, dri-devel, Akash Goel, kernel On Tue, Dec 02, 2025 at 02:35:37PM +0100, Boris Brezillon wrote: > When we re-assign a slot to a different VM, we need to make sure the > old VM caches are flushed before doing the switch. Specialize > panthor_mmu_as_disable() so we can skip the slot programmation while > still getting the cache flushing, and call this helper from > panthor_vm_active() when an idle slot is recycled. > > Fixes: 6e2d3b3e8589 ("drm/panthor: Add support for atomic page table updates") > Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Best regards, Liviu > --- > drivers/gpu/drm/panthor/panthor_mmu.c | 26 ++++++++++++++++++++------ > 1 file changed, 20 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/panthor/panthor_mmu.c b/drivers/gpu/drm/panthor/panthor_mmu.c > index 8ba5259e3d28..3644af1a8e56 100644 > --- a/drivers/gpu/drm/panthor/panthor_mmu.c > +++ b/drivers/gpu/drm/panthor/panthor_mmu.c > @@ -585,7 +585,8 @@ static int panthor_mmu_as_enable(struct panthor_device *ptdev, u32 as_nr, > return as_send_cmd_and_wait(ptdev, as_nr, AS_COMMAND_UPDATE); > } > > -static int panthor_mmu_as_disable(struct panthor_device *ptdev, u32 as_nr) > +static int panthor_mmu_as_disable(struct panthor_device *ptdev, u32 as_nr, > + bool recycle_slot) > { > int ret; > > @@ -595,6 +596,12 @@ static int panthor_mmu_as_disable(struct panthor_device *ptdev, u32 as_nr) > if (ret) > return ret; > > + /* If the slot is going to be used immediately, don't bother changing > + * the config. > + */ > + if (recycle_slot) > + return 0; > + > gpu_write64(ptdev, AS_TRANSTAB(as_nr), 0); > gpu_write64(ptdev, AS_MEMATTR(as_nr), 0); > gpu_write64(ptdev, AS_TRANSCFG(as_nr), AS_TRANSCFG_ADRMODE_UNMAPPED); > @@ -714,6 +721,11 @@ int panthor_vm_active(struct panthor_vm *vm) > > drm_WARN_ON(&ptdev->base, refcount_read(&lru_vm->as.active_cnt)); > as = lru_vm->as.id; > + > + ret = panthor_mmu_as_disable(ptdev, as, true); > + if (ret) > + goto out_unlock; > + > panthor_vm_release_as_locked(lru_vm); > } > > @@ -853,7 +865,7 @@ static void panthor_vm_declare_unusable(struct panthor_vm *vm) > vm->unusable = true; > mutex_lock(&ptdev->mmu->as.slots_lock); > if (vm->as.id >= 0 && drm_dev_enter(&ptdev->base, &cookie)) { > - panthor_mmu_as_disable(ptdev, vm->as.id); > + panthor_mmu_as_disable(ptdev, vm->as.id, false); > drm_dev_exit(cookie); > } > mutex_unlock(&ptdev->mmu->as.slots_lock); > @@ -1780,7 +1792,7 @@ static void panthor_mmu_irq_handler(struct panthor_device *ptdev, u32 status) > ptdev->mmu->as.slots[as].vm->unhandled_fault = true; > > /* Disable the MMU to kill jobs on this AS. */ > - panthor_mmu_as_disable(ptdev, as); > + panthor_mmu_as_disable(ptdev, as, false); > mutex_unlock(&ptdev->mmu->as.slots_lock); > > status &= ~mask; > @@ -1809,7 +1821,8 @@ void panthor_mmu_suspend(struct panthor_device *ptdev) > struct panthor_vm *vm = ptdev->mmu->as.slots[i].vm; > > if (vm) { > - drm_WARN_ON(&ptdev->base, panthor_mmu_as_disable(ptdev, i)); > + drm_WARN_ON(&ptdev->base, > + panthor_mmu_as_disable(ptdev, i, false)); > panthor_vm_release_as_locked(vm); > } > } > @@ -1930,7 +1943,7 @@ static void panthor_vm_free(struct drm_gpuvm *gpuvm) > int cookie; > > if (drm_dev_enter(&ptdev->base, &cookie)) { > - panthor_mmu_as_disable(ptdev, vm->as.id); > + panthor_mmu_as_disable(ptdev, vm->as.id, false); > drm_dev_exit(cookie); > } > > @@ -2790,7 +2803,8 @@ void panthor_mmu_unplug(struct panthor_device *ptdev) > struct panthor_vm *vm = ptdev->mmu->as.slots[i].vm; > > if (vm) { > - drm_WARN_ON(&ptdev->base, panthor_mmu_as_disable(ptdev, i)); > + drm_WARN_ON(&ptdev->base, > + panthor_mmu_as_disable(ptdev, i, false)); > panthor_vm_release_as_locked(vm); > } > } > -- > 2.51.1 > ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v1 3/3] drm/panthor: Unlock the locked region before disabling an AS 2025-12-02 13:35 [PATCH v1 0/3] drm/panthor: Fix regressions introduced recently Boris Brezillon 2025-12-02 13:35 ` [PATCH v1 1/3] drm/panthor: Drop a WARN_ON() in group_free_queue() Boris Brezillon 2025-12-02 13:35 ` [PATCH v1 2/3] drm/panthor: Make sure caches are flushed/invalidated when an AS is recycled Boris Brezillon @ 2025-12-02 13:35 ` Boris Brezillon 2025-12-02 14:28 ` Liviu Dudau 2025-12-02 15:09 ` Akash Goel 2025-12-02 23:30 ` [PATCH v1 0/3] drm/panthor: Fix regressions introduced recently Chia-I Wu 3 siblings, 2 replies; 10+ messages in thread From: Boris Brezillon @ 2025-12-02 13:35 UTC (permalink / raw) To: Boris Brezillon, Steven Price, Liviu Dudau, Adrián Larumbe Cc: dri-devel, Akash Goel, kernel An AS can be disabled in the middle of a VM operation (VM being evicted from an AS slot, for instance). In that case, we need the locked section to be unlocked before releasing the slot. Fixes: 6e2d3b3e8589 ("drm/panthor: Add support for atomic page table updates") Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> --- drivers/gpu/drm/panthor/panthor_mmu.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/panthor/panthor_mmu.c b/drivers/gpu/drm/panthor/panthor_mmu.c index 3644af1a8e56..4ed28bd1b8ec 100644 --- a/drivers/gpu/drm/panthor/panthor_mmu.c +++ b/drivers/gpu/drm/panthor/panthor_mmu.c @@ -588,6 +588,7 @@ static int panthor_mmu_as_enable(struct panthor_device *ptdev, u32 as_nr, static int panthor_mmu_as_disable(struct panthor_device *ptdev, u32 as_nr, bool recycle_slot) { + struct panthor_vm *vm = ptdev->mmu->as.slots[as_nr].vm; int ret; /* Flush+invalidate RW caches, invalidate RO ones. */ @@ -596,6 +597,16 @@ static int panthor_mmu_as_disable(struct panthor_device *ptdev, u32 as_nr, if (ret) return ret; + if (vm && vm->locked_region.size) { + /* Unlock the region if there a lock pending. */ + ret = as_send_cmd_and_wait(ptdev, vm->as.id, AS_COMMAND_UNLOCK); + if (ret) + return ret; + + vm->locked_region.start = 0; + vm->locked_region.size = 0; + } + /* If the slot is going to be used immediately, don't bother changing * the config. */ -- 2.51.1 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v1 3/3] drm/panthor: Unlock the locked region before disabling an AS 2025-12-02 13:35 ` [PATCH v1 3/3] drm/panthor: Unlock the locked region before disabling an AS Boris Brezillon @ 2025-12-02 14:28 ` Liviu Dudau 2025-12-02 15:09 ` Akash Goel 1 sibling, 0 replies; 10+ messages in thread From: Liviu Dudau @ 2025-12-02 14:28 UTC (permalink / raw) To: Boris Brezillon Cc: Steven Price, Adrián Larumbe, dri-devel, Akash Goel, kernel On Tue, Dec 02, 2025 at 02:35:38PM +0100, Boris Brezillon wrote: > An AS can be disabled in the middle of a VM operation (VM being > evicted from an AS slot, for instance). In that case, we need the > locked section to be unlocked before releasing the slot. > > Fixes: 6e2d3b3e8589 ("drm/panthor: Add support for atomic page table updates") > Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Best regards, Liviu > --- > drivers/gpu/drm/panthor/panthor_mmu.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/drivers/gpu/drm/panthor/panthor_mmu.c b/drivers/gpu/drm/panthor/panthor_mmu.c > index 3644af1a8e56..4ed28bd1b8ec 100644 > --- a/drivers/gpu/drm/panthor/panthor_mmu.c > +++ b/drivers/gpu/drm/panthor/panthor_mmu.c > @@ -588,6 +588,7 @@ static int panthor_mmu_as_enable(struct panthor_device *ptdev, u32 as_nr, > static int panthor_mmu_as_disable(struct panthor_device *ptdev, u32 as_nr, > bool recycle_slot) > { > + struct panthor_vm *vm = ptdev->mmu->as.slots[as_nr].vm; > int ret; > > /* Flush+invalidate RW caches, invalidate RO ones. */ > @@ -596,6 +597,16 @@ static int panthor_mmu_as_disable(struct panthor_device *ptdev, u32 as_nr, > if (ret) > return ret; > > + if (vm && vm->locked_region.size) { > + /* Unlock the region if there a lock pending. */ > + ret = as_send_cmd_and_wait(ptdev, vm->as.id, AS_COMMAND_UNLOCK); > + if (ret) > + return ret; > + > + vm->locked_region.start = 0; > + vm->locked_region.size = 0; > + } > + > /* If the slot is going to be used immediately, don't bother changing > * the config. > */ > -- > 2.51.1 > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v1 3/3] drm/panthor: Unlock the locked region before disabling an AS 2025-12-02 13:35 ` [PATCH v1 3/3] drm/panthor: Unlock the locked region before disabling an AS Boris Brezillon 2025-12-02 14:28 ` Liviu Dudau @ 2025-12-02 15:09 ` Akash Goel 2025-12-02 16:21 ` Boris Brezillon 1 sibling, 1 reply; 10+ messages in thread From: Akash Goel @ 2025-12-02 15:09 UTC (permalink / raw) To: Boris Brezillon, Steven Price, Liviu Dudau, Adrián Larumbe Cc: dri-devel, kernel, nd Hi Boris, On 12/2/25 13:35, Boris Brezillon wrote: > An AS can be disabled in the middle of a VM operation (VM being > evicted from an AS slot, for instance). In that case, we need the > locked section to be unlocked before releasing the slot. > > Fixes: 6e2d3b3e8589 ("drm/panthor: Add support for atomic page table updates") > Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> > --- > drivers/gpu/drm/panthor/panthor_mmu.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/drivers/gpu/drm/panthor/panthor_mmu.c b/drivers/gpu/drm/panthor/panthor_mmu.c > index 3644af1a8e56..4ed28bd1b8ec 100644 > --- a/drivers/gpu/drm/panthor/panthor_mmu.c > +++ b/drivers/gpu/drm/panthor/panthor_mmu.c > @@ -588,6 +588,7 @@ static int panthor_mmu_as_enable(struct panthor_device *ptdev, u32 as_nr, > static int panthor_mmu_as_disable(struct panthor_device *ptdev, u32 as_nr, > bool recycle_slot) > { > + struct panthor_vm *vm = ptdev->mmu->as.slots[as_nr].vm; > int ret; > Thanks for the fix. Please can you consider adding a lockdep_assert_held for mmu->as.slots_lock. That would in a way make it explicit that it is safe to de-reference vm pointer here. Best regards Akash > /* Flush+invalidate RW caches, invalidate RO ones. */ > @@ -596,6 +597,16 @@ static int panthor_mmu_as_disable(struct panthor_device *ptdev, u32 as_nr, > if (ret) > return ret; > > + if (vm && vm->locked_region.size) { > + /* Unlock the region if there a lock pending. */ > + ret = as_send_cmd_and_wait(ptdev, vm->as.id, AS_COMMAND_UNLOCK); > + if (ret) > + return ret; > + > + vm->locked_region.start = 0; > + vm->locked_region.size = 0; > + } > + > /* If the slot is going to be used immediately, don't bother changing > * the config. > */ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v1 3/3] drm/panthor: Unlock the locked region before disabling an AS 2025-12-02 15:09 ` Akash Goel @ 2025-12-02 16:21 ` Boris Brezillon 0 siblings, 0 replies; 10+ messages in thread From: Boris Brezillon @ 2025-12-02 16:21 UTC (permalink / raw) To: Akash Goel Cc: Steven Price, Liviu Dudau, Adrián Larumbe, dri-devel, kernel, nd On Tue, 2 Dec 2025 15:09:42 +0000 Akash Goel <akash.goel@arm.com> wrote: > Hi Boris, > > > On 12/2/25 13:35, Boris Brezillon wrote: > > An AS can be disabled in the middle of a VM operation (VM being > > evicted from an AS slot, for instance). In that case, we need the > > locked section to be unlocked before releasing the slot. > > > > Fixes: 6e2d3b3e8589 ("drm/panthor: Add support for atomic page table updates") > > Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> > > --- > > drivers/gpu/drm/panthor/panthor_mmu.c | 11 +++++++++++ > > 1 file changed, 11 insertions(+) > > > > diff --git a/drivers/gpu/drm/panthor/panthor_mmu.c b/drivers/gpu/drm/panthor/panthor_mmu.c > > index 3644af1a8e56..4ed28bd1b8ec 100644 > > --- a/drivers/gpu/drm/panthor/panthor_mmu.c > > +++ b/drivers/gpu/drm/panthor/panthor_mmu.c > > @@ -588,6 +588,7 @@ static int panthor_mmu_as_enable(struct panthor_device *ptdev, u32 as_nr, > > static int panthor_mmu_as_disable(struct panthor_device *ptdev, u32 as_nr, > > bool recycle_slot) > > { > > + struct panthor_vm *vm = ptdev->mmu->as.slots[as_nr].vm; > > int ret; > > > > Thanks for the fix. > > Please can you consider adding a lockdep_assert_held for > mmu->as.slots_lock. That would in a way make it explicit that it is safe > to de-reference vm pointer here. Sure, I can do that. > > Best regards > Akash > > > > /* Flush+invalidate RW caches, invalidate RO ones. */ > > @@ -596,6 +597,16 @@ static int panthor_mmu_as_disable(struct panthor_device *ptdev, u32 as_nr, > > if (ret) > > return ret; > > > > + if (vm && vm->locked_region.size) { > > + /* Unlock the region if there a lock pending. */ > > + ret = as_send_cmd_and_wait(ptdev, vm->as.id, AS_COMMAND_UNLOCK); > > + if (ret) > > + return ret; > > + > > + vm->locked_region.start = 0; > > + vm->locked_region.size = 0; > > + } > > + > > /* If the slot is going to be used immediately, don't bother changing > > * the config. > > */ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v1 0/3] drm/panthor: Fix regressions introduced recently 2025-12-02 13:35 [PATCH v1 0/3] drm/panthor: Fix regressions introduced recently Boris Brezillon ` (2 preceding siblings ...) 2025-12-02 13:35 ` [PATCH v1 3/3] drm/panthor: Unlock the locked region before disabling an AS Boris Brezillon @ 2025-12-02 23:30 ` Chia-I Wu 3 siblings, 0 replies; 10+ messages in thread From: Chia-I Wu @ 2025-12-02 23:30 UTC (permalink / raw) To: Boris Brezillon Cc: Steven Price, Liviu Dudau, Adrián Larumbe, dri-devel, Akash Goel, kernel On Tue, Dec 2, 2025 at 6:14 AM Boris Brezillon <boris.brezillon@collabora.com> wrote: > > Hello, > > This is a set of fixes for regressions noticed while testing the > drm-misc-next branch against mesa-ci. > > Regards, > > Boris > > Boris Brezillon (3): > drm/panthor: Drop a WARN_ON() in group_free_queue() > drm/panthor: Make sure caches are flushed/invalidated when an AS is > recycled > drm/panthor: Unlock the locked region before disabling an AS Series is Reviewed-by: Chia-I Wu <olvaffe@gmail.com> > > drivers/gpu/drm/panthor/panthor_mmu.c | 37 +++++++++++++++++++++---- > drivers/gpu/drm/panthor/panthor_sched.c | 5 ++-- > 2 files changed, 33 insertions(+), 9 deletions(-) > > -- > 2.51.1 > ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2025-12-02 23:30 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-12-02 13:35 [PATCH v1 0/3] drm/panthor: Fix regressions introduced recently Boris Brezillon 2025-12-02 13:35 ` [PATCH v1 1/3] drm/panthor: Drop a WARN_ON() in group_free_queue() Boris Brezillon 2025-12-02 14:20 ` Liviu Dudau 2025-12-02 13:35 ` [PATCH v1 2/3] drm/panthor: Make sure caches are flushed/invalidated when an AS is recycled Boris Brezillon 2025-12-02 14:21 ` Liviu Dudau 2025-12-02 13:35 ` [PATCH v1 3/3] drm/panthor: Unlock the locked region before disabling an AS Boris Brezillon 2025-12-02 14:28 ` Liviu Dudau 2025-12-02 15:09 ` Akash Goel 2025-12-02 16:21 ` Boris Brezillon 2025-12-02 23:30 ` [PATCH v1 0/3] drm/panthor: Fix regressions introduced recently Chia-I Wu
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.