drm/panfrost: Make sure a BO is only unmapped when appropriate
commit9870dc39dc53c0ab0534e1d8311a4abed7db570e
authorBoris Brezillon <boris.brezillon@collabora.com>
Tue, 18 Jun 2019 08:13:43 +0000 (18 10:13 +0200)
committerRob Herring <robh@kernel.org>
Tue, 18 Jun 2019 15:26:28 +0000 (18 09:26 -0600)
tree85bb5e5b0204b2ab35c5a49a4c42667c5aec5594
parent48eaeb7664c76139438724d520a1ea4a84a3ed92
drm/panfrost: Make sure a BO is only unmapped when appropriate

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@vger.kernel.org>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190618081343.16927-1-boris.brezillon@collabora.com
drivers/gpu/drm/panfrost/panfrost_gem.c
drivers/gpu/drm/panfrost/panfrost_gem.h
drivers/gpu/drm/panfrost/panfrost_mmu.c