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

Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 

Último (20)

Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 

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