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
149149 extern struct cpuidle_driver *cpuidle_get_driver(void);
150150 extern struct cpuidle_driver *cpuidle_driver_ref(void);
151151 extern void cpuidle_driver_unref(void);
152+extern void cpuidle_driver_state_disabled(struct cpuidle_driver *drv, int idx,
153+ bool disable);
152154 extern void cpuidle_unregister_driver(struct cpuidle_driver *drv);
153155 extern int cpuidle_register_device(struct cpuidle_device *dev);
154156 extern 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
186188 static inline struct cpuidle_driver *cpuidle_get_driver(void) {return NULL; }
187189 static inline struct cpuidle_driver *cpuidle_driver_ref(void) {return NULL; }
188190 static inline void cpuidle_driver_unref(void) {}
191+static inline void cpuidle_driver_state_disabled(struct cpuidle_driver *drv,
192+ int idx, bool disable) { }
189193 static inline void cpuidle_unregister_driver(struct cpuidle_driver *drv) { }
190194 static inline int cpuidle_register_device(struct cpuidle_device *dev)
191195 {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