linux/drivers/firmware/imx
Leonard Crestez cf0fd40445 firmware: imx: warn on unexpected RX
The imx_scu_call_rpc function returns the result inside the
same "msg" struct containing the transmitted message. This is
implemented by holding a pointer to msg (which is usually on the stack)
in sc_imx_rpc and writing to it from imx_scu_rx_callback.

This means that if the have_resp parameter is incorrect or SCU sends an
unexpected response for any reason the most likely result is kernel stack
corruption.

Fix this by only setting sc_imx_rpc.msg for the duration of the
imx_scu_call_rpc call and warning in imx_scu_rx_callback if unset.

Print the unexpected response data to help debugging.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Acked-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2019-10-06 08:58:59 +08:00
..
imx-dsp.c firmware: imx: Add DSP IPC protocol interface 2019-08-12 15:19:25 +02:00
imx-scu-irq.c firmware: imx: SCU irq should ONLY be enabled after SCU IPC is ready 2019-05-20 09:12:20 +08:00
imx-scu.c firmware: imx: warn on unexpected RX 2019-10-06 08:58:59 +08:00
Kconfig firmware: imx: Add DSP IPC protocol interface 2019-08-12 15:19:25 +02:00
Makefile firmware: imx: Add DSP IPC protocol interface 2019-08-12 15:19:25 +02:00
misc.c firmware: imx: Add support to start/stop a CPU 2019-02-11 10:00:47 +08:00
scu-pd.c firmware: imx: scu-pd: Add IRQSTR_DSP PD range 2019-07-23 15:50:09 +08:00