Merge "sched/walt: Fix invalid access of CPU cycle counter callback"
This commit is contained in:
commit
896dbc4525
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 and
|
||||
|
@ -323,14 +323,19 @@ update_window_start(struct rq *rq, u64 wallclock, int event)
|
|||
|
||||
int register_cpu_cycle_counter_cb(struct cpu_cycle_counter_cb *cb)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
mutex_lock(&cluster_lock);
|
||||
if (!cb->get_cpu_cycle_counter) {
|
||||
mutex_unlock(&cluster_lock);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
acquire_rq_locks_irqsave(cpu_possible_mask, &flags);
|
||||
cpu_cycle_counter_cb = *cb;
|
||||
use_cycle_counter = true;
|
||||
release_rq_locks_irqrestore(cpu_possible_mask, &flags);
|
||||
|
||||
mutex_unlock(&cluster_lock);
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue