]> git.apps.os.sepia.ceph.com Git - ceph-client.git/commit
remoteproc: imx_rproc: Add support for poweroff and reboot
authorPeng Fan <peng.fan@nxp.com>
Thu, 22 Aug 2024 13:48:50 +0000 (21:48 +0800)
committerMathieu Poirier <mathieu.poirier@linaro.org>
Mon, 26 Aug 2024 16:25:15 +0000 (10:25 -0600)
commitff555fc5537db70fa75d0ca557d3a41e4c08b55c
treee3d887a30ee2f7f78583fe2c7b4ef271cf118064
parentd9dbd7149c852d51b94d5fda89d79a6c3e1fff97
remoteproc: imx_rproc: Add support for poweroff and reboot

On some NXP platforms (e.g i.MX7ULP) the poweroff and reboot operations
are done via a separate remote core.

Typically Linux needs to send a message to the remote core and requests
for poweroff or reboot.

By default the communication between Linux core and the remote core is
is done via a blocking mailbox mechanism but Linux doesn't allow blocking
operations in the system off (reboot, power off) handlers.

So, we need to make sure the mailbox message send operations do not block
for this specific operations. Fortunately, Linux allows us to register
handlers that are called in preparation of the system off operations.

Thus, before carrying the power off or reboot preparations, just destroy
the existing mailboxes and create them as non-blocking.

Note that power off and restart are totally different operations and are
not complementary.

We introduce a new flag in the imx remoteproc per device data which tells
us when a device needs this special setup. For now, only imx7ulp needs it.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20240822-imx_rproc-v3-2-6d943723945d@nxp.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
drivers/remoteproc/imx_rproc.c
drivers/remoteproc/imx_rproc.h