Jobs can be in-flight when the file descriptor is closed (either because the process did not terminate properly, or because it didn't wait for all GPU jobs to be finished), and apparently panfrost_job_close() does not cancel already running jobs. Let's refcount the MMU context object so it's lifetime is no longer bound to the FD lifetime and running jobs can finish properly without generating spurious page faults. Reported-by: Icecream95 <ixn@keemail.me> Fixes: 7282f7645d06 ("drm/panfrost: Implement per FD address spaces") Cc: <stable@vger.kernel.org> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Steven Price <steven.price@arm.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210621133907.1683899-2-boris.brezillon@collabora.com
26 lines
900 B
C
26 lines
900 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/* Copyright 2019 Linaro, Ltd, Rob Herring <robh@kernel.org> */
|
|
|
|
#ifndef __PANFROST_MMU_H__
|
|
#define __PANFROST_MMU_H__
|
|
|
|
struct panfrost_gem_mapping;
|
|
struct panfrost_file_priv;
|
|
struct panfrost_mmu;
|
|
|
|
int panfrost_mmu_map(struct panfrost_gem_mapping *mapping);
|
|
void panfrost_mmu_unmap(struct panfrost_gem_mapping *mapping);
|
|
|
|
int panfrost_mmu_init(struct panfrost_device *pfdev);
|
|
void panfrost_mmu_fini(struct panfrost_device *pfdev);
|
|
void panfrost_mmu_reset(struct panfrost_device *pfdev);
|
|
|
|
u32 panfrost_mmu_as_get(struct panfrost_device *pfdev, struct panfrost_mmu *mmu);
|
|
void panfrost_mmu_as_put(struct panfrost_device *pfdev, struct panfrost_mmu *mmu);
|
|
|
|
struct panfrost_mmu *panfrost_mmu_ctx_get(struct panfrost_mmu *mmu);
|
|
void panfrost_mmu_ctx_put(struct panfrost_mmu *mmu);
|
|
struct panfrost_mmu *panfrost_mmu_ctx_create(struct panfrost_device *pfdev);
|
|
|
|
#endif
|