mailbox: imx: Add context save/restore for suspend/resume
authorDong Aisheng <aisheng.dong@nxp.com>
Wed, 3 Jun 2020 05:15:42 +0000 (13:15 +0800)
committerJassi Brar <jaswinder.singh@linaro.org>
Sun, 7 Jun 2020 21:11:24 +0000 (16:11 -0500)
commitba5f9fa0ca85a6137fa35efd3a1256d8bb6bc5ff
tree8a74f063e355237942802a618fbacd6a1eedc370
parentd61b7997ca467a8249d104f529194a3c6337e767
mailbox: imx: Add context save/restore for suspend/resume

For "mem" mode suspend on i.MX8 SoCs, MU settings could be
lost because its power is off, so save/restore is needed
for MU settings during suspend/resume. However, the restore
can ONLY be done when MU settings are actually lost, for the
scenario of settings NOT lost in "freeze" mode suspend, since
there could be still IPC going on multiple CPUs, restoring the
MU settings could overwrite the TIE by mistake and cause system
freeze, so need to make sure ONLY restore the MU settings when
it is powered off, Anson fixes this by checking whether restore
is actually needed when resume.

Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
drivers/mailbox/imx-mailbox.c