Skip to content

Commit

Permalink
PM: QoS: Drop pm_qos_update_request_timeout()
Browse files Browse the repository at this point in the history
The pm_qos_update_request_timeout() function is not called from
anywhere, so drop it along with the work member in struct
pm_qos_request needed by it.

Also drop the useless pm_qos_update_request_timeout trace event
that is only triggered by that function (so it never triggers at
all) and update the trace events documentation accordingly.

Signed-off-by: Rafael J. Wysocki <[email protected]>
Reviewed-by: Ulf Hansson <[email protected]>
Reviewed-by: Amit Kucheria <[email protected]>
Tested-by: Amit Kucheria <[email protected]>
  • Loading branch information
rafaeljw committed Feb 13, 2020
1 parent 3489662 commit 5a7ea52
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 78 deletions.
2 changes: 0 additions & 2 deletions Documentation/trace/events-power.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,9 @@ target/flags update.
pm_qos_add_request "pm_qos_class=%s value=%d"
pm_qos_update_request "pm_qos_class=%s value=%d"
pm_qos_remove_request "pm_qos_class=%s value=%d"
pm_qos_update_request_timeout "pm_qos_class=%s value=%d, timeout_us=%ld"

The first parameter gives the QoS class name (e.g. "CPU_DMA_LATENCY").
The second parameter is value to be added/updated/removed.
The third parameter is timeout value in usec.
::

pm_qos_update_target "action=%s prev_value=%d curr_value=%d"
Expand Down
4 changes: 0 additions & 4 deletions include/linux/pm_qos.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <linux/plist.h>
#include <linux/notifier.h>
#include <linux/device.h>
#include <linux/workqueue.h>

enum {
PM_QOS_RESERVED = 0,
Expand Down Expand Up @@ -43,7 +42,6 @@ enum pm_qos_flags_status {
struct pm_qos_request {
struct plist_node node;
int pm_qos_class;
struct delayed_work work; /* for pm_qos_update_request_timeout */
};

struct pm_qos_flags_request {
Expand Down Expand Up @@ -149,8 +147,6 @@ void pm_qos_add_request(struct pm_qos_request *req, int pm_qos_class,
s32 value);
void pm_qos_update_request(struct pm_qos_request *req,
s32 new_value);
void pm_qos_update_request_timeout(struct pm_qos_request *req,
s32 new_value, unsigned long timeout_us);
void pm_qos_remove_request(struct pm_qos_request *req);

int pm_qos_request(int pm_qos_class);
Expand Down
24 changes: 0 additions & 24 deletions include/trace/events/power.h
Original file line number Diff line number Diff line change
Expand Up @@ -404,30 +404,6 @@ DEFINE_EVENT(pm_qos_request, pm_qos_remove_request,
TP_ARGS(pm_qos_class, value)
);

TRACE_EVENT(pm_qos_update_request_timeout,

TP_PROTO(int pm_qos_class, s32 value, unsigned long timeout_us),

TP_ARGS(pm_qos_class, value, timeout_us),

TP_STRUCT__entry(
__field( int, pm_qos_class )
__field( s32, value )
__field( unsigned long, timeout_us )
),

TP_fast_assign(
__entry->pm_qos_class = pm_qos_class;
__entry->value = value;
__entry->timeout_us = timeout_us;
),

TP_printk("pm_qos_class=%s value=%d, timeout_us=%ld",
__print_symbolic(__entry->pm_qos_class,
{ PM_QOS_CPU_DMA_LATENCY, "CPU_DMA_LATENCY" }),
__entry->value, __entry->timeout_us)
);

DECLARE_EVENT_CLASS(pm_qos_update,

TP_PROTO(enum pm_qos_req_action action, int prev_value, int curr_value),
Expand Down
48 changes: 0 additions & 48 deletions kernel/power/qos.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,21 +295,6 @@ static void __pm_qos_update_request(struct pm_qos_request *req,
&req->node, PM_QOS_UPDATE_REQ, new_value);
}

/**
* pm_qos_work_fn - the timeout handler of pm_qos_update_request_timeout
* @work: work struct for the delayed work (timeout)
*
* This cancels the timeout request by falling back to the default at timeout.
*/
static void pm_qos_work_fn(struct work_struct *work)
{
struct pm_qos_request *req = container_of(to_delayed_work(work),
struct pm_qos_request,
work);

__pm_qos_update_request(req, PM_QOS_DEFAULT_VALUE);
}

/**
* pm_qos_add_request - inserts new qos request into the list
* @req: pointer to a preallocated handle
Expand All @@ -334,7 +319,6 @@ void pm_qos_add_request(struct pm_qos_request *req,
return;
}
req->pm_qos_class = pm_qos_class;
INIT_DELAYED_WORK(&req->work, pm_qos_work_fn);
trace_pm_qos_add_request(pm_qos_class, value);
pm_qos_update_target(pm_qos_array[pm_qos_class]->constraints,
&req->node, PM_QOS_ADD_REQ, value);
Expand Down Expand Up @@ -362,40 +346,10 @@ void pm_qos_update_request(struct pm_qos_request *req,
return;
}

cancel_delayed_work_sync(&req->work);
__pm_qos_update_request(req, new_value);
}
EXPORT_SYMBOL_GPL(pm_qos_update_request);

/**
* 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
* @timeout_us: the effective duration of this qos request in usecs.
*
* After timeout_us, this qos request is cancelled automatically.
*/
void pm_qos_update_request_timeout(struct pm_qos_request *req, s32 new_value,
unsigned long timeout_us)
{
if (!req)
return;
if (WARN(!pm_qos_request_active(req),
"%s called for unknown object.", __func__))
return;

cancel_delayed_work_sync(&req->work);

trace_pm_qos_update_request_timeout(req->pm_qos_class,
new_value, timeout_us);
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);

schedule_delayed_work(&req->work, usecs_to_jiffies(timeout_us));
}

/**
* pm_qos_remove_request - modifies an existing qos request
* @req: handle to request list element
Expand All @@ -415,8 +369,6 @@ void pm_qos_remove_request(struct pm_qos_request *req)
return;
}

cancel_delayed_work_sync(&req->work);

trace_pm_qos_remove_request(req->pm_qos_class, PM_QOS_DEFAULT_VALUE);
pm_qos_update_target(pm_qos_array[req->pm_qos_class]->constraints,
&req->node, PM_QOS_REMOVE_REQ,
Expand Down

0 comments on commit 5a7ea52

Please sign in to comment.