History

cpuidle: Introduce cpuidle_driver_state_disabled() for driver quirks

Commit 99e98d3fb100 ("cpuidle: Consolidate disabled state checks") overlooked the fact that the imx6q and tegra20 cpuidle drivers use the "disabled" field in struct cpuidle_state for quirks which trigger after the initialization of cpuidle, so reading the initial value of that field is not sufficient for those drivers. In order to allow them to implement the quirks without using the "disabled" field in struct cpuidle_state, introduce a new helper function and modify them to use it.

Rafael J. Wysocki committed 6 years ago

Commit cbda56d1 parent 85f6a174 files · +35 −3Browse files

Showing the changes to include/linux (1 of 4 files). Show all

Unified · Split

include/linux/cpuidle.h+4−0
@@ -149,6 +149,8 @@ extern int cpuidle_register_driver(struct cpuidle_driver *drv); · 148 unmodified lines
149extern struct cpuidle_driver *cpuidle_get_driver(void);149extern struct cpuidle_driver *cpuidle_get_driver(void);
150extern struct cpuidle_driver *cpuidle_driver_ref(void);150extern struct cpuidle_driver *cpuidle_driver_ref(void);
151extern void cpuidle_driver_unref(void);151extern void cpuidle_driver_unref(void);
152extern void cpuidle_driver_state_disabled(struct cpuidle_driver *drv, int idx,
153 bool disable);
152extern void cpuidle_unregister_driver(struct cpuidle_driver *drv);154extern void cpuidle_unregister_driver(struct cpuidle_driver *drv);
153extern int cpuidle_register_device(struct cpuidle_device *dev);155extern int cpuidle_register_device(struct cpuidle_device *dev);
154extern void cpuidle_unregister_device(struct cpuidle_device *dev);156extern void cpuidle_unregister_device(struct cpuidle_device *dev);
@@ -186,6 +188,8 @@ static inline int cpuidle_register_driver(struct cpuidle_driver *drv) · 31 unmodified lines
186static inline struct cpuidle_driver *cpuidle_get_driver(void) {return NULL; }188static inline struct cpuidle_driver *cpuidle_get_driver(void) {return NULL; }
187static inline struct cpuidle_driver *cpuidle_driver_ref(void) {return NULL; }189static inline struct cpuidle_driver *cpuidle_driver_ref(void) {return NULL; }
188static inline void cpuidle_driver_unref(void) {}190static inline void cpuidle_driver_unref(void) {}
191static inline void cpuidle_driver_state_disabled(struct cpuidle_driver *drv,
192 int idx, bool disable) { }
189static inline void cpuidle_unregister_driver(struct cpuidle_driver *drv) { }193static inline void cpuidle_unregister_driver(struct cpuidle_driver *drv) { }
190static inline int cpuidle_register_device(struct cpuidle_device *dev)194static inline int cpuidle_register_device(struct cpuidle_device *dev)
191{return -ENODEV; }195{return -ENODEV; }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t