SlideShare uma empresa Scribd logo
1 de 23
Baixar para ler offline
Power Management Discussions
and Lessons Learned: Converting
legacy_pm to dev_pm_ops
Shuah Khan
Senior Linux Kernel Developer – Open Source Group
Samsung Research America (Silicon Valley)
shuah.kh@samsung.com
Agenda
●

Problem statement

●

Approach to solving the problem

●

Summary – observations and issues

●

Work done so far

●

Discussion goals

●

Q&A
Problem statement
The Linux Kernel currently supports two different methods for drivers to register
their power management interfaces.
Legacy pm_ops: still used by several drivers. Legacy pm_ops are not expandable.
dev_pm_ops: can be extended to add new interfaces as needed when new
devices with new power management capabilities get supported.
Converting drivers from using Legacy pm_ops into using the new dev_pm_ops will
allow support for Legacy pm_ops to be discontinued and allow older drivers to
support new devices that could benefit from dev_pm_ops interfaces.
Approach
●

●

Start at class and bus level
Once class and bus drivers are changed to use
dev_pm_ops, then start changing device specific drivers.
Class and bus drivers
Change class and bus drivers that implement legacy pm_ops suspend(struct
device *dev, pm_message_t state) and resume(struct device *dev)
interfaces to implement dev_pm_ops.
–

When state is not used in the suspend(), a simple change to drop
pm_message_t state from suspend() parameters and hooking
suspend() and resume() to dev->class->pm from dev->class->suspend
and dev->class->resume is sufficient. e.g: drivers/rtc/rtc-cmos.c

–

When state is used in the suspend() to differentiate between
PMSG_SUSPEND and PMSG_FREEZE, a new freeze() is needed to
handle both cases. In such cases, changing the existing suspend() to
an internal routine to be called from dev_pm_ops suspend() and
freeze() passing in the appropriate state to the internal suspend() is
the solution. e.g: drivers/pnp/driver.c
Class and bus drivers
When device specific drivers below class and bus level
implement legacy pm_ops:
–

changing class and bus suspend() and resume() to
invoke dev_pm_ops for the drivers below will allow
converting the drivers to dev_pm_ops.

–

Some device specific drivers use bus specific
suspend/resume interfaces using an abstraction layer
between the bus and device layer. In this case, there is
no reason to convert the device specific drivers to
dev_pm_ops, until such time when a device wants to
take advantage of dev_pm_ops. e.g: bcma bus, mmc
bus, isa bus.
Convert drivers
●

This step depends on the change to class and bus level
dev_pm_ops to call into driver level dev_pm_ops if exist
and look for legacy pm_ops. Without this change, driver
level dev_pm_ops will not get called.
Obsolete/remove legacy pm_ops
●

●

This step depends on converting all usages of legacy
pm_ops to dev_pm_ops.o
This will also include deleting legacy pm_ops handling
code from class/bus/platform driver suspend/resume
interfaces.
Observations
●

Inconsistent use of CONFIG_PM, CONFIG_SLEEP_PM
and CONFIG_PM_RUNTIME in driver code. In some
cases suspend and resume routines are defined in
CONFIG_PM scope and not in CONFIG_PM_SLEEP
scope. All of this leads to warning messages such as the
one in this example:
–

tpm_tis / PM: Fix unused function warning for
CONFIG_PM_SLEEP

–

http://lkml.indiana.edu/hypermail/linux/kernel/1208.1/0
0528.html
Observations
●

●

Legacy pm_ops suspend is invoked for
PM_EVENT_SUSPEND and PM_EVENT_FREEZE.
In dev_pm_ops, PM_EVENT_FREEZE case is handled
by the freeze ops. In several cases, adding a new freeze
dev_ops is necessary when converting from legacy
pm_ops to dev_pm_ops.
Observations
●

●

●

When a common routine handles suspend and freeze
cases, a writing new suspend and freeze dev_pm_ops
that call into the existing common suspend and freeze is
necessary.
freeze ops is executed only when
CONFIG_HIBERNATE_CALLBACKS is enabled.
CONFIG_HIBERNATE_CALLBACKS is enabled,
however, yet another thing that adds to the confusion to
the inconsistent use of all these PM related config
options.
Discussion goals
●

●

●

●

Increase awareness of the conversion work that is in
progress.
Discuss how to avoid further proliferation of the
inconsistent use of the various PM config options.
Discuss how to avoid new legacy pm_ops usages.
Discuss how to hook into dev_pm_ops in cases that is
not straight forward.
Progress
class drivers converted
●

