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

Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Skynet Technologies
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxFIDO Alliance
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfdanishmna97
 
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?Paolo Missier
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch TuesdayIvanti
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTopCSSGallery
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightSafe Software
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfSrushith Repakula
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...ScyllaDB
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftshyamraj55
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...FIDO Alliance
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingScyllaDB
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsLeah Henrickson
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe中 央社
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Patrick Viafore
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxFIDO Alliance
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!Memoori
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...panagenda
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon
 

Último (20)

Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cf
 
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development Companies
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream Processing
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 

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.