Loading drivers/base/power/qos.c +3 −3 Original line number Diff line number Diff line Loading @@ -141,7 +141,7 @@ static int apply_constraint(struct dev_pm_qos_request *req, switch(req->type) { case DEV_PM_QOS_LATENCY: ret = pm_qos_update_target(&qos->latency, &req->data.pnode, ret = pm_qos_update_target(&qos->latency, &req->data.lat, action, value); if (ret) { value = pm_qos_read_value(&qos->latency); Loading Loading @@ -237,7 +237,7 @@ void dev_pm_qos_constraints_destroy(struct device *dev) /* Flush the constraints lists for the device. */ c = &qos->latency; plist_for_each_entry_safe(req, tmp, &c->list, data.pnode) { plist_for_each_entry_safe(req, tmp, &c->list, data.lat.node) { /* * Update constraints list and call the notification * callbacks if needed Loading Loading @@ -340,7 +340,7 @@ static int __dev_pm_qos_update_request(struct dev_pm_qos_request *req, switch(req->type) { case DEV_PM_QOS_LATENCY: curr_value = req->data.pnode.prio; curr_value = req->data.lat.node.prio; break; case DEV_PM_QOS_FLAGS: curr_value = req->data.flr.flags; Loading include/linux/pm_qos.h +5 −4 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ enum dev_pm_qos_req_type { struct dev_pm_qos_request { enum dev_pm_qos_req_type type; union { struct plist_node pnode; struct pm_qos_request lat; struct pm_qos_flags_request flr; } data; struct device *dev; Loading Loading @@ -105,7 +105,8 @@ static inline int dev_pm_qos_request_active(struct dev_pm_qos_request *req) return req->dev != NULL; } int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node, int pm_qos_update_target(struct pm_qos_constraints *c, struct pm_qos_request *req, enum pm_qos_req_action action, int value); bool pm_qos_update_flags(struct pm_qos_flags *pqf, struct pm_qos_flags_request *req, Loading Loading @@ -198,7 +199,7 @@ int dev_pm_qos_update_flags(struct device *dev, s32 mask, bool set); static inline s32 dev_pm_qos_requested_latency(struct device *dev) { return dev->power.qos->latency_req->data.pnode.prio; return dev->power.qos->latency_req->data.lat.node.prio; } static inline s32 dev_pm_qos_requested_flags(struct device *dev) Loading kernel/power/qos.c +9 −7 Original line number Diff line number Diff line Loading @@ -157,18 +157,20 @@ static inline void pm_qos_set_value(struct pm_qos_constraints *c, s32 value) * pm_qos_update_target - manages the constraints list and calls the notifiers * if needed * @c: constraints data struct * @node: request to add to the list, to update or to remove * @req: request to add to the list, to update or to remove * @action: action to take on the constraints list * @value: value of the request to add or update * * This function returns 1 if the aggregated constraint value has changed, 0 * otherwise. */ int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node, int pm_qos_update_target(struct pm_qos_constraints *c, struct pm_qos_request *req, enum pm_qos_req_action action, int value) { unsigned long flags; int prev_value, curr_value, new_value; struct plist_node *node = &req->node; spin_lock_irqsave(&pm_qos_lock, flags); prev_value = pm_qos_get_value(c); Loading Loading @@ -299,7 +301,7 @@ static void __pm_qos_update_request(struct pm_qos_request *req, if (new_value != req->node.prio) pm_qos_update_target( pm_qos_array[req->pm_qos_class]->constraints, &req->node, PM_QOS_UPDATE_REQ, new_value); req, PM_QOS_UPDATE_REQ, new_value); } /** Loading Loading @@ -343,7 +345,7 @@ void pm_qos_add_request(struct pm_qos_request *req, req->pm_qos_class = pm_qos_class; INIT_DELAYED_WORK(&req->work, pm_qos_work_fn); pm_qos_update_target(pm_qos_array[pm_qos_class]->constraints, &req->node, PM_QOS_ADD_REQ, value); req, PM_QOS_ADD_REQ, value); } EXPORT_SYMBOL_GPL(pm_qos_add_request); Loading Loading @@ -395,7 +397,7 @@ void pm_qos_update_request_timeout(struct pm_qos_request *req, s32 new_value, if (new_value != req->node.prio) pm_qos_update_target( pm_qos_array[req->pm_qos_class]->constraints, &req->node, PM_QOS_UPDATE_REQ, new_value); req, PM_QOS_UPDATE_REQ, new_value); schedule_delayed_work(&req->work, usecs_to_jiffies(timeout_us)); } Loading @@ -422,7 +424,7 @@ void pm_qos_remove_request(struct pm_qos_request *req) cancel_delayed_work_sync(&req->work); pm_qos_update_target(pm_qos_array[req->pm_qos_class]->constraints, &req->node, PM_QOS_REMOVE_REQ, req, PM_QOS_REMOVE_REQ, PM_QOS_DEFAULT_VALUE); memset(req, 0, sizeof(*req)); } Loading Loading
drivers/base/power/qos.c +3 −3 Original line number Diff line number Diff line Loading @@ -141,7 +141,7 @@ static int apply_constraint(struct dev_pm_qos_request *req, switch(req->type) { case DEV_PM_QOS_LATENCY: ret = pm_qos_update_target(&qos->latency, &req->data.pnode, ret = pm_qos_update_target(&qos->latency, &req->data.lat, action, value); if (ret) { value = pm_qos_read_value(&qos->latency); Loading Loading @@ -237,7 +237,7 @@ void dev_pm_qos_constraints_destroy(struct device *dev) /* Flush the constraints lists for the device. */ c = &qos->latency; plist_for_each_entry_safe(req, tmp, &c->list, data.pnode) { plist_for_each_entry_safe(req, tmp, &c->list, data.lat.node) { /* * Update constraints list and call the notification * callbacks if needed Loading Loading @@ -340,7 +340,7 @@ static int __dev_pm_qos_update_request(struct dev_pm_qos_request *req, switch(req->type) { case DEV_PM_QOS_LATENCY: curr_value = req->data.pnode.prio; curr_value = req->data.lat.node.prio; break; case DEV_PM_QOS_FLAGS: curr_value = req->data.flr.flags; Loading
include/linux/pm_qos.h +5 −4 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ enum dev_pm_qos_req_type { struct dev_pm_qos_request { enum dev_pm_qos_req_type type; union { struct plist_node pnode; struct pm_qos_request lat; struct pm_qos_flags_request flr; } data; struct device *dev; Loading Loading @@ -105,7 +105,8 @@ static inline int dev_pm_qos_request_active(struct dev_pm_qos_request *req) return req->dev != NULL; } int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node, int pm_qos_update_target(struct pm_qos_constraints *c, struct pm_qos_request *req, enum pm_qos_req_action action, int value); bool pm_qos_update_flags(struct pm_qos_flags *pqf, struct pm_qos_flags_request *req, Loading Loading @@ -198,7 +199,7 @@ int dev_pm_qos_update_flags(struct device *dev, s32 mask, bool set); static inline s32 dev_pm_qos_requested_latency(struct device *dev) { return dev->power.qos->latency_req->data.pnode.prio; return dev->power.qos->latency_req->data.lat.node.prio; } static inline s32 dev_pm_qos_requested_flags(struct device *dev) Loading
kernel/power/qos.c +9 −7 Original line number Diff line number Diff line Loading @@ -157,18 +157,20 @@ static inline void pm_qos_set_value(struct pm_qos_constraints *c, s32 value) * pm_qos_update_target - manages the constraints list and calls the notifiers * if needed * @c: constraints data struct * @node: request to add to the list, to update or to remove * @req: request to add to the list, to update or to remove * @action: action to take on the constraints list * @value: value of the request to add or update * * This function returns 1 if the aggregated constraint value has changed, 0 * otherwise. */ int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node, int pm_qos_update_target(struct pm_qos_constraints *c, struct pm_qos_request *req, enum pm_qos_req_action action, int value) { unsigned long flags; int prev_value, curr_value, new_value; struct plist_node *node = &req->node; spin_lock_irqsave(&pm_qos_lock, flags); prev_value = pm_qos_get_value(c); Loading Loading @@ -299,7 +301,7 @@ static void __pm_qos_update_request(struct pm_qos_request *req, if (new_value != req->node.prio) pm_qos_update_target( pm_qos_array[req->pm_qos_class]->constraints, &req->node, PM_QOS_UPDATE_REQ, new_value); req, PM_QOS_UPDATE_REQ, new_value); } /** Loading Loading @@ -343,7 +345,7 @@ void pm_qos_add_request(struct pm_qos_request *req, req->pm_qos_class = pm_qos_class; INIT_DELAYED_WORK(&req->work, pm_qos_work_fn); pm_qos_update_target(pm_qos_array[pm_qos_class]->constraints, &req->node, PM_QOS_ADD_REQ, value); req, PM_QOS_ADD_REQ, value); } EXPORT_SYMBOL_GPL(pm_qos_add_request); Loading Loading @@ -395,7 +397,7 @@ void pm_qos_update_request_timeout(struct pm_qos_request *req, s32 new_value, if (new_value != req->node.prio) pm_qos_update_target( pm_qos_array[req->pm_qos_class]->constraints, &req->node, PM_QOS_UPDATE_REQ, new_value); req, PM_QOS_UPDATE_REQ, new_value); schedule_delayed_work(&req->work, usecs_to_jiffies(timeout_us)); } Loading @@ -422,7 +424,7 @@ void pm_qos_remove_request(struct pm_qos_request *req) cancel_delayed_work_sync(&req->work); pm_qos_update_target(pm_qos_array[req->pm_qos_class]->constraints, &req->node, PM_QOS_REMOVE_REQ, req, PM_QOS_REMOVE_REQ, PM_QOS_DEFAULT_VALUE); memset(req, 0, sizeof(*req)); } Loading