Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions drivers/firmware/rp1-fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ int rp1_firmware_message(struct rp1_firmware *fw, uint16_t op,
reinit_completion(&fw->c);
ret = mbox_send_message(fw->chan, NULL);
if (ret >= 0) {
/*
* The doorbell write in rp1_send_data() is already complete by
* the time mbox_send_message() returns, so tell the mailbox
* core immediately rather than have it poll for tx-done.
*/
mbox_client_txdone(fw->chan, 0);

if (wait_for_completion_timeout(&fw->c, HZ))
ret = 0;
else
Expand Down
14 changes: 0 additions & 14 deletions drivers/mailbox/rp1-mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,22 +101,10 @@ static void rp1_shutdown(struct mbox_chan *chan)
writel(event, mbox->regs + SYSCFG_HOST_EVENT_IRQ_EN + HW_CLR_BITS);
}

static bool rp1_last_tx_done(struct mbox_chan *chan)
{
struct rp1_mbox *mbox = rp1_chan_mbox(chan);
unsigned int event = rp1_chan_event(chan);
unsigned int evs;

evs = readl(mbox->regs + SYSCFG_HOST_EVENT_IRQ);

return !(evs & event);
}

static const struct mbox_chan_ops rp1_mbox_chan_ops = {
.send_data = rp1_send_data,
.startup = rp1_startup,
.shutdown = rp1_shutdown,
.last_tx_done = rp1_last_tx_done
};

static struct mbox_chan *rp1_mbox_xlate(struct mbox_controller *mbox,
Expand Down Expand Up @@ -168,8 +156,6 @@ static int rp1_mbox_probe(struct platform_device *pdev)
if (!chans)
return -ENOMEM;

mbox->controller.txdone_poll = true;
mbox->controller.txpoll_period = 5;
mbox->controller.ops = &rp1_mbox_chan_ops;
mbox->controller.of_xlate = &rp1_mbox_xlate;
mbox->controller.dev = dev;
Expand Down
Loading