Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 226526
b: refs/heads/master
c: a42743c
h: refs/heads/master
v: v3
  • Loading branch information
Kanigeri, Hari committed Dec 2, 2010
1 parent 0a42190 commit e0b506d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ab66ac3007cb3e59fe80dfcf36aff243d3008cb9
refs/heads/master: a42743c26a53a2a5f2b2018a9659ab3fb604d5bc
9 changes: 7 additions & 2 deletions trunk/arch/arm/plat-omap/mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,20 +92,25 @@ int omap_mbox_msg_send(struct omap_mbox *mbox, mbox_msg_t msg)
struct omap_mbox_queue *mq = mbox->txq;
int ret = 0, len;

spin_lock(&mq->lock);
spin_lock_bh(&mq->lock);

if (kfifo_avail(&mq->fifo) < sizeof(msg)) {
ret = -ENOMEM;
goto out;
}

if (kfifo_is_empty(&mq->fifo) && !__mbox_poll_for_space(mbox)) {
mbox_fifo_write(mbox, msg);
goto out;
}

len = kfifo_in(&mq->fifo, (unsigned char *)&msg, sizeof(msg));
WARN_ON(len != sizeof(msg));

tasklet_schedule(&mbox->txq->tasklet);

out:
spin_unlock(&mq->lock);
spin_unlock_bh(&mq->lock);
return ret;
}
EXPORT_SYMBOL(omap_mbox_msg_send);
Expand Down

0 comments on commit e0b506d

Please sign in to comment.