Panfrost driver fixes
Subsystems (3)
v7 cover Panfrost driver fixes
This series fixes two minor bugs in the Panfrost driver.
Changelog:
v7: - Factored out Panfrost fixes from [1] since I'll be working on
the dma-buf locking in a separate patchset now.
[1] https://lore.kernel.org/all/[email protected]/
Dmitry Osipenko (2):
drm/panfrost: Put mapping instead of shmem obj on
panfrost_mmu_map_fault_addr() error
drm/panfrost: Fix shrinker list corruption by madvise IOCTL
drivers/gpu/drm/panfrost/panfrost_drv.c | 4 ++-- drivers/gpu/drm/panfrost/panfrost_mmu.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.36.1
PATCH v7 1/2 drm/panfrost: Put mapping instead of shmem obj on panfrost_mmu_map_fault_addr() error
When panfrost_mmu_map_fault_addr() fails, the BO's mapping should be unreferenced and not the shmem object which backs the mapping.
--- drivers/gpu/drm/panfrost/panfrost_mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/panfrost/panfrost_mmu.c +1 -1
@@ -518,7 +518,7 @@ static int panfrost_mmu_map_fault_addr(struct panfrost_device *pfdev, int as, err_pages:drm_gem_shmem_put_pages (&bo->base); err_bo: -drm_gem_object_put (&bo->base.base); +panfrost_gem_mapping_put (bomapping);return ret; }
Signature · 1 line
2.36.1
PATCH v7 2/2 drm/panfrost: Fix shrinker list corruption by madvise IOCTL
In reply to Dmitry OsipenkoCalling madvise IOCTL twice on BO causes memory shrinker list corruption and crashes kernel because BO is already on the list and it's added to the list again, while BO should be removed from the list before it's re-added. Fix it.
--- drivers/gpu/drm/panfrost/panfrost_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/panfrost/panfrost_drv.c +2 -2
@@ -433,8 +433,8 @@ static int panfrost_ioctl_madvise(struct drm_device *dev, void *data,if (args->retained) {if (args->madv ==PANFROST_MADV_DONTNEED ) -list_add_tail (&bo->base.madv_list, - &pfdev->shrinker_list); +list_move_tail (&bo->base.madv_list, + &pfdev->shrinker_list);else if (args->madv ==PANFROST_MADV_WILLNEED )list_del_init (&bo->base.madv_list); }
Signature · 1 line
2.36.1
Steven Price
maintainerQuoted 9 lines · Dmitry Osipenko
This series fixes two minor bugs in the Panfrost driver.
Changelog:
v7: - Factored out Panfrost fixes from [1] since I'll be working on
the dma-buf locking in a separate patchset now.
Quoted 9 lines
Dmitry Osipenko (2):
drm/panfrost: Put mapping instead of shmem obj on
panfrost_mmu_map_fault_addr()error
drm/panfrost: Fix shrinker list corruption by madvise IOCTLdrivers/gpu/drm/panfrost/panfrost_drv.c | 4 ++-- drivers/gpu/drm/panfrost/panfrost_mmu.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
Thanks, I've pushed both to drm-misc-fixes.
Steve