SlideShare uma empresa Scribd logo
1 de 16
Baixar para ler offline
Thu 6 March, 12:10pm, Ulf Hansson
LCA14-407: Deploying runtime PM on
ARM SOCs
Deploying runtime PM on ARM SOCs
• This is yet another episode in the series of runtime PM
sessions hosted at Linaro Connects.
• You may want to recapture from Kevin Hilman’s great
presentation at LCA13. “Combining Runtime PM and
suspend/resume.”
http://www.linaro.org/documents/download/2bc49c2798620f7528f3b2be50e22d3651399dd80ba7b
Deploying runtime PM on ARM SOCs
• A condensed summary of runtime PM
• Scenarios for system PM when deploying runtime PM
• A new solution to the tricky scenarios for system PM
• Power domains and the generic power domain
Questions and comments - please!
• Why deploy runtime PM?
• To enable fine grained power management.
• Suitable for I/O devices, which are able to enter low power state when
there are no requests to serve.
• Successfully probed devices may be left unused and in full power
state. Use runtime PM to put them into low power state.
• Required to be able to maintain a centralized management of domain
regulators/clocks.
• Some history
• Runtime PM were introduced in Linux Kernel 2.6.32, Dec 2009.
• Runtime PM is today widely deployed by subsystems and drivers.
Deploying runtime PM on ARM SOCs
• Prerequisites stated by PM core for system suspend
a. At device_prepare(), the PM core temporarily prevents -
>runtime_suspend callbacks from being invoked during system
suspend. Additionally, at device_suspend_late(), it disables
runtime PM.
b. The above actions are reversed by the PM core at
device_resume_early() and at device_complete(),
respectively.
c. The sysfs interface for runtime PM, provides an option for userspace
to trigger a runtime PM resume of a device and then prevent the -
>runtime_suspend callbacks from being invoked.
d. CONFIG_PM_SLEEP and CONFIG_PM_RUNTIME selects CONFIG_PM,
but are separate kernel configs.
Deploying runtime PM on ARM SOCs
• Scenarios for subsystems/drivers at system suspend
a. A pure runtime PM centric driver uses the asynchronous runtime PM
APIs while decrementing the usage count.
b. A pure runtime PM centric driver’s device may be used by another
subsystem during system suspend.
c. A driver’s runtime PM suspend operations are a subset of the system
suspend operations. At system suspend, the driver maintain a certain
order for these operations.
d. A subsystem handles runtime PM resources, which needs to be
managed at system suspend to put the device into low power state.
e. A cross SOC driver’s device may reside in a power domain.
Deploying runtime PM on ARM SOCs
• Changes in 3.14 rc1 for PM core
• The pm_generic_runtime_suspend|resume(), used by the
platform bus, are moved to CONFIG_PM.
• SET_PM_RUNTIME_PM_OPS macro. Defines the runtime PM
callbacks for CONFIG_PM.
• SET_LATE_SYSTEM_SLEEP_PM_OPS macro.
Deploying runtime PM on ARM SOCs
• A new solution to handle system PM
To address the tricky scenarios for system PM while deploying runtime PM, don’t use
a power domain! It’s unreasonable, especially for SOCs that don’t supports domain
regulators/clocks in HW. Moreover it won’t address all the scenarios.
• Convert from the SET_RUNTIME_PM_OPS macro to the new
SET_PM_RUNTIME_PM_OPS macro.
• Let the driver invoke the ->runtime_suspend callback from some
of it’s system suspend callbacks. Respect the hierarchy of the
callbacks, to neither ignore power domains nor subsystems.
• Perform the operations with runtime PM disabled. It might be
convenient from the ->suspend_late callback, since at that point
runtime PM has been disabled by the PM core.
• Reverse the suspend actions from the driver’s respective system
resume callback.
Deploying runtime PM on ARM SOCs
• An example - a driver’s system suspend callback
my_driver_suspend()
{
pm_runtime_disable();
if (pm_runtime_status_suspended())
return 0;
if (power domain)
ret = invoke power domain’s runtime_suspend;
else
ret = invoke the subsystem’s runtime_suspend;
if (ret)
goto err;
pm_runtime_set_suspended();
return 0;
err:
pm_runtime_enable();
return ret;
}
Deploying runtime PM on ARM SOCs
• An example - a driver’s system resume callback
my_driver_resume()
{
if (power domain)
ret = invoke power domain’s runtime_resume callback;
else
ret = invoke the subsystem’s runtime_resume callback;
if (ret)
goto err;
pm_runtime_set_active();
pm_runtime_mark_last_busy();
err:
pm_runtime_enable()
return ret;
}
Deploying runtime PM on ARM SOCs
• Prevent open coding - use runtime PM helper functions
• pm_runtime_force_suspend()
• pm_runtime_force_resume()
• Optimizations
• Don’t bring back the device into full power at system resume, unless
it’s explicitly needed.
• Other issues?
Deploying runtime PM on ARM SOCs
• What about power domains?
• A group of devices shares the same regulator for powering their
silicons. Subsystem/driver maintainers requires a centralized
management of these domain regulators.
• Some SOCs have domain clocks.
• A power domain’s runtime PM callbacks are used to maintain the
usage count of the domain regulator.
• The state of the power domain could have an impact on which idle
state a CPU Idle driver could enter.
• Requires the driver that handles a device, which resides in a power
domain, to implement save and restore of register context from it’s
runtime PM callbacks.
Deploying runtime PM on ARM SOCs
• What SOCs implements power domains?
• Omap1, Keystone, Davinci - simple implementations managing
domain clocks.
• Omap2, the only current example of a full implementation. It does it’s
best, trying to handle the tricky scenarios for system PM, for a
runtime PM deployed SOC.
• SH-Mobile, Exynos, s3c64xx (soon ux500) - use the generic power
domain.
Deploying runtime PM on ARM SOCs
• The generic power domain - what’s missing!?
Consolidates the common parts for a power domain.
• We need full DT support.
• Solve probe/remove as a part of genpd.
• Make it optional to queue invokes of ->runtime_suspend
callbacks.
• Make system suspend callbacks of genpd, respect subsystems.
• Adopt to the new solution for how to handle the tricky scenarios for
system PM while deploying runtime PM.
• Some drivers need context save/restore in immediate relation to
when the power domain power goes on/off. Is this a common
problem?
• Anything else?
Deploying runtime PM on ARM SOCs
That’s it, thank you!
Deploying runtime PM on ARM SOCs
More about Linaro Connect: http://connect.linaro.org
More about Linaro: http://www.linaro.org/about/
More about Linaro engineering: http://www.linaro.org/engineering/
Linaro members: www.linaro.org/members

