mailbox: Hi3660: Fixup mailbox state machine malfunction issue
authorKevin Wangtao <kevin.wangtao@hisilicon.com>
Mon, 3 Dec 2018 03:55:09 +0000 (11:55 +0800)
committerJassi Brar <jaswinder.singh@linaro.org>
Wed, 12 Dec 2018 02:31:10 +0000 (08:01 +0530)
commit2e4ac7cc493f36e45facb921a992a145351d280c
tree56e2b6453e8227b28141ee1cb7172ffac2445097
parentb5452838c661726880652f14e20ab58efed54fa5
mailbox: Hi3660: Fixup mailbox state machine malfunction issue

Current mailbox driver of Hi3660 release the mailbox directly
before sending a new message which may cause last message lost
and next message sending doesn't take effect actually.

This patch fixs this issue by following the right progress below,
each time before sending a message, mailbox driver will check
whether the mailbox is in ready state, if last message has been
acknowledged, the mailbox driver will clear the ack state to turn
the mailbox to ready state again.

Signed-off-by: Kevin Wangtao <kevin.wangtao@hisilicon.com>
Reviewed-and-tested-by: Leo Yan <leo.yan@linaro.org>
Tested-by: Valentin Schneider <valentin.schneider@arm.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
drivers/mailbox/hi3660-mailbox.c