[PATCH v2] drm/panfrost: Make sure a BO is only unmapped when appropriate
Rob Herring
robh+dt at kernel.org
Tue Jun 18 15:29:12 UTC 2019
On Tue, Jun 18, 2019 at 2:13 AM Boris Brezillon
<boris.brezillon at collabora.com> wrote:
>
> mmu_ops->unmap() will fail when called on a BO that has not been
> previously mapped, and the error path in panfrost_ioctl_create_bo()
> can call drm_gem_object_put_unlocked() (which in turn calls
> panfrost_mmu_unmap()) on a BO that has not been mapped yet.
>
> Keep track of the mapped/unmapped state to avoid such issues.
>
> Fixes: f3ba91228e8e ("drm/panfrost: Add initial panfrost driver")
> Cc: <stable at vger.kernel.org>
> Signed-off-by: Boris Brezillon <boris.brezillon at collabora.com>
> ---
> Changes in v2:
> * Check is_mapped val in the caller and add WARN_ON() in the mmu code
> (suggested by Tomeu)
> ---
> drivers/gpu/drm/panfrost/panfrost_gem.c | 3 ++-
> drivers/gpu/drm/panfrost/panfrost_gem.h | 1 +
> drivers/gpu/drm/panfrost/panfrost_mmu.c | 8 ++++++++
> 3 files changed, 11 insertions(+), 1 deletion(-)
Applied.
Rob
More information about the dri-devel
mailing list