Skip to content

Commit

Permalink
cpufreq: governor: Avoid irq_work_queue_on() crash on non-SMP ARM
Browse files Browse the repository at this point in the history
As it turns out, irq_work_queue_on() will crash if invoked on
non-SMP ARM platforms, but in fact it is not necessary to use that
function in the cpufreq governor code (as it doesn't matter to that
code which CPU will handle the irq_work), so change it to always use
irq_work_queue().

Fixes: 8fb47ff (cpufreq: governor: Replace timers with utilization update callbacks)
Reported-and-tested-by: Guenter Roeck <[email protected]>
Reported-and-tested-by: Tony Lindgren <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
  • Loading branch information
rafaeljw committed Mar 9, 2016
1 parent a23d6d1 commit b9db427
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions drivers/cpufreq/cpufreq_governor.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,15 +350,6 @@ static void dbs_irq_work(struct irq_work *irq_work)
schedule_work(&policy_dbs->work);
}

static inline void gov_queue_irq_work(struct policy_dbs_info *policy_dbs)
{
#ifdef CONFIG_SMP
irq_work_queue_on(&policy_dbs->irq_work, smp_processor_id());
#else
irq_work_queue(&policy_dbs->irq_work);
#endif
}

static void dbs_update_util_handler(struct update_util_data *data, u64 time,
unsigned long util, unsigned long max)
{
Expand All @@ -378,7 +369,7 @@ static void dbs_update_util_handler(struct update_util_data *data, u64 time,
delta_ns = time - policy_dbs->last_sample_time;
if ((s64)delta_ns >= policy_dbs->sample_delay_ns) {
policy_dbs->last_sample_time = time;
gov_queue_irq_work(policy_dbs);
irq_work_queue(&policy_dbs->irq_work);
return;
}
}
Expand Down

0 comments on commit b9db427

Please sign in to comment.