soc: apple: rtkit: Switch to atomic mailbox API
authorHector Martin <marcan@marcan.st>
Tue, 8 Feb 2022 07:58:53 +0000 (16:58 +0900)
committerHector Martin <marcan@marcan.st>
Tue, 15 Feb 2022 09:57:44 +0000 (18:57 +0900)
commit3d937ff1d9cedda2d40f9763ec889d6ca905017e
treef6beaf54c5c5be22d1bba4d2c9b54600b57c1ff0
parentdde89400ef2ddc32ad62980126a8e87f855c1946
soc: apple: rtkit: Switch to atomic mailbox API

Turns off tx_block and use the tx_done callback to implement our own
completion handling. This makes our usage of the mailbox API
atomic-safe, and using a per-message completion is also more robust.

Then, implement apple_rtkit_send_message_atomic which polls for
transmission to be complete instead of using a completion. This is
required to send RTKit messages from atomic contexts, notably the
final system shutdown message to SMC.

Signed-off-by: Hector Martin <marcan@marcan.st>
drivers/soc/apple/rtkit.c
include/linux/soc/apple/rtkit.h