Kernel suspend Logic

Source: Internet
Author: User

The code is located in power/suspend. C, starting with the pm_suspend function.

The logic of suspend and driver is mainly to traverse all devices and call the suspend function pointer of their related driver (including the suspend function pointer of the device class and bus ).

The order of device calls is as follows: when we execute device_add, these devices will be added to a dpm_list list, the device added later will appear in the front of the list. That is to say, the device added earlier will be suspend later, and the device added later will be suspend first.

Resume is the opposite. The added device will be resume first.

When suspend is a device, these function pointers are called in sequence: The power domain to which the device belongs, the type of the device, the class to which the device belongs, and the bus to which the device belongs.

 

Before the preceding logic, a call named suspend_prepare will be called. Here, freeze userspace (it will be OK if it is not schedule) will freeze workqueue with the freezable attribute. After the above logic, the kernel will go to the arch layer to continue the suspend action. Each arch is used here, and each Mach is different. In this case, we usually perform operations such as state saving, clock gate, power gate, and prepare CPU reset handler for specific hardware.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.