提交 f0cb6dbb 编写于 作者: L Lucas Stach 提交者: Zheng Zengkai

drm/etnaviv: fix MMU context leak on GPU reset

stable inclusion
from stable-5.10.68
commit 660dfbf208a4bf3eaab8560e8671be831b52e1c1
bugzilla: 182671 https://gitee.com/openeuler/kernel/issues/I4EWUH

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=660dfbf208a4bf3eaab8560e8671be831b52e1c1

--------------------------------

commit f978a530 upstream.

After a reset the GPU is no longer using the MMU context and may be
restarted with a different context. While the mmu_state proeprly was
cleared, the context wasn't unreferenced, leading to a memory leak.

Cc: stable@vger.kernel.org # 5.4
Reported-by: NMichael Walle <michael@walle.cc>
Signed-off-by: NLucas Stach <l.stach@pengutronix.de>
Tested-by: NMichael Walle <michael@walle.cc>
Tested-by: NMarek Vasut <marex@denx.de>
Reviewed-by: NChristian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 692d8e9b
...@@ -563,6 +563,8 @@ static int etnaviv_hw_reset(struct etnaviv_gpu *gpu) ...@@ -563,6 +563,8 @@ static int etnaviv_hw_reset(struct etnaviv_gpu *gpu)
gpu->fe_running = false; gpu->fe_running = false;
gpu->exec_state = -1; gpu->exec_state = -1;
if (gpu->mmu_context)
etnaviv_iommu_context_put(gpu->mmu_context);
gpu->mmu_context = NULL; gpu->mmu_context = NULL;
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册