RFC: QRTR wake on SMS/Call support
As far as I'm aware, QRTR modems only notify about incoming calls and SMS messages by sending indications over QMI over QRTR, there is no interrupt we can subscribe to wake a device from suspend only to handle these events.
After investigating downstream kernel code, I believe that the expected way to handle this is for the device to wake up when there is incoming data from the modem over QRTR. Userspace will then handle the data and properly notify the user if it was an SMS/call, or take appropriate action if it were some other event (not sure how quiet you can make it). It may be desirable that the device then goes back into suspend, although this particular behaviour is out of scope for ModemManager.
I submitted a patch upstream to implement support for this in the kernel, the way it's implemented there means that ModemManager would need to poke sysfs to enable waking up from suspend for incoming data from the modem, something like the following, could also be done via /sys/class/remoteproc/...
.
echo enabled > /sys/devices/platform/soc@0/4080000.remoteproc/remoteproc/remoteproc3/4080000.remoteproc:glink-edge/4080000.remoteproc:glin k-edge.IPCRTR.-1.-1/power/wakeup
I got a response to the patch suggesting that instead we support the use of EPOLLWAKEUP for QRTR in the kernel. On the MM side this would then just require adding a flag when polling on the QRTR connection that would cause the system to be woken up for incoming data in the same way.
I'd like to know if there's any preference between these two options (or other ideas?) which I can persue implementing in the kernel, and if there is interest in supporting this feature in ModemManager.
As I understand it, MM would need to perform some pre-suspend configuration to limit the number of indications from the modem, such as disabling signal strength updates. Might this require blocking suspend briefly?
We probably also want to pair this with some other software which can automatically suspend the device again if the user ignores the call/sms or if the wakeup was for some other reason, and ensuring that the display doesn't turn on unless necessary.
Cc: @dylanvanassche