summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d655dfb)
raw | patch | inline | side by side (parent: d655dfb)
author | Suman Anna <s-anna@ti.com> | |
Sat, 16 May 2015 18:13:26 +0000 (13:13 -0500) | ||
committer | Suman Anna <s-anna@ti.com> | |
Sat, 16 May 2015 23:44:28 +0000 (18:44 -0500) |
The OMAP mailbox driver is used by clients to communicate with remote
processors in general. The mailbox clients are expected to have stopped
communicating with these remote processors during a system suspend. The
OMAP mailbox fifos are expected to not have any messages as such. Add a
check for any pending unprocessed messages in the suspend callback, to
detect any communication protocol issues of the mailbox clients. The
system suspend is aborted if any messsages are found.
Signed-off-by: Suman Anna <s-anna@ti.com>
processors in general. The mailbox clients are expected to have stopped
communicating with these remote processors during a system suspend. The
OMAP mailbox fifos are expected to not have any messages as such. Add a
check for any pending unprocessed messages in the suspend callback, to
detect any communication protocol issues of the mailbox clients. The
system suspend is aborted if any messsages are found.
Signed-off-by: Suman Anna <s-anna@ti.com>
drivers/mailbox/omap-mailbox.c | patch | blob | history |
index a63b3cf4ea0b4c38a85f99bf2c0c811a94fcf5dd..5a42824766a51e2e3aa9be558b5c282675caa04f 100644 (file)
static int omap_mbox_suspend(struct device *dev)
{
struct omap_mbox_device *mdev = dev_get_drvdata(dev);
- u32 usr, reg;
+ u32 usr, fifo, reg;
if (pm_runtime_status_suspended(dev))
return 0;
+ for (fifo = 0; fifo < mdev->num_fifos; fifo++) {
+ if (mbox_read_reg(mdev, MAILBOX_MSGSTATUS(fifo))) {
+ dev_err(mdev->dev, "fifo %d has unexpected unread messages\n",
+ fifo);
+ return -EBUSY;
+ }
+ }
+
for (usr = 0; usr < mdev->num_users; usr++) {
reg = MAILBOX_IRQENABLE(mdev->intr_type, usr);
mdev->irq_ctx[usr] = mbox_read_reg(mdev, reg);