Skip to content

Commit b5984a9

Browse files
committed
mailbox: mpfs: switch to txdone_poll
The system controller on PolarFire SoC has no interrupt to signify that the TX has been completed. The interrupt instead signals that a service requested by the mailbox client has succeeded. If a service fails, there will be no interrupt delivered. Switch to polling the busy register to determine whether transmission has completed. Fixes: 83d7b15 ("mbox: add polarfire soc system controller mailbox") Acked-by: Jassi Brar <jaswinder.singh@linaro.org> Tested-by: Valentina Fernandez <valentina.fernandezalanis@microchip.com> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
1 parent 75dfbcb commit b5984a9

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

drivers/mailbox/mailbox-mpfs.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ static bool mpfs_mbox_busy(struct mpfs_mbox *mbox)
7979
return status & SCB_STATUS_BUSY_MASK;
8080
}
8181

82+
static bool mpfs_mbox_last_tx_done(struct mbox_chan *chan)
83+
{
84+
struct mpfs_mbox *mbox = (struct mpfs_mbox *)chan->con_priv;
85+
86+
return !mpfs_mbox_busy(mbox);
87+
}
88+
8289
static int mpfs_mbox_send_data(struct mbox_chan *chan, void *data)
8390
{
8491
struct mpfs_mbox *mbox = (struct mpfs_mbox *)chan->con_priv;
@@ -183,7 +190,6 @@ static irqreturn_t mpfs_mbox_inbox_isr(int irq, void *data)
183190

184191
mpfs_mbox_rx_data(chan);
185192

186-
mbox_chan_txdone(chan, 0);
187193
return IRQ_HANDLED;
188194
}
189195

@@ -213,6 +219,7 @@ static const struct mbox_chan_ops mpfs_mbox_ops = {
213219
.send_data = mpfs_mbox_send_data,
214220
.startup = mpfs_mbox_startup,
215221
.shutdown = mpfs_mbox_shutdown,
222+
.last_tx_done = mpfs_mbox_last_tx_done,
216223
};
217224

218225
static int mpfs_mbox_probe(struct platform_device *pdev)
@@ -248,7 +255,8 @@ static int mpfs_mbox_probe(struct platform_device *pdev)
248255
mbox->controller.num_chans = 1;
249256
mbox->controller.chans = mbox->chans;
250257
mbox->controller.ops = &mpfs_mbox_ops;
251-
mbox->controller.txdone_irq = true;
258+
mbox->controller.txdone_poll = true;
259+
mbox->controller.txpoll_period = 10u;
252260

253261
ret = devm_mbox_controller_register(&pdev->dev, &mbox->controller);
254262
if (ret) {

0 commit comments

Comments
 (0)