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: <20250725150713.barg5lhqr4reoxv3@hiagonb>
Date: Fri, 25 Jul 2025 12:07:13 -0300
From: Hiago De Franco <hiagofranco@...il.com>
To: linux-remoteproc@...r.kernel.org
Cc: Bjorn Andersson <andersson@...nel.org>,
	Mathieu Poirier <mathieu.poirier@...aro.org>,
	Suman Anna <s-anna@...com>, linux-kernel@...r.kernel.org,
	Hiago De Franco <hiago.franco@...adex.com>
Subject: System can not go into suspend when remoteproc is probed on AM62X

Hello everyone,

I noticed something that I am trying to debug, maybe you have any idea
or tips to help me debugging this issue.

On AM62 and AM62P SoCs that I tested, when the remote proc driver is
probed, suspend to RAM mode does not work anymore. Without the
remote proc driver enabled, everything works just fine.

See the driver being probed with AM62 and Cortex M4:

root@...din-am62-15479173:~# dmesg | grep -i -E "remoteproc|rproc|omap-mailbox"
[   10.321304] omap-mailbox 29000000.mailbox: omap mailbox rev 0x66fc9100
[   10.518369] k3-m4-rproc 5000000.m4fss: assigned reserved memory node m4f-dma-memory@...00000
[   10.560055] k3-m4-rproc 5000000.m4fss: configured M4F for remoteproc mode
[   10.600283] remoteproc remoteproc0: 5000000.m4fss is available
[   10.615269] remoteproc remoteproc0: Direct firmware load for am62-mcu-m4f0_0-fw failed with error -2
[   10.650058] remoteproc remoteproc0: powering up 5000000.m4fss
[   10.677073] remoteproc remoteproc0: Direct firmware load for am62-mcu-m4f0_0-fw failed with error -2
[   10.696173] remoteproc remoteproc0: request_firmware failed: -2
[   11.953278] remoteproc remoteproc1: 30074000.pru is available
[   11.985475] remoteproc remoteproc2: 30078000.pru is available

And then when trying to to go into suspend:

root@...din-am62-15479173:~# echo mem > /sys/power/state
[   41.727649] PM: suspend entry (deep)
[   41.738557] Filesystems sync: 0.006 seconds
[   41.751535] Freezing user space processes
[   41.758692] Freezing user space processes completed (elapsed 0.002 seconds)
[   41.765763] OOM killer disabled.
[   41.768999] Freezing remaining freezable tasks
[   41.774858] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
[   41.782333] printk: Suspending console(s) (use no_console_suspend to debug)
[   41.830945] omap-mailbox 29000000.mailbox: fifo 1 has unexpected unread messages
[   41.830980] omap-mailbox 29000000.mailbox: PM: dpm_run_callback(): platform_pm_suspend returns -16
[   41.831013] omap-mailbox 29000000.mailbox: PM: failed to suspend: error -16
[   41.831040] PM: Some devices failed to suspend, or early wake event detected
[   41.851206] am65-cpsw-nuss 8000000.ethernet: set new flow-id-base 19
[   41.861919] am65-cpsw-nuss 8000000.ethernet end0: PHY [8000f00.mdio:00] driver [TI DP83867] (irq=354)
[   41.862921] am65-cpsw-nuss 8000000.ethernet end0: configuring for phy/rgmii-rxid link mode
[   41.868493] usb-conn-gpio connector: repeated role: device
[   42.012894] OOM killer enabled.
[   42.016050] Restarting tasks: Starting
[   42.024121] Restarting tasks: Done
[   42.033660] random: crng reseeded on system resumption
[   42.040482] PM: suspend exit

I believe the issue happens at this line:

[   41.830945] omap-mailbox 29000000.mailbox: fifo 1 has unexpected unread messages

When the remoteproc driver is probed, the omap-mailbox drivers sends a
message to Cortex-M4 which is not consumed. Please notice in this case
there is no firmware running on M4, the driver is only set to "okay"
into the DTB.

See the debug message with the message being sent ("hfranco"):

root@...din-am62-15479173:~# dmesg | grep -i -E "remoteproc|rproc|omap-mailbox|hfranco"
[   10.321304] omap-mailbox 29000000.mailbox: omap mailbox rev 0x66fc9100
[   10.518369] k3-m4-rproc 5000000.m4fss: assigned reserved memory node m4f-dma-memory@...00000
[   10.560055] k3-m4-rproc 5000000.m4fss: configured M4F for remoteproc mode
[   10.577664] hfranco: sending msg 0xffffff03, name mbox-m4-0
[   10.600283] remoteproc remoteproc0: 5000000.m4fss is available
[   10.615269] remoteproc remoteproc0: Direct firmware load for am62-mcu-m4f0_0-fw failed with error -2
[   10.650058] remoteproc remoteproc0: powering up 5000000.m4fss
[   10.677073] remoteproc remoteproc0: Direct firmware load for am62-mcu-m4f0_0-fw failed with error -2
[   10.696173] remoteproc remoteproc0: request_firmware failed: -2
[   11.953278] remoteproc remoteproc1: 30074000.pru is available
[   11.985475] remoteproc remoteproc2: 30078000.pru is available

AFAIK, the message in sent when 'send_data' callback is called inside
mailbox.c, which triggers omap_mbox_chan_send_data() from
omap-mailbox.c. If I skip this message, suspend to RAM works again, as
the mailbox will be empty.

Do you know why this message needs to be sent? Is there a way we can
overcome this issue? Commit 9f0cee984a25 ("mailbox/omap: check for any
unread messages during suspend") introduced this check.

I will be happy to send patches to address this issue.

Thanks!

Hiago.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