Mais conteúdo relacionado

Mais de Linaro

Arm Architecture HPC Workshop Santa Clara 2018 - Kanta Vekaria
Arm Architecture HPC Workshop Santa Clara 2018 - Kanta VekariaArm Architecture HPC Workshop Santa Clara 2018 - Kanta Vekaria
Arm Architecture HPC Workshop Santa Clara 2018 - Kanta VekariaLinaro
 
Huawei’s requirements for the ARM based HPC solution readiness - Joshua Mora
Huawei’s requirements for the ARM based HPC solution readiness - Joshua MoraHuawei’s requirements for the ARM based HPC solution readiness - Joshua Mora
Huawei’s requirements for the ARM based HPC solution readiness - Joshua MoraLinaro
 
Bud17 113: distribution ci using qemu and open qa
Bud17 113: distribution ci using qemu and open qaBud17 113: distribution ci using qemu and open qa
Bud17 113: distribution ci using qemu and open qaLinaro
 
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018Linaro
 
HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 2018HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 2018Linaro
 
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...Linaro
 
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...Linaro
 
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...Linaro
 
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...Linaro
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineLinaro
 
HKG18-100K1 - George Grey: Opening Keynote
HKG18-100K1 - George Grey: Opening KeynoteHKG18-100K1 - George Grey: Opening Keynote
HKG18-100K1 - George Grey: Opening KeynoteLinaro
 
HKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP WorkshopHKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP WorkshopLinaro
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineLinaro
 
HKG18-315 - Why the ecosystem is a wonderful thing, warts and all
HKG18-315 - Why the ecosystem is a wonderful thing, warts and allHKG18-315 - Why the ecosystem is a wonderful thing, warts and all
HKG18-315 - Why the ecosystem is a wonderful thing, warts and allLinaro
 
HKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse HypervisorHKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse HypervisorLinaro
 
HKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMUHKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMULinaro
 
HKG18-113- Secure Data Path work with i.MX8M
HKG18-113- Secure Data Path work with i.MX8MHKG18-113- Secure Data Path work with i.MX8M
HKG18-113- Secure Data Path work with i.MX8MLinaro
 
HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation Linaro
 
HKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted bootHKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted bootLinaro
 
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...Linaro
 

Mais de Linaro (20)

Arm Architecture HPC Workshop Santa Clara 2018 - Kanta Vekaria
Arm Architecture HPC Workshop Santa Clara 2018 - Kanta VekariaArm Architecture HPC Workshop Santa Clara 2018 - Kanta Vekaria
Arm Architecture HPC Workshop Santa Clara 2018 - Kanta Vekaria
 
Huawei’s requirements for the ARM based HPC solution readiness - Joshua Mora
Huawei’s requirements for the ARM based HPC solution readiness - Joshua MoraHuawei’s requirements for the ARM based HPC solution readiness - Joshua Mora
Huawei’s requirements for the ARM based HPC solution readiness - Joshua Mora
 
Bud17 113: distribution ci using qemu and open qa
Bud17 113: distribution ci using qemu and open qaBud17 113: distribution ci using qemu and open qa
Bud17 113: distribution ci using qemu and open qa
 
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018
 
HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 2018HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 2018
 
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...
 
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
 
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
 
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
 
HKG18-100K1 - George Grey: Opening Keynote
HKG18-100K1 - George Grey: Opening KeynoteHKG18-100K1 - George Grey: Opening Keynote
HKG18-100K1 - George Grey: Opening Keynote
 
HKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP WorkshopHKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP Workshop
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
 
HKG18-315 - Why the ecosystem is a wonderful thing, warts and all
HKG18-315 - Why the ecosystem is a wonderful thing, warts and allHKG18-315 - Why the ecosystem is a wonderful thing, warts and all
HKG18-315 - Why the ecosystem is a wonderful thing, warts and all
 
HKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse HypervisorHKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
 
HKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMUHKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMU
 
HKG18-113- Secure Data Path work with i.MX8M
HKG18-113- Secure Data Path work with i.MX8MHKG18-113- Secure Data Path work with i.MX8M
HKG18-113- Secure Data Path work with i.MX8M
 
HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation
 
HKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted bootHKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted boot
 
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...
 

Último

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Último (20)

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

LCA14: LCA14-407: Deploying Runtime PM on ARM SOCs

  • 1. Thu 6 March, 12:10pm, Ulf Hansson LCA14-407: Deploying runtime PM on ARM SOCs
  • 2. Deploying runtime PM on ARM SOCs • This is yet another episode in the series of runtime PM sessions hosted at Linaro Connects. • You may want to recapture from Kevin Hilman’s great presentation at LCA13. “Combining Runtime PM and suspend/resume.” http://www.linaro.org/documents/download/2bc49c2798620f7528f3b2be50e22d3651399dd80ba7b
  • 3. Deploying runtime PM on ARM SOCs • A condensed summary of runtime PM • Scenarios for system PM when deploying runtime PM • A new solution to the tricky scenarios for system PM • Power domains and the generic power domain Questions and comments - please!
  • 4. • Why deploy runtime PM? • To enable fine grained power management. • Suitable for I/O devices, which are able to enter low power state when there are no requests to serve. • Successfully probed devices may be left unused and in full power state. Use runtime PM to put them into low power state. • Required to be able to maintain a centralized management of domain regulators/clocks. • Some history • Runtime PM were introduced in Linux Kernel 2.6.32, Dec 2009. • Runtime PM is today widely deployed by subsystems and drivers. Deploying runtime PM on ARM SOCs
  • 5. • Prerequisites stated by PM core for system suspend a. At device_prepare(), the PM core temporarily prevents - >runtime_suspend callbacks from being invoked during system suspend. Additionally, at device_suspend_late(), it disables runtime PM. b. The above actions are reversed by the PM core at device_resume_early() and at device_complete(), respectively. c. The sysfs interface for runtime PM, provides an option for userspace to trigger a runtime PM resume of a device and then prevent the - >runtime_suspend callbacks from being invoked. d. CONFIG_PM_SLEEP and CONFIG_PM_RUNTIME selects CONFIG_PM, but are separate kernel configs. Deploying runtime PM on ARM SOCs
  • 6. • Scenarios for subsystems/drivers at system suspend a. A pure runtime PM centric driver uses the asynchronous runtime PM APIs while decrementing the usage count. b. A pure runtime PM centric driver’s device may be used by another subsystem during system suspend. c. A driver’s runtime PM suspend operations are a subset of the system suspend operations. At system suspend, the driver maintain a certain order for these operations. d. A subsystem handles runtime PM resources, which needs to be managed at system suspend to put the device into low power state. e. A cross SOC driver’s device may reside in a power domain. Deploying runtime PM on ARM SOCs
  • 7. • Changes in 3.14 rc1 for PM core • The pm_generic_runtime_suspend|resume(), used by the platform bus, are moved to CONFIG_PM. • SET_PM_RUNTIME_PM_OPS macro. Defines the runtime PM callbacks for CONFIG_PM. • SET_LATE_SYSTEM_SLEEP_PM_OPS macro. Deploying runtime PM on ARM SOCs
  • 8. • A new solution to handle system PM To address the tricky scenarios for system PM while deploying runtime PM, don’t use a power domain! It’s unreasonable, especially for SOCs that don’t supports domain regulators/clocks in HW. Moreover it won’t address all the scenarios. • Convert from the SET_RUNTIME_PM_OPS macro to the new SET_PM_RUNTIME_PM_OPS macro. • Let the driver invoke the ->runtime_suspend callback from some of it’s system suspend callbacks. Respect the hierarchy of the callbacks, to neither ignore power domains nor subsystems. • Perform the operations with runtime PM disabled. It might be convenient from the ->suspend_late callback, since at that point runtime PM has been disabled by the PM core. • Reverse the suspend actions from the driver’s respective system resume callback. Deploying runtime PM on ARM SOCs
  • 9. • An example - a driver’s system suspend callback my_driver_suspend() { pm_runtime_disable(); if (pm_runtime_status_suspended()) return 0; if (power domain) ret = invoke power domain’s runtime_suspend; else ret = invoke the subsystem’s runtime_suspend; if (ret) goto err; pm_runtime_set_suspended(); return 0; err: pm_runtime_enable(); return ret; } Deploying runtime PM on ARM SOCs
  • 10. • An example - a driver’s system resume callback my_driver_resume() { if (power domain) ret = invoke power domain’s runtime_resume callback; else ret = invoke the subsystem’s runtime_resume callback; if (ret) goto err; pm_runtime_set_active(); pm_runtime_mark_last_busy(); err: pm_runtime_enable() return ret; } Deploying runtime PM on ARM SOCs
  • 11. • Prevent open coding - use runtime PM helper functions • pm_runtime_force_suspend() • pm_runtime_force_resume() • Optimizations • Don’t bring back the device into full power at system resume, unless it’s explicitly needed. • Other issues? Deploying runtime PM on ARM SOCs
  • 12. • What about power domains? • A group of devices shares the same regulator for powering their silicons. Subsystem/driver maintainers requires a centralized management of these domain regulators. • Some SOCs have domain clocks. • A power domain’s runtime PM callbacks are used to maintain the usage count of the domain regulator. • The state of the power domain could have an impact on which idle state a CPU Idle driver could enter. • Requires the driver that handles a device, which resides in a power domain, to implement save and restore of register context from it’s runtime PM callbacks. Deploying runtime PM on ARM SOCs
  • 13. • What SOCs implements power domains? • Omap1, Keystone, Davinci - simple implementations managing domain clocks. • Omap2, the only current example of a full implementation. It does it’s best, trying to handle the tricky scenarios for system PM, for a runtime PM deployed SOC. • SH-Mobile, Exynos, s3c64xx (soon ux500) - use the generic power domain. Deploying runtime PM on ARM SOCs
  • 14. • The generic power domain - what’s missing!? Consolidates the common parts for a power domain. • We need full DT support. • Solve probe/remove as a part of genpd. • Make it optional to queue invokes of ->runtime_suspend callbacks. • Make system suspend callbacks of genpd, respect subsystems. • Adopt to the new solution for how to handle the tricky scenarios for system PM while deploying runtime PM. • Some drivers need context save/restore in immediate relation to when the power domain power goes on/off. Is this a common problem? • Anything else? Deploying runtime PM on ARM SOCs
  • 15. That’s it, thank you! Deploying runtime PM on ARM SOCs
  • 16. More about Linaro Connect: http://connect.linaro.org More about Linaro: http://www.linaro.org/about/ More about Linaro engineering: http://www.linaro.org/engineering/ Linaro members: www.linaro.org/members