public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* [Question] Why is there a restriction on the policy->rwsem & CPUFREQ_GOV_POLICY_EXIT ?
@ 2014-07-23 20:45 Prarit Bhargava
  2014-07-24  5:52 ` Viresh Kumar
  0 siblings, 1 reply; 2+ messages in thread
From: Prarit Bhargava @ 2014-07-23 20:45 UTC (permalink / raw)
  To: linux-pm; +Cc: rjw, viresh.kumar, Prarit Bhargava

I'm debugging a race/locking issue in the store_scaling_governor path and
came across the following restriction on using a semaphore in the
cpufreq_policy struct defined in include/linux/cpufreq.h :

         * Additional rules:
         * - Lock should not be held across
         *     __cpufreq_governor(data, CPUFREQ_GOV_POLICY_EXIT);

	struct rw_semaphore	rwsem;

I'm not completely familiar with this code and am wondering why the
restriction is in place?  Is there a worry about the module_put() in
__cpufreq_governor()?

Thanks,

P.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Question] Why is there a restriction on the policy->rwsem & CPUFREQ_GOV_POLICY_EXIT ?
  2014-07-23 20:45 [Question] Why is there a restriction on the policy->rwsem & CPUFREQ_GOV_POLICY_EXIT ? Prarit Bhargava
@ 2014-07-24  5:52 ` Viresh Kumar
  0 siblings, 0 replies; 2+ messages in thread
From: Viresh Kumar @ 2014-07-24  5:52 UTC (permalink / raw)
  To: Prarit Bhargava; +Cc: linux-pm@vger.kernel.org, Rafael J. Wysocki

On 24 July 2014 02:15, Prarit Bhargava <prarit@redhat.com> wrote:
> I'm debugging a race/locking issue in the store_scaling_governor path and
> came across the following restriction on using a semaphore in the
> cpufreq_policy struct defined in include/linux/cpufreq.h :
>
>          * Additional rules:
>          * - Lock should not be held across
>          *     __cpufreq_governor(data, CPUFREQ_GOV_POLICY_EXIT);
>
>         struct rw_semaphore     rwsem;
>
> I'm not completely familiar with this code and am wondering why the
> restriction is in place?  Is there a worry about the module_put() in
> __cpufreq_governor()?

955ef48 cpufreq: Drop rwsem lock around CPUFREQ_GOV_POLICY_EXIT

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-24  5:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-23 20:45 [Question] Why is there a restriction on the policy->rwsem & CPUFREQ_GOV_POLICY_EXIT ? Prarit Bhargava
2014-07-24  5:52 ` Viresh Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox