diff options
author | Leo Yan <leo.yan@linaro.org> | 2018-05-31 09:04:50 +0800 |
---|---|---|
committer | Daniel Lezcano <daniel.lezcano@linaro.org> | 2018-07-23 11:17:43 +0200 |
commit | 284880fcf4a85997c6bb33893e9b968a0f98d140 (patch) | |
tree | f33dfdddad040cf3d36474e9fae4b8aeb3aced6e | |
parent | c0038a9cd219557fd0708334848bd618d0809c4c (diff) |
HACK: mailbox: Hi3660: Fixup for mailbox state machine
Now we only check the mailbox state machine at the beginning of request
the channel, and later we will not run state machine code for sending
message. This results the state machine malfunction and the message
cannot be really handle from MCU side.
This patch is temporarily move the state machine operations into send
message flow.
Signed-off-by: Leo Yan <leo.yan@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
-rw-r--r-- | drivers/mailbox/hi3660-mailbox.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/drivers/mailbox/hi3660-mailbox.c b/drivers/mailbox/hi3660-mailbox.c index ae0c1feb4817..59a76d0764c2 100644 --- a/drivers/mailbox/hi3660-mailbox.c +++ b/drivers/mailbox/hi3660-mailbox.c @@ -170,8 +170,14 @@ static int hi3660_mbox_acquire_channel(struct mbox_chan *chan) return retry ? 0 : -ETIMEDOUT; } -static int hi3660_mbox_startup(struct mbox_chan *chan) +static int hi3660_mbox_send_data(struct mbox_chan *chan, void *msg) { + unsigned long ch = (unsigned long)chan->con_priv; + struct hi3660_mbox *mbox = to_hi3660_mbox(chan->mbox); + struct hi3660_chan_info *mchan = &mbox->mchan[ch]; + void __iomem *base = MBOX_BASE(mbox, ch); + u32 *buf = msg; + unsigned int i; int ret; ret = hi3660_mbox_check_state(chan); @@ -186,21 +192,8 @@ static int hi3660_mbox_startup(struct mbox_chan *chan) if (ret) return ret; - return 0; -} - -static int hi3660_mbox_send_data(struct mbox_chan *chan, void *msg) -{ - unsigned long ch = (unsigned long)chan->con_priv; - struct hi3660_mbox *mbox = to_hi3660_mbox(chan->mbox); - struct hi3660_chan_info *mchan = &mbox->mchan[ch]; - void __iomem *base = MBOX_BASE(mbox, ch); - u32 *buf = msg; - unsigned int i; - /* Ensure channel is released */ writel_relaxed(0xffffffff, base + MBOX_IMASK_REG); - writel_relaxed(BIT(mchan->ack_irq), base + MBOX_SRC_REG); /* Clear mask for destination interrupt */ writel_relaxed(~BIT(mchan->dst_irq), base + MBOX_IMASK_REG); @@ -221,7 +214,6 @@ static int hi3660_mbox_send_data(struct mbox_chan *chan, void *msg) } static struct mbox_chan_ops hi3660_mbox_ops = { - .startup = hi3660_mbox_startup, .send_data = hi3660_mbox_send_data, }; |