Skip to content

Commit

Permalink
Revert "drivers: base: power: wakeup.c: Use built-in RCU list checking"
Browse files Browse the repository at this point in the history
This reverts commit 8ba8880 as a better
version is already in Rafael's tree, sorry about that.

Reported-by: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
gregkh committed Mar 19, 2020
1 parent 8ba8880 commit 99917e3
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions drivers/base/power/wakeup.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,7 @@ void device_wakeup_arm_wake_irqs(void)
int srcuidx;

srcuidx = srcu_read_lock(&wakeup_srcu);
list_for_each_entry_rcu(ws, &wakeup_sources, entry,
srcu_read_lock_held(&wakeup_srcu))
list_for_each_entry_rcu(ws, &wakeup_sources, entry)
dev_pm_arm_wake_irq(ws->wakeirq);
srcu_read_unlock(&wakeup_srcu, srcuidx);
}
Expand All @@ -422,8 +421,7 @@ void device_wakeup_disarm_wake_irqs(void)
int srcuidx;

srcuidx = srcu_read_lock(&wakeup_srcu);
list_for_each_entry_rcu(ws, &wakeup_sources, entry,
srcu_read_lock_held(&wakeup_srcu))
list_for_each_entry_rcu(ws, &wakeup_sources, entry)
dev_pm_disarm_wake_irq(ws->wakeirq);
srcu_read_unlock(&wakeup_srcu, srcuidx);
}
Expand Down Expand Up @@ -876,8 +874,7 @@ void pm_print_active_wakeup_sources(void)
struct wakeup_source *last_activity_ws = NULL;

srcuidx = srcu_read_lock(&wakeup_srcu);
list_for_each_entry_rcu(ws, &wakeup_sources, entry,
srcu_read_lock_held(&wakeup_srcu)) {
list_for_each_entry_rcu(ws, &wakeup_sources, entry) {
if (ws->active) {
pm_pr_dbg("active wakeup source: %s\n", ws->name);
active = 1;
Expand Down Expand Up @@ -1028,8 +1025,7 @@ void pm_wakep_autosleep_enabled(bool set)
int srcuidx;

srcuidx = srcu_read_lock(&wakeup_srcu);
list_for_each_entry_rcu(ws, &wakeup_sources, entry,
srcu_read_lock_held(&wakeup_srcu)) {
list_for_each_entry_rcu(ws, &wakeup_sources, entry) {
spin_lock_irq(&ws->lock);
if (ws->autosleep_enabled != set) {
ws->autosleep_enabled = set;
Expand Down Expand Up @@ -1108,8 +1104,7 @@ static void *wakeup_sources_stats_seq_start(struct seq_file *m,
}

*srcuidx = srcu_read_lock(&wakeup_srcu);
list_for_each_entry_rcu(ws, &wakeup_sources, entry,
srcu_read_lock_held(&wakeup_srcu)) {
list_for_each_entry_rcu(ws, &wakeup_sources, entry) {
if (n-- <= 0)
return ws;
}
Expand Down

0 comments on commit 99917e3

Please sign in to comment.