diff options
author | Arun Murthy <arun.murthy@stericsson.com> | 2011-09-08 16:56:48 +0530 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@stericsson.com> | 2012-05-22 11:07:15 +0200 |
commit | d25d3ae51f46400d791753f99c2178c602abd270 (patch) | |
tree | d0e21c55bf3c665544c3df16b44140bb2303799a /drivers/misc/mbox.c | |
parent | 06cf5b68297be444b4deda42384b921a6cf24a87 (diff) |
mbox: optimize tx path and fix bug in rx path
During tx, in the work function check for if any messages are pending to be
transmitted, if so, re-transmit. If in rx path work function is queued twice
then the work is executed only once so the other message will be lost. Hence
check if work has been queued and if so read the next message.
ST-Ericsson Linux next: NA
ST-Ericsson ID: 357703
ST-Ericsson FOSS-OUT ID: Trivial
Change-Id: I7f3a18947e36cae30da8ca391d10ed5d3ac0eb03
Signed-off-by: Arun Murthy <arun.murthy@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/31742
Reviewed-by: Bibek BASU <bibek.basu@stericsson.com>
Tested-by: Bibek BASU <bibek.basu@stericsson.com>
Diffstat (limited to 'drivers/misc/mbox.c')
-rw-r--r-- | drivers/misc/mbox.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/misc/mbox.c b/drivers/misc/mbox.c index b2810718822..5f5a457b277 100644 --- a/drivers/misc/mbox.c +++ b/drivers/misc/mbox.c @@ -348,6 +348,7 @@ static irqreturn_t mbox_irq(int irq, void *arg) if (nbr_occup == 0) goto exit; +redo: if (mbox->cb == NULL) { dev_dbg(&(mbox->pdev->dev), "No receive callback registered, " "leaving %d incoming messages in fifo!\n", nbr_occup); @@ -363,6 +364,11 @@ static irqreturn_t mbox_irq(int irq, void *arg) mbox_value); mbox->cb(mbox_value, mbox->client_data); + nbr_occup = readl(mbox->virtbase_local + MBOX_FIFO_STATUS) & 0x7; + + if (nbr_occup > 0) + goto redo; + exit: dev_dbg(&(mbox->pdev->dev), "Exit mbox IRQ. ri = %d, wi = %d\n", mbox->read_index, mbox->write_index); |