1. A method comprising: responsive to detection of a state change by a secondary processor of an electronic device: sending, by the secondary processor, a wake command to a primary processor of the electronic device to activate a kernel of the primary processor without activating a user space of the primary processor; and while the user space of the primary processor is suspended, performing, by the secondary processor, a hardware operation, wherein the secondary processor performs the hardware operation at least by accessing the kernel of the primary processor and substituting for the user space of the primary processor; and after performing the hardware operation, causing the primary processor to resume a sleep mode, such that the kernel of the primary processor is suspended.