rtc class - drivers/rtc/class.c

●

backlight class - drivers/video/backlight/class.c

●

led class - drivers/leds/led-class.c

●

drm class - drivers/gpu/drm/drm_sysfs.c
bus drivers
●

isa: Change driver to use dev_pm_ops infrastructure –
drivers/base/isa.c
–

the reason to update the isa bus to use dev_pm_ops
is to allow for obsoleting legacy pm_ops handling in
pm.
platform drivers converted
●

locomo – arch/arm/common/locomo.c

●

scoop – arch/arm/common/scoop.c

●

sa1111 – arch/arm/common/sa1111.c
pnp bus driver and pnp drivers
converted
●

●

●

●

●

pnp bus – drivers/pnp/driver.c
Change pnp bus pm_ops to invoke pnp driver
dev_pm_ops - drivers/pnp/driver.c
rtc: convert rtc-cmos to dev_pm_ops from legacy pm_ops
- drivers/rtc/rtc-cmos.c
tpm: Convert tpm_tis driver to use dev_pm_ops from
legacy pm_ops - drivers/char/tpm/tpm_tis.c
platform: Convert apple-gmux driver to dev_pm_ops from
legacy pm_ops - drivers/platform/x86/apple-gmux.c
mmc host platform drivers
●

●

●

●

●

mmc:au1xmmc change driver to use dev_pm_ops
infrastructure – drivers/mmc/host/au1xmmc.c
mmc:bfin_sdh change driver to use dev_pm_ops
infrastructure – drivers/mmc/host/bfin_sdh.c
mmc:cb710_mmc change driver to use dev_pm_ops
infrastructure – drivers/mmc/host/cb710-mmc.c
mmc:msmsdcc change driver to use dev_pm_ops
infrastructure – drivers/mmc/host/msm_sdcc.c
mmc:mvsdio change driver to use dev_pm_ops
infrastructure - drivers/mmc/host/mvsdio.c
mmc host platform drivers
●

●

●

mmc:omap change driver to use dev_pm_ops
infrastructure – drivers/mmc/host/omap.c
mmc:rtsx_pci_sdmmc change driver to use dev_pm_ops
infrastructure – drivers/mmc/host/rtsx_pci_sdmmc.c
mmc:tmio_mmc change driver to use dev_pm_ops
infrastructure - drivers/mmc/host/tmio_mmc.c
drivers converted
●

drivers/net/wireless/mwifiex/pcie.c
Q&A
Thank you.

Shuah Khan
Senior Open Source Developer – Open Source Group
Samsung Research America (Silicon Valley)
shuah.kh@samsung.com
Summary
●

Obsolete/remove legacy pm_ops

●

Observations

●

Observations

●

Observations

●

Discussion goals

●

class drivers converted

●

bus drivers

●

platform drivers converted

●

pnp bus driver and pnp drivers converted

●

mmc host platform drivers

●

mmc host platform drivers

●

drivers converted

●

Thank you.

Mais conteúdo relacionado

Semelhante a Linux Power Management Discussions & Lessons Learned

How to Handle your Kubernetes Upgrades
How to Handle your Kubernetes UpgradesHow to Handle your Kubernetes Upgrades
How to Handle your Kubernetes UpgradesCloudOps2005
 
Zero Downtime Schema Changes - Galera Cluster - Best Practices
Zero Downtime Schema Changes - Galera Cluster - Best PracticesZero Downtime Schema Changes - Galera Cluster - Best Practices
Zero Downtime Schema Changes - Galera Cluster - Best PracticesSeveralnines
 
LCE13: Test and Validation Summit: The future of testing at Linaro
LCE13: Test and Validation Summit: The future of testing at LinaroLCE13: Test and Validation Summit: The future of testing at Linaro
LCE13: Test and Validation Summit: The future of testing at LinaroLinaro
 
LCE13: Test and Validation Mini-Summit: Review Current Linaro Engineering Pro...
LCE13: Test and Validation Mini-Summit: Review Current Linaro Engineering Pro...LCE13: Test and Validation Mini-Summit: Review Current Linaro Engineering Pro...
LCE13: Test and Validation Mini-Summit: Review Current Linaro Engineering Pro...Linaro
 
