diff mbox series

[2/9] backports: pm_qos: Add cpu_latency_qos_* functions

Message ID 20200420221615.14734-3-hauke@hauke-m.de (mailing list archive)
State New, archived
Headers show
Series backports: Update to version 5.7-rc2 | expand

Commit Message

Hauke Mehrtens April 20, 2020, 10:16 p.m. UTC
The upstream commit fa048c59bf1b ("PM: QoS: Add CPU latency QoS API
wrappers") add the new cpu_latency_qos_* functions. In the initial
commit they are just calling the functions from the old API. Use this
first step to backport these functions. They are used by the ath10k and
ipw2100 driver.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/pm_qos.h | 29 ++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
diff mbox series

Patch

diff --git a/backport/backport-include/linux/pm_qos.h b/backport/backport-include/linux/pm_qos.h
index d5bfc9bc..18cbbace 100644
--- a/backport/backport-include/linux/pm_qos.h
+++ b/backport/backport-include/linux/pm_qos.h
@@ -13,4 +13,33 @@ 
 #define PM_QOS_DEFAULT_VALUE -1
 #endif
 
+#if LINUX_VERSION_IS_LESS(5,7,0)
+static inline void cpu_latency_qos_add_request(struct pm_qos_request *req,
+                                              s32 value)
+{
+	pm_qos_add_request(req, PM_QOS_CPU_DMA_LATENCY, value);
+}
+
+static inline void cpu_latency_qos_update_request(struct pm_qos_request *req,
+                                                 s32 new_value)
+{
+	pm_qos_update_request(req, new_value);
+}
+
+static inline void cpu_latency_qos_remove_request(struct pm_qos_request *req)
+{
+	pm_qos_remove_request(req);
+}
+
+static inline bool cpu_latency_qos_request_active(struct pm_qos_request *req)
+{
+	return pm_qos_request_active(req);
+}
+
+static inline s32 cpu_latency_qos_limit(void)
+{
+	return pm_qos_request(PM_QOS_CPU_DMA_LATENCY);
+}
+#endif /* < 5.7 */
+
 #endif	/* _COMPAT_LINUX_PM_QOS_H */