summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorVladimir Tsunaev <vladimirt@motorola.com>2014-06-09 13:51:48 -0400
committerVladimir Tsunaev <vladimirt@motorola.com>2014-06-09 13:51:56 -0400
commit4f375998dbe2515e83ff368411ea48daf3106e68 (patch)
treeae2ce73c06a4d946b9a2f9fd8c480e1365997f32 /kernel
parented24278545cafd0d5340fae510ec1074c144dcac (diff)
downloadolio-linux-3.10-4f375998dbe2515e83ff368411ea48daf3106e68.tar.xz
olio-linux-3.10-4f375998dbe2515e83ff368411ea48daf3106e68.zip
IKXCLOCK-1638 power: qos: Allow to use QOS API with IRQ disabled
If QOS non-auto API is called with IRQ disabled then IRQ will be enabled by cancell work function. This change allows to use QOS API in IRQ disbaled context. Change-Id: Ia60b80539b30351621e3f7c7405f8464aa705d59 Signed-off-by: Vladimir Tsunaev <vladimirt@motorola.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/power/qos.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/kernel/power/qos.c b/kernel/power/qos.c
index 587dddeebf1..f2d81c593af 100644
--- a/kernel/power/qos.c
+++ b/kernel/power/qos.c
@@ -358,8 +358,8 @@ void pm_qos_update_request(struct pm_qos_request *req,
WARN(1, KERN_ERR "pm_qos_update_request() called for unknown object\n");
return;
}
-
- cancel_delayed_work_sync(&req->work);
+ if (req->timeout_enabled)
+ cancel_delayed_work_sync(&req->work);
if (new_value != req->node.prio)
pm_qos_update_target(
@@ -369,6 +369,27 @@ void pm_qos_update_request(struct pm_qos_request *req,
EXPORT_SYMBOL_GPL(pm_qos_update_request);
/**
+ * pm_qos_add_request_timeout - inserts new qos request into the list
+ * @req: pointer to a preallocated handle
+ * @pm_qos_class: identifies which list of qos request to use
+ * @value: defines the qos request
+ *
+ * This function inserts a new entry in the pm_qos_class list of requested qos
+ * performance characteristics and allows to update this request with timeout by
+ * function pm_qos_update_request_timeout. It recomputes the aggregate QoS
+ * expectations for the pm_qos_class of parameters and initializes
+ * the pm_qos_request handle. Caller needs to save this handle for later use
+ * in updates and removal.
+ */
+
+void pm_qos_add_request_timeout(struct pm_qos_request *req, int pm_qos_class,
+ s32 value)
+{
+ req->timeout_enabled = true;
+ pm_qos_add_request(req, pm_qos_class, value);
+}
+
+/**
* pm_qos_update_request_timeout - modifies an existing qos request temporarily.
* @req : handle to list element holding a pm_qos request to use
* @new_value: defines the temporal qos request
@@ -384,6 +405,9 @@ void pm_qos_update_request_timeout(struct pm_qos_request *req, s32 new_value,
if (WARN(!pm_qos_request_active(req),
"%s called for unknown object.", __func__))
return;
+ if (WARN(!req->timeout_enabled,
+ "%s called for non-timeout request.", __func__))
+ return;
cancel_delayed_work_sync(&req->work);
@@ -414,7 +438,8 @@ void pm_qos_remove_request(struct pm_qos_request *req)
return;
}
- cancel_delayed_work_sync(&req->work);
+ if (req->timeout_enabled)
+ cancel_delayed_work_sync(&req->work);
pm_qos_update_target(pm_qos_array[req->pm_qos_class]->constraints,
&req->node, PM_QOS_REMOVE_REQ,