OpenPOWER Application Optimization
OpenPOWER Application Optimization OpenPOWER Application Optimization
OpenPOWER Application Optimization Ganesan Narayanasamy
 
IBM MQ Disaster Recovery
IBM MQ Disaster RecoveryIBM MQ Disaster Recovery
IBM MQ Disaster RecoveryMarkTaylorIBM
 
M|18 Creating a Reference Architecture for High Availability at Nokia
M|18 Creating a Reference Architecture for High Availability at NokiaM|18 Creating a Reference Architecture for High Availability at Nokia
M|18 Creating a Reference Architecture for High Availability at NokiaMariaDB plc
 
Cinder project update at OpenStack Boston Summit May 2017
Cinder project update at OpenStack Boston Summit May 2017Cinder project update at OpenStack Boston Summit May 2017
Cinder project update at OpenStack Boston Summit May 2017Miroslav Halas
 
OOW15 - Getting Optimal Performance from Oracle E-Business Suite
OOW15 - Getting Optimal Performance from Oracle E-Business SuiteOOW15 - Getting Optimal Performance from Oracle E-Business Suite
OOW15 - Getting Optimal Performance from Oracle E-Business Suitevasuballa
 
Software Design for Persistent Memory Systems
Software Design for Persistent Memory SystemsSoftware Design for Persistent Memory Systems
Software Design for Persistent Memory SystemsC4Media
 
PostgreSQL for Oracle Developers and DBA's
PostgreSQL for Oracle Developers and DBA'sPostgreSQL for Oracle Developers and DBA's
PostgreSQL for Oracle Developers and DBA'sGerger
 
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...OpenShift Origin
 
Running Java Applications inside Kubernetes with Nested Container Architectur...
Running Java Applications inside Kubernetes with Nested Container Architectur...Running Java Applications inside Kubernetes with Nested Container Architectur...
Running Java Applications inside Kubernetes with Nested Container Architectur...Jelastic Multi-Cloud PaaS
 
Using Spark Mllib Models in a Production Training and Serving Platform: Exper...
Using Spark Mllib Models in a Production Training and Serving Platform: Exper...Using Spark Mllib Models in a Production Training and Serving Platform: Exper...
Using Spark Mllib Models in a Production Training and Serving Platform: Exper...Databricks
 
OOW16 - Getting Optimal Performance from Oracle E-Business Suite [CON6711]
OOW16 - Getting Optimal Performance from Oracle E-Business Suite [CON6711]OOW16 - Getting Optimal Performance from Oracle E-Business Suite [CON6711]
OOW16 - Getting Optimal Performance from Oracle E-Business Suite [CON6711]vasuballa
 

Semelhante a Linux Power Management Discussions & Lessons Learned (20)

How to Handle your Kubernetes Upgrades
How to Handle your Kubernetes UpgradesHow to Handle your Kubernetes Upgrades
How to Handle your Kubernetes Upgrades
 
Zero Downtime Schema Changes in Galera Cluster
Zero Downtime Schema Changes in Galera ClusterZero Downtime Schema Changes in Galera Cluster
Zero Downtime Schema Changes in Galera Cluster
 
Zero Downtime Schema Changes - Galera Cluster - Best Practices
Zero Downtime Schema Changes - Galera Cluster - Best PracticesZero Downtime Schema Changes - Galera Cluster - Best Practices
Zero Downtime Schema Changes - Galera Cluster - Best Practices
 
AutoDOPandRest
AutoDOPandRestAutoDOPandRest
AutoDOPandRest
 
LCE13: Test and Validation Summit: The future of testing at Linaro
LCE13: Test and Validation Summit: The future of testing at LinaroLCE13: Test and Validation Summit: The future of testing at Linaro
LCE13: Test and Validation Summit: The future of testing at Linaro
 
LCE13: Test and Validation Mini-Summit: Review Current Linaro Engineering Pro...
LCE13: Test and Validation Mini-Summit: Review Current Linaro Engineering Pro...LCE13: Test and Validation Mini-Summit: Review Current Linaro Engineering Pro...
LCE13: Test and Validation Mini-Summit: Review Current Linaro Engineering Pro...
 
OpenPOWER Application Optimization
OpenPOWER Application Optimization OpenPOWER Application Optimization
OpenPOWER Application Optimization
 
OpenPOWER Webinar
OpenPOWER Webinar OpenPOWER Webinar
OpenPOWER Webinar
 
