mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 18:09:56 +00:00
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: 83d7b15608 ("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>
This commit is contained in:
@@ -79,6 +79,13 @@ static bool mpfs_mbox_busy(struct mpfs_mbox *mbox)
|
|||||||
return status & SCB_STATUS_BUSY_MASK;
|
return status & SCB_STATUS_BUSY_MASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool mpfs_mbox_last_tx_done(struct mbox_chan *chan)
|
||||||
|
{
|
||||||
|
struct mpfs_mbox *mbox = (struct mpfs_mbox *)chan->con_priv;
|
||||||
|
|
||||||
|
return !mpfs_mbox_busy(mbox);
|
||||||
|
}
|
||||||
|
|
||||||
static int mpfs_mbox_send_data(struct mbox_chan *chan, void *data)
|
static int mpfs_mbox_send_data(struct mbox_chan *chan, void *data)
|
||||||
{
|
{
|
||||||
struct mpfs_mbox *mbox = (struct mpfs_mbox *)chan->con_priv;
|
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)
|
|||||||
|
|
||||||
mpfs_mbox_rx_data(chan);
|
mpfs_mbox_rx_data(chan);
|
||||||
|
|
||||||
mbox_chan_txdone(chan, 0);
|
|
||||||
return IRQ_HANDLED;
|
return IRQ_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -213,6 +219,7 @@ static const struct mbox_chan_ops mpfs_mbox_ops = {
|
|||||||
.send_data = mpfs_mbox_send_data,
|
.send_data = mpfs_mbox_send_data,
|
||||||
.startup = mpfs_mbox_startup,
|
.startup = mpfs_mbox_startup,
|
||||||
.shutdown = mpfs_mbox_shutdown,
|
.shutdown = mpfs_mbox_shutdown,
|
||||||
|
.last_tx_done = mpfs_mbox_last_tx_done,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int mpfs_mbox_probe(struct platform_device *pdev)
|
static int mpfs_mbox_probe(struct platform_device *pdev)
|
||||||
@@ -248,7 +255,8 @@ static int mpfs_mbox_probe(struct platform_device *pdev)
|
|||||||
mbox->controller.num_chans = 1;
|
mbox->controller.num_chans = 1;
|
||||||
mbox->controller.chans = mbox->chans;
|
mbox->controller.chans = mbox->chans;
|
||||||
mbox->controller.ops = &mpfs_mbox_ops;
|
mbox->controller.ops = &mpfs_mbox_ops;
|
||||||
mbox->controller.txdone_irq = true;
|
mbox->controller.txdone_poll = true;
|
||||||
|
mbox->controller.txpoll_period = 10u;
|
||||||
|
|
||||||
ret = devm_mbox_controller_register(&pdev->dev, &mbox->controller);
|
ret = devm_mbox_controller_register(&pdev->dev, &mbox->controller);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
|||||||
Reference in New Issue
Block a user