lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251022102015.1345696-1-b-padhi@ti.com>
Date: Wed, 22 Oct 2025 15:50:15 +0530
From: Beleswar Padhi <b-padhi@...com>
To: <jassisinghbrar@...il.com>, <linux-kernel@...r.kernel.org>
CC: <hiagofranco@...il.com>, <afd@...com>, <hnagalla@...com>,
        <u-kumar1@...com>, <b-padhi@...com>
Subject: [RFC PATCH] mailbox: omap-mailbox: Flush out pending msgs before entering suspend

There may be pending messages in the mailbox FIFO that are not consumed
by the remote processor for various reasons; the remote processor may
already be powered off or may be in a bad state. Instead of aborting
suspend because of these pending messages, flush the FIFOs and proceed
with suspend. Pending messages could also be restored in the resume
context, but since remote processors are typically rebooted during
suspend/resume today, there is no point in restoring stale messages.

Signed-off-by: Beleswar Padhi <b-padhi@...com>
---
 drivers/mailbox/omap-mailbox.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/mailbox/omap-mailbox.c b/drivers/mailbox/omap-mailbox.c
index 680243751d62..5e6373911630 100644
--- a/drivers/mailbox/omap-mailbox.c
+++ b/drivers/mailbox/omap-mailbox.c
@@ -341,13 +341,10 @@ static int omap_mbox_suspend(struct device *dev)
 	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;
-		}
-	}
+	/* Flush out pending mbox messages before entering suspend */
+	for (fifo = 0; fifo < mdev->num_fifos; fifo++)
+		while (mbox_read_reg(mdev, MAILBOX_MSGSTATUS(fifo)) != 0)
+			mbox_read_reg(mdev, MAILBOX_MESSAGE(fifo));
 
 	for (usr = 0; usr < mdev->num_users; usr++) {
 		reg = MAILBOX_IRQENABLE(mdev->intr_type, usr);
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