IBM MQ Disaster Recovery
IBM MQ Disaster RecoveryIBM MQ Disaster Recovery
IBM MQ Disaster Recovery
 
M|18 Creating a Reference Architecture for High Availability at Nokia
M|18 Creating a Reference Architecture for High Availability at NokiaM|18 Creating a Reference Architecture for High Availability at Nokia
M|18 Creating a Reference Architecture for High Availability at Nokia
 
Cinder project update at OpenStack Boston Summit May 2017
Cinder project update at OpenStack Boston Summit May 2017Cinder project update at OpenStack Boston Summit May 2017
Cinder project update at OpenStack Boston Summit May 2017
 
OOW15 - Getting Optimal Performance from Oracle E-Business Suite
OOW15 - Getting Optimal Performance from Oracle E-Business SuiteOOW15 - Getting Optimal Performance from Oracle E-Business Suite
OOW15 - Getting Optimal Performance from Oracle E-Business Suite
 
R12.2 dba
R12.2 dbaR12.2 dba
R12.2 dba
 
Software Design for Persistent Memory Systems
Software Design for Persistent Memory SystemsSoftware Design for Persistent Memory Systems
Software Design for Persistent Memory Systems
 
PostgreSQL for Oracle Developers and DBA's
PostgreSQL for Oracle Developers and DBA'sPostgreSQL for Oracle Developers and DBA's
PostgreSQL for Oracle Developers and DBA's
 
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
 
Running Java Applications inside Kubernetes with Nested Container Architectur...
Running Java Applications inside Kubernetes with Nested Container Architectur...Running Java Applications inside Kubernetes with Nested Container Architectur...
Running Java Applications inside Kubernetes with Nested Container Architectur...
 
Using Spark Mllib Models in a Production Training and Serving Platform: Exper...
Using Spark Mllib Models in a Production Training and Serving Platform: Exper...Using Spark Mllib Models in a Production Training and Serving Platform: Exper...
Using Spark Mllib Models in a Production Training and Serving Platform: Exper...
 
OOW16 - Getting Optimal Performance from Oracle E-Business Suite [CON6711]
OOW16 - Getting Optimal Performance from Oracle E-Business Suite [CON6711]OOW16 - Getting Optimal Performance from Oracle E-Business Suite [CON6711]
OOW16 - Getting Optimal Performance from Oracle E-Business Suite [CON6711]
 
EMEA Airheads - Multi zone ap and centralized image upgrade
EMEA Airheads - Multi zone ap and centralized image upgradeEMEA Airheads - Multi zone ap and centralized image upgrade
EMEA Airheads - Multi zone ap and centralized image upgrade
 

Mais de Samsung Open Source Group

The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)Samsung Open Source Group
 
Rapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USBRapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USBSamsung Open Source Group
 
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT DevicesTizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT DevicesSamsung Open Source Group
 
IoTivity: Smart Home to Automotive and Beyond
IoTivity: Smart Home to Automotive and BeyondIoTivity: Smart Home to Automotive and Beyond
IoTivity: Smart Home to Automotive and BeyondSamsung Open Source Group
 
IoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorialIoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorialSamsung Open Source Group
 
Open Source Metrics to Inform Corporate Strategy
Open Source Metrics to Inform Corporate StrategyOpen Source Metrics to Inform Corporate Strategy
Open Source Metrics to Inform Corporate StrategySamsung Open Source Group
 
IoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT InteroperabilityIoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT InteroperabilitySamsung Open Source Group
 
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...Samsung Open Source Group
 
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux DeviceAdding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux DeviceSamsung Open Source Group
 
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivityIoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivitySamsung Open Source Group
 
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under LinuxPractical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under LinuxSamsung Open Source Group
 
IoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/LinuxIoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/LinuxSamsung Open Source Group
 
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of ThingsJerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of ThingsSamsung Open Source Group
 

Mais de Samsung Open Source Group (20)

The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)
 
Easy IoT with JavaScript
Easy IoT with JavaScriptEasy IoT with JavaScript
Easy IoT with JavaScript
 
Spawny: A New Approach to Logins
Spawny: A New Approach to LoginsSpawny: A New Approach to Logins
Spawny: A New Approach to Logins
 
Rapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USBRapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USB
 
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT DevicesTizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
 
IoTivity: Smart Home to Automotive and Beyond
IoTivity: Smart Home to Automotive and BeyondIoTivity: Smart Home to Automotive and Beyond
IoTivity: Smart Home to Automotive and Beyond
 
IoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorialIoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorial
 
GENIVI + OCF Cooperation
GENIVI + OCF CooperationGENIVI + OCF Cooperation
GENIVI + OCF Cooperation
 
Framework for IoT Interoperability
Framework for IoT InteroperabilityFramework for IoT Interoperability
Framework for IoT Interoperability
 
Open Source Metrics to Inform Corporate Strategy
Open Source Metrics to Inform Corporate StrategyOpen Source Metrics to Inform Corporate Strategy
Open Source Metrics to Inform Corporate Strategy
 
IoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT InteroperabilityIoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT Interoperability
 
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...
 
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux DeviceAdding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
 
IoTivity: From Devices to the Cloud
IoTivity: From Devices to the CloudIoTivity: From Devices to the Cloud
IoTivity: From Devices to the Cloud
 
SOSCON 2016 JerryScript
SOSCON 2016 JerryScriptSOSCON 2016 JerryScript
SOSCON 2016 JerryScript
 
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivityIoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
 
Run Your Own 6LoWPAN Based IoT Network
Run Your Own 6LoWPAN Based IoT NetworkRun Your Own 6LoWPAN Based IoT Network
Run Your Own 6LoWPAN Based IoT Network
 
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under LinuxPractical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
 
IoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/LinuxIoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
 
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of ThingsJerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
 

Último

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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
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
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
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
 
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
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Último (20)

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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
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
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
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
 
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...
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 

