optee: fix tee out of memory failure seen during kexec reboot
authorAllen Pais <apais@linux.microsoft.com>
Mon, 14 Jun 2021 22:33:12 +0000 (17:33 -0500)
committerJens Wiklander <jens.wiklander@linaro.org>
Wed, 21 Jul 2021 05:39:43 +0000 (07:39 +0200)
commitf25889f93184db8b07a543cc2bbbb9a8fcaf4333
tree2112eb2eda431e545008129ef69d2d7ee1c7643e
parentadf752af454e91e123e85e3784972d166837af73
optee: fix tee out of memory failure seen during kexec reboot

The following out of memory errors are seen on kexec reboot
from the optee core.

[    0.368428] tee_bnxt_fw optee-clnt0: tee_shm_alloc failed
[    0.368461] tee_bnxt_fw: probe of optee-clnt0 failed with error -22

tee_shm_release() is not invoked on dma shm buffer.

Implement .shutdown() method to handle the release of the buffers
correctly.

More info:
https://github.com/OP-TEE/optee_os/issues/3637

Cc: stable@vger.kernel.org
Signed-off-by: Allen Pais <apais@linux.microsoft.com>
Reviewed-by: Tyler Hicks <tyhicks@linux.microsoft.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
drivers/tee/optee/core.c