]> git.baikalelectronics.ru Git - kernel.git/commit
drm/panfrost: Flush and disable address space when freeing page tables
authorRob Herring <robh@kernel.org>
Mon, 26 Aug 2019 22:33:16 +0000 (17:33 -0500)
committerRob Herring <robh@kernel.org>
Fri, 30 Aug 2019 14:53:41 +0000 (09:53 -0500)
commite71b0f6b639d24b87dd1e4005bf1230cc52ee3bb
tree20b656d5e096a6e82a8dfd225dbcdba1f7e4def3
parent55ad1388d69a593ed69719df173e6fecf4cebaa2
drm/panfrost: Flush and disable address space when freeing page tables

Currently, page tables are freed without disabling the address space first.
This probably is fine as we'll switch to new page tables when the address
space is allocated again and runtime PM suspend will reset the GPU
clearing the registers. However, it's better to clean up after ourselves.
There is also a problem that we could be accessing the h/w in
tlb_inv_context() when suspended.

Rework the disable code to make sure we flush caches/TLBs and disable the
address space before freeing the page tables if we are not suspended. As
the tlb_inv_context() hook is only called when freeing the page tables and
we do a flush before disabling the AS, lets remove the flush from
tlb_inv_context and avoid any runtime PM issues.

Fixes: b11e1b24f72f ("drm/panfrost: Implement per FD address spaces")
Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Rob Herring <robh@kernel.org>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190826223317.28509-8-robh@kernel.org
drivers/gpu/drm/panfrost/panfrost_mmu.c