Linux Power Management Discussions & Lessons Learned

  • 1. Power Management Discussions and Lessons Learned: Converting legacy_pm to dev_pm_ops Shuah Khan Senior Linux Kernel Developer – Open Source Group Samsung Research America (Silicon Valley) shuah.kh@samsung.com
  • 2. Agenda ● Problem statement ● Approach to solving the problem ● Summary – observations and issues ● Work done so far ● Discussion goals ● Q&A
  • 3. Problem statement The Linux Kernel currently supports two different methods for drivers to register their power management interfaces. Legacy pm_ops: still used by several drivers. Legacy pm_ops are not expandable. dev_pm_ops: can be extended to add new interfaces as needed when new devices with new power management capabilities get supported. Converting drivers from using Legacy pm_ops into using the new dev_pm_ops will allow support for Legacy pm_ops to be discontinued and allow older drivers to support new devices that could benefit from dev_pm_ops interfaces.
  • 4. Approach ● ● Start at class and bus level Once class and bus drivers are changed to use dev_pm_ops, then start changing device specific drivers.
  • 5. Class and bus drivers Change class and bus drivers that implement legacy pm_ops suspend(struct device *dev, pm_message_t state) and resume(struct device *dev) interfaces to implement dev_pm_ops. – When state is not used in the suspend(), a simple change to drop pm_message_t state from suspend() parameters and hooking suspend() and resume() to dev->class->pm from dev->class->suspend and dev->class->resume is sufficient. e.g: drivers/rtc/rtc-cmos.c – When state is used in the suspend() to differentiate between PMSG_SUSPEND and PMSG_FREEZE, a new freeze() is needed to handle both cases. In such cases, changing the existing suspend() to an internal routine to be called from dev_pm_ops suspend() and freeze() passing in the appropriate state to the internal suspend() is the solution. e.g: drivers/pnp/driver.c
  • 6. Class and bus drivers When device specific drivers below class and bus level implement legacy pm_ops: – changing class and bus suspend() and resume() to invoke dev_pm_ops for the drivers below will allow converting the drivers to dev_pm_ops. – Some device specific drivers use bus specific suspend/resume interfaces using an abstraction layer between the bus and device layer. In this case, there is no reason to convert the device specific drivers to dev_pm_ops, until such time when a device wants to take advantage of dev_pm_ops. e.g: bcma bus, mmc bus, isa bus.
  • 7. Convert drivers ● This step depends on the change to class and bus level dev_pm_ops to call into driver level dev_pm_ops if exist and look for legacy pm_ops. Without this change, driver level dev_pm_ops will not get called.
  • 8. Obsolete/remove legacy pm_ops ● ● This step depends on converting all usages of legacy pm_ops to dev_pm_ops.o This will also include deleting legacy pm_ops handling code from class/bus/platform driver suspend/resume interfaces.
  • 9. Observations ● Inconsistent use of CONFIG_PM, CONFIG_SLEEP_PM and CONFIG_PM_RUNTIME in driver code. In some cases suspend and resume routines are defined in CONFIG_PM scope and not in CONFIG_PM_SLEEP scope. All of this leads to warning messages such as the one in this example: – tpm_tis / PM: Fix unused function warning for CONFIG_PM_SLEEP – http://lkml.indiana.edu/hypermail/linux/kernel/1208.1/0 0528.html
  • 10. Observations ● ● Legacy pm_ops suspend is invoked for PM_EVENT_SUSPEND and PM_EVENT_FREEZE. In dev_pm_ops, PM_EVENT_FREEZE case is handled by the freeze ops. In several cases, adding a new freeze dev_ops is necessary when converting from legacy pm_ops to dev_pm_ops.
  • 11. Observations ● ● ● When a common routine handles suspend and freeze cases, a writing new suspend and freeze dev_pm_ops that call into the existing common suspend and freeze is necessary. freeze ops is executed only when CONFIG_HIBERNATE_CALLBACKS is enabled. CONFIG_HIBERNATE_CALLBACKS is enabled, however, yet another thing that adds to the confusion to the inconsistent use of all these PM related config options.
  • 12. Discussion goals ● ● ● ● Increase awareness of the conversion work that is in progress. Discuss how to avoid further proliferation of the inconsistent use of the various PM config options. Discuss how to avoid new legacy pm_ops usages. Discuss how to hook into dev_pm_ops in cases that is not straight forward.
  • 14. class drivers converted ● rtc class - drivers/rtc/class.c ● backlight class - drivers/video/backlight/class.c ● led class - drivers/leds/led-class.c ● drm class - drivers/gpu/drm/drm_sysfs.c
  • 15. bus drivers ● isa: Change driver to use dev_pm_ops infrastructure – drivers/base/isa.c – the reason to update the isa bus to use dev_pm_ops is to allow for obsoleting legacy pm_ops handling in pm.
  • 16. platform drivers converted ● locomo – arch/arm/common/locomo.c ● scoop – arch/arm/common/scoop.c ● sa1111 – arch/arm/common/sa1111.c
  • 17. pnp bus driver and pnp drivers converted ● ● ● ● ● pnp bus – drivers/pnp/driver.c Change pnp bus pm_ops to invoke pnp driver dev_pm_ops - drivers/pnp/driver.c rtc: convert rtc-cmos to dev_pm_ops from legacy pm_ops - drivers/rtc/rtc-cmos.c tpm: Convert tpm_tis driver to use dev_pm_ops from legacy pm_ops - drivers/char/tpm/tpm_tis.c platform: Convert apple-gmux driver to dev_pm_ops from legacy pm_ops - drivers/platform/x86/apple-gmux.c
  • 18. mmc host platform drivers ● ● ● ● ● mmc:au1xmmc change driver to use dev_pm_ops infrastructure – drivers/mmc/host/au1xmmc.c mmc:bfin_sdh change driver to use dev_pm_ops infrastructure – drivers/mmc/host/bfin_sdh.c mmc:cb710_mmc change driver to use dev_pm_ops infrastructure – drivers/mmc/host/cb710-mmc.c mmc:msmsdcc change driver to use dev_pm_ops infrastructure – drivers/mmc/host/msm_sdcc.c mmc:mvsdio change driver to use dev_pm_ops infrastructure - drivers/mmc/host/mvsdio.c
  • 19. mmc host platform drivers ● ● ● mmc:omap change driver to use dev_pm_ops infrastructure – drivers/mmc/host/omap.c mmc:rtsx_pci_sdmmc change driver to use dev_pm_ops infrastructure – drivers/mmc/host/rtsx_pci_sdmmc.c mmc:tmio_mmc change driver to use dev_pm_ops infrastructure - drivers/mmc/host/tmio_mmc.c
  • 21. Q&A
  • 22. Thank you. Shuah Khan Senior Open Source Developer – Open Source Group Samsung Research America (Silicon Valley) shuah.kh@samsung.com
  • 23. Summary ● Obsolete/remove legacy pm_ops ● Observations ● Observations ● Observations ● Discussion goals ● class drivers converted ● bus drivers ● platform drivers converted ● pnp bus driver and pnp drivers converted ● mmc host platform drivers ● mmc host platform drivers ● drivers converted ● Thank you.