linux/drivers/cpufreq
Venkatesh Pallipadi 4ec223d02f [CPUFREQ] Fix ondemand vs suspend deadlock
Rootcaused the bug to a deadlock in cpufreq and ondemand. Due to non-existent
ordering between cpu_hotplug lock and dbs_mutex. Basically a race condition
between cpu_down() and do_dbs_timer().

cpu_down() flow:
* cpu_down() call for CPU 1
* Takes hot plug lock
* Calls pre down notifier
*     cpufreq notifier handler calls cpufreq_driver_target() which takes
      cpu_hotplug lock again. OK as cpu_hotplug lock is recursive in same
      process context
* CPU 1 goes down
* Calls post down notifier
*     cpufreq notifier handler calls ondemand event stop which takes dbs_mutex

So, cpu_hotplug lock is taken before dbs_mutex in this flow.

do_dbs_timer is triggerred by a periodic timer event.
It first takes dbs_mutex and then takes cpu_hotplug lock in
cpufreq_driver_target().
Note the reverse order here compared to above. So, if this timer event happens
at right moment during cpu_down, system will deadlok.

Attached patch fixes the issue for both ondemand and conservative.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Dave Jones <davej@redhat.com>
2006-06-21 18:30:26 -04:00
..
cpufreq.c [CPUFREQ] cpufreq core {d,}printk adjustments 2006-06-04 19:47:38 -04:00
cpufreq_conservative.c [CPUFREQ] Fix ondemand vs suspend deadlock 2006-06-21 18:30:26 -04:00
cpufreq_ondemand.c [CPUFREQ] Fix ondemand vs suspend deadlock 2006-06-21 18:30:26 -04:00
cpufreq_performance.c [CPUFREQ] Lots of whitespace & CodingStyle cleanup. 2006-02-28 00:43:23 -05:00
cpufreq_powersave.c [CPUFREQ] Lots of whitespace & CodingStyle cleanup. 2006-02-28 00:43:23 -05:00
cpufreq_stats.c [CPUFREQ] CodingStyle nits in cpufreq_stats.c 2006-05-30 17:57:14 -04:00
cpufreq_userspace.c [CPUFREQ] Lots of whitespace & CodingStyle cleanup. 2006-02-28 00:43:23 -05:00
freq_table.c [CPUFREQ] Remove more freq_table reinitialisations. 2006-05-30 18:09:31 -04:00
Kconfig [CPUFREQ] Update LART site URL 2006-04-03 07:25:54 -05:00
Makefile [CPUFREQ] Conservative cpufreq governer 2005-05-31 19:03:47 -07:00