misc: fastrpc: Avoid free of DMA buffer in interrupt context
authorThierry Escande <thierry.escande@linaro.org>
Thu, 7 Mar 2019 10:12:22 +0000 (10:12 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Mar 2019 17:09:57 +0000 (02:09 +0900)
commit8e7389c79b40ed44c855193bfb46b496ac25676f
tree05a2af592e1636b77e39a6785c6f9bddcddbc627
parent34bf9ce91e04ea6a341463f453c3e042e974a29e
misc: fastrpc: Avoid free of DMA buffer in interrupt context

When the remote DSP invocation is interrupted by the user, the
associated DMA buffer can be freed in interrupt context causing a kernel
BUG.

This patch adds a worker thread associated to the fastrpc context. It
is scheduled in the rpmsg callback to decrease its refcount out of the
interrupt context.

Fixes: c68cfb718c8f ("misc: fastrpc: Add support for context Invoke method")
Signed-off-by: Thierry Escande <thierry.escande@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/fastrpc.c