SlideShare a Scribd company logo
1 of 16
Download to read 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

More Related Content

More from 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
 

More from 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...
 

Recently uploaded

UiPath Studio Web workshop series - Day 4
UiPath Studio Web workshop series - Day 4UiPath Studio Web workshop series - Day 4
UiPath Studio Web workshop series - Day 4DianaGray10
 
Novo Nordisk's journey in developing an open-source application on Neo4j
Novo Nordisk's journey in developing an open-source application on Neo4jNovo Nordisk's journey in developing an open-source application on Neo4j
Novo Nordisk's journey in developing an open-source application on Neo4jNeo4j
 
Trailblazer Community - Flows Workshop (Session 2)
Trailblazer Community - Flows Workshop (Session 2)Trailblazer Community - Flows Workshop (Session 2)
Trailblazer Community - Flows Workshop (Session 2)Muhammad Tiham Siddiqui
 
UiPath Studio Web workshop series - Day 1
UiPath Studio Web workshop series  - Day 1UiPath Studio Web workshop series  - Day 1
UiPath Studio Web workshop series - Day 1DianaGray10
 
How to become a GDSC Lead GDSC MI AOE.pptx
How to become a GDSC Lead GDSC MI AOE.pptxHow to become a GDSC Lead GDSC MI AOE.pptx
How to become a GDSC Lead GDSC MI AOE.pptxKaustubhBhavsar6
 
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdfQ4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdfTejal81
 
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedIn
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedInOutage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedIn
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedInThousandEyes
 
Planetek Italia Srl - Corporate Profile Brochure
Planetek Italia Srl - Corporate Profile BrochurePlanetek Italia Srl - Corporate Profile Brochure
Planetek Italia Srl - Corporate Profile BrochurePlanetek Italia Srl
 
Oracle Database 23c Security New Features.pptx
Oracle Database 23c Security New Features.pptxOracle Database 23c Security New Features.pptx
Oracle Database 23c Security New Features.pptxSatishbabu Gunukula
 
CyberSecurity - Computers In Libraries 2024
CyberSecurity - Computers In Libraries 2024CyberSecurity - Computers In Libraries 2024
CyberSecurity - Computers In Libraries 2024Brian Pichman
 
AI Workshops at Computers In Libraries 2024
AI Workshops at Computers In Libraries 2024AI Workshops at Computers In Libraries 2024
AI Workshops at Computers In Libraries 2024Brian Pichman
 
Stobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through TokenizationStobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through TokenizationStobox
 
EMEA What is ThousandEyes? Webinar
EMEA What is ThousandEyes? WebinarEMEA What is ThousandEyes? Webinar
EMEA What is ThousandEyes? WebinarThousandEyes
 
Patch notes explaining DISARM Version 1.4 update
Patch notes explaining DISARM Version 1.4 updatePatch notes explaining DISARM Version 1.4 update
Patch notes explaining DISARM Version 1.4 updateadam112203
 
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptxEmil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptxNeo4j
 
How to release an Open Source Dataweave Library
How to release an Open Source Dataweave LibraryHow to release an Open Source Dataweave Library
How to release an Open Source Dataweave Libraryshyamraj55
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
 
Introduction to RAG (Retrieval Augmented Generation) and its application
Introduction to RAG (Retrieval Augmented Generation) and its applicationIntroduction to RAG (Retrieval Augmented Generation) and its application
Introduction to RAG (Retrieval Augmented Generation) and its applicationKnoldus Inc.
 
TrustArc Webinar - How to Live in a Post Third-Party Cookie World
TrustArc Webinar - How to Live in a Post Third-Party Cookie WorldTrustArc Webinar - How to Live in a Post Third-Party Cookie World
TrustArc Webinar - How to Live in a Post Third-Party Cookie WorldTrustArc
 
The New Cloud World Order Is FinOps (Slideshow)
The New Cloud World Order Is FinOps (Slideshow)The New Cloud World Order Is FinOps (Slideshow)
The New Cloud World Order Is FinOps (Slideshow)codyslingerland1
 

Recently uploaded (20)

UiPath Studio Web workshop series - Day 4
UiPath Studio Web workshop series - Day 4UiPath Studio Web workshop series - Day 4
UiPath Studio Web workshop series - Day 4
 
Novo Nordisk's journey in developing an open-source application on Neo4j
Novo Nordisk's journey in developing an open-source application on Neo4jNovo Nordisk's journey in developing an open-source application on Neo4j
Novo Nordisk's journey in developing an open-source application on Neo4j
 
Trailblazer Community - Flows Workshop (Session 2)
Trailblazer Community - Flows Workshop (Session 2)Trailblazer Community - Flows Workshop (Session 2)
Trailblazer Community - Flows Workshop (Session 2)
 
UiPath Studio Web workshop series - Day 1
UiPath Studio Web workshop series  - Day 1UiPath Studio Web workshop series  - Day 1
UiPath Studio Web workshop series - Day 1
 
How to become a GDSC Lead GDSC MI AOE.pptx
How to become a GDSC Lead GDSC MI AOE.pptxHow to become a GDSC Lead GDSC MI AOE.pptx
How to become a GDSC Lead GDSC MI AOE.pptx
 
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdfQ4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
 
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedIn
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedInOutage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedIn
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedIn
 
Planetek Italia Srl - Corporate Profile Brochure
Planetek Italia Srl - Corporate Profile BrochurePlanetek Italia Srl - Corporate Profile Brochure
Planetek Italia Srl - Corporate Profile Brochure
 
Oracle Database 23c Security New Features.pptx
Oracle Database 23c Security New Features.pptxOracle Database 23c Security New Features.pptx
Oracle Database 23c Security New Features.pptx
 
CyberSecurity - Computers In Libraries 2024
CyberSecurity - Computers In Libraries 2024CyberSecurity - Computers In Libraries 2024
CyberSecurity - Computers In Libraries 2024
 
AI Workshops at Computers In Libraries 2024
AI Workshops at Computers In Libraries 2024AI Workshops at Computers In Libraries 2024
AI Workshops at Computers In Libraries 2024
 
Stobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through TokenizationStobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
 
EMEA What is ThousandEyes? Webinar
EMEA What is ThousandEyes? WebinarEMEA What is ThousandEyes? Webinar
EMEA What is ThousandEyes? Webinar
 
Patch notes explaining DISARM Version 1.4 update
Patch notes explaining DISARM Version 1.4 updatePatch notes explaining DISARM Version 1.4 update
Patch notes explaining DISARM Version 1.4 update
 
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptxEmil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
 
How to release an Open Source Dataweave Library
How to release an Open Source Dataweave LibraryHow to release an Open Source Dataweave Library
How to release an Open Source Dataweave Library
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Introduction to RAG (Retrieval Augmented Generation) and its application
Introduction to RAG (Retrieval Augmented Generation) and its applicationIntroduction to RAG (Retrieval Augmented Generation) and its application
Introduction to RAG (Retrieval Augmented Generation) and its application
 
TrustArc Webinar - How to Live in a Post Third-Party Cookie World
TrustArc Webinar - How to Live in a Post Third-Party Cookie WorldTrustArc Webinar - How to Live in a Post Third-Party Cookie World
TrustArc Webinar - How to Live in a Post Third-Party Cookie World
 
The New Cloud World Order Is FinOps (Slideshow)
The New Cloud World Order Is FinOps (Slideshow)The New Cloud World Order Is FinOps (Slideshow)
The New Cloud World Order Is FinOps (Slideshow)
 

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