Power management of linux driver - linux power management architecture (3)

Publisher:SereneMelodyLatest update time:2023-06-19 Source: elecfansKeywords:linux Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

 

Therefore, after the suspend_noirq (freeze_noirq, poweroff_noirq) phase, when the non-boot CPUs are shut down and the IRQs of the remaining CPUs are also shut down, the sysdev_driver.suspend phase will be started, and then Down the system goes to sleep (for hibernation the system image is created). The sequence during the resume period is: execute the sysdev_driver.resume phase, turn on the IRQ of the startup CPU, turn on other non-startup CPUs, and then start the resume_noirq phase.

 

The code that actually enters and exits system-level low-power states sometimes calls some hardware operations that only the boot firmware (bios? bootloader?) knows about, and then leaves the CPU running some software (from RAM or FLASH) to monitor the system and Manage wake-up sequences.

 

Device low power consumption (suspend) state

------------------------------------------

There is no standard for a device's low-power state. One device may only handle "on" and "off", but another device may support a dozen different versions of "on" (how many engines are activated?), and adding one can return it faster than a complete "off". to the "on" state.

 

Some buses define rules for different suspend states. PCI can give an example: after the suspend sequence is completed, a non-legacy Del PCI device cannot perform DMA or issue IRQs, and wake-up events must be signaled through the PME# bus. Several PCI standard device states are also defined, some of which are available only as options.

 

On the contrary, more integrated SOC processors often use IRQs as wake-up sources (so the driver calls enable_irq_wake()), and can use DMA completion interrupts as wake-up events (sometimes DMA can remain active, but the CPU and some peripherals enter sleep).

 

Some details here can be platform specific. In some sleep states, the system can keep some devices activated. For example, when the system is in light sleep, the LCD display will use DMA to continue refreshing. The frame buffer may even have a DSP or another non-Linux CPU to refresh, while running Linux The CPU can be in idle state.

 

Furthermore, depending on the state of the target system, some special things may happen. Some target system states may allow a lot of operational activity on the device, while other target system states may require a hard shutdown and then reinitialization upon resume. Furthermore, two different target systems can use the same device in different ways; like the LCD mentioned above, it can remain active in a "standby" state on one product but not on another using the same SOC. Products may work differently.

 

Power management notification messages

----------------------------------

Some operations cannot be performed within the power management callback methods discussed above because the callback occurs too late or too early. To handle these situations, subsystems and drivers can register for power management notifications to call an operation before the process is frozen or after it is unfrozen. Generally speaking, the PM notification mechanism is suitable for performing activities that can be utilized by user space, or at least does not interfere with user space activities.

 

For detailed instructions, please refer to the document Documentation/power/notifiers.txt.

 

runtime power management

======================

Many devices can be dynamically shut down while the system is running. This feature is particularly useful for devices that are not in use and allows the running system to save energy more efficiently. These devices usually support a range of runtime power states, such as "off", "sleep", "idle", "active", etc. These states are sometimes bounded by the bus used by the device, and often include system-level sleep. The status of the hardware used.

 

System-level power state migration can begin when some devices enter a low-power state due to rumtimepm. System sleep PM callbacks should be able to recognize this situation and reactivate them in appropriate ways, but these actions are specific to each subsystem.

 

Sometimes this will be determined at the subsystem level, sometimes it will be decided by the device driver itself. During system-level power state transitions, a suspended device can be kept in a state. In other cases, it may be temporarily suspended. Return the device to a full power state, for example to disable its ability to wake the system. These all depend on the specific hardware and subsystem design, and are issues that the driver should pay attention to.

 

When the system wakes up from sleep state, it is best to return the device to the full power state. For explanation, please refer to the document Documentation/power/runtime_pm.txt. This document has a more detailed discussion of these issues and also explains the general architecture of runtime power management.


[1] [2] [3]
Keywords:linux Reference address:Power management of linux driver - linux power management architecture (3)

Previous article:Detailed explanation of Run-time PM of power management of Linux driver (4)
Next article:Changes in power management methods in the new version of Linux system device architecture of linux driver power management

Recommended ReadingLatest update time:2024-11-16 16:49

Detailed explanation of ARM interrupt implementation in linux-2.6.26 kernel
I have read some articles on the Internet about the implementation of Linux interrupts, and I feel that some of them are very well written. I would like to thank them for their selfless contributions, and then I would like to add my understanding of some issues. Let's start with the problem of function registration.
[Microcontroller]
Video Monitoring System Designed Based on S3C2440A
  At present, embedded systems are increasingly used in video surveillance. With the powerful functions of the network, video surveillance focuses more on network monitoring solutions, which require small size, remote operation, low cost, low power consumption, and user-friendly operation interface. This system uses a
[Microcontroller]
Video Monitoring System Designed Based on S3C2440A
Magnetic Field Measurement System Based on Embedded Linux
introduction With the development of science and technology, embedded operating systems are playing an important role in more and more fields, and have become one of the symbols of product technology level. Among them, Linux is widely used in instrument measurement equipment because of its openness, multi-user, mult
[Microcontroller]
Magnetic Field Measurement System Based on Embedded Linux
Mini2440 drives LED via GPIO
The following is the source code of the driver. #includelinux/config.h//Configuration header file #includelinux/kernel.h//Used to call kmalloc and kfree #includelinux/sched.h//Scheduling, process sleep, wakeup, interrupt application, interrupt release #includelinux/timer.h/ #includelinux/init.h//Header file to be refe
[Microcontroller]
I2C bus read and write driver based on AT2402 microcontroller
//This part is the driver of AT2402 using I2C bus connection #include Function.h   // AT2402 function   //Send multi-byte data function to a sub-address device               //Function prototype: bit ISendStr(UCHAR sla,UCHAR suba,ucahr /s,UCHAR no);  //Function: From starting the bus to sending address, su
[Microcontroller]
Technical analysis of the advantages and disadvantages of electric vehicle driving methods
Compared with traditional cars, electric cars have the advantages of high energy conversion efficiency, low noise, and zero emissions. At the same time, due to the load-carrying capacity and wide speed regulation characteristics of the motor, mechanical devices such as clutches and gearboxes can be removed, simplify
[Embedded]
Technical analysis of the advantages and disadvantages of electric vehicle driving methods
New industry drivers, focusing on creating the future - 2024 Advantech AIoT Innovation Application Forum sets sail
In the face of a new round of technological revolution and industrial transformation, the widespread use of digital and intelligent technologies such as AIoT will greatly promote technological innovation and industrial upgrading, not only providing new growth points for high-quality economic growth, but also promoti
[Industrial Control]
Isolated DC/DC Converter for Gate Drive in EV Charging Systems
Electric vehicle charging systems are evolving. Current AC Level 2 wall boxes, which typically use a 400V battery charging bus voltage, are migrating to DC fast charging (DCFC) systems that require an 800V bus voltage. Wide-bandgap power devices like silicon carbide are well suited for these applications, offering l
[Embedded]
Isolated DC/DC Converter for Gate Drive in EV Charging Systems
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号