lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53E35122.3040806@redhat.com>
Date:	Thu, 07 Aug 2014 06:12:50 -0400
From:	Prarit Bhargava <prarit@...hat.com>
To:	Viresh Kumar <viresh.kumar@...aro.org>
CC:	Stephen Boyd <sboyd@...eaurora.org>,
	Saravana Kannan <skannan@...eaurora.org>,
	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Lenny Szubowicz <lszubowi@...hat.com>,
	"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>
Subject: Re: [PATCH] cpufreq, store_scaling_governor requires policy->rwsem
 to be held for duration of changing governors [v2]



On 08/07/2014 02:36 AM, Viresh Kumar wrote:
> On 6 August 2014 20:38, Stephen Boyd <sboyd@...eaurora.org> wrote:
>> On 08/06, Prarit Bhargava wrote:
>>> Are you sure you're not seeing another lockdep warning?  That was my problem --
>>> there was an xfs related lockdep warning which then resulted in lockdep being
>>> disabled from that point on.
> 
> There is a fair chance that I might be doing something really really stupid,
> but I couldn't get the lockdep warning..
> 
>> Are we talking about the lockdep splat or the crash that started
>> this thread or something else? For the lockdep splat you need the
>> corrected patch in this thread and the per policy governor flag.
>> I'm not sure how to recreate the crash that started this thread.
> 
> We are talking about the lockdep splat that would happen if we don't
> drop locking around EXIT..
> 
> This is my full diff over mainline and my .config is attached.
> Please enlighten me on what am I missing :)

That should have done it.  What are your CPUFREQ configs?

P.

> 
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 6f02485..fa11a7d 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -2200,9 +2200,7 @@ static int cpufreq_set_policy(struct
> cpufreq_policy *policy,
>         /* end old governor */
>         if (old_gov) {
>                 __cpufreq_governor(policy, CPUFREQ_GOV_STOP);
> -               up_write(&policy->rwsem);
>                 __cpufreq_governor(policy, CPUFREQ_GOV_POLICY_EXIT);
> -               down_write(&policy->rwsem);
>         }
> 
>         /* start new governor */
> @@ -2211,9 +2209,7 @@ static int cpufreq_set_policy(struct
> cpufreq_policy *policy,
>                 if (!__cpufreq_governor(policy, CPUFREQ_GOV_START))
>                         goto out;
> 
> -               up_write(&policy->rwsem);
>                 __cpufreq_governor(policy, CPUFREQ_GOV_POLICY_EXIT);
> -               down_write(&policy->rwsem);
>         }
> 
>         /* new governor failed, so re-start old one */
> diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c
> index 1e0ec57..027b6f7 100644
> --- a/drivers/cpufreq/exynos-cpufreq.c
> +++ b/drivers/cpufreq/exynos-cpufreq.c
> @@ -139,7 +139,7 @@ static int exynos_cpufreq_cpu_init(struct
> cpufreq_policy *policy)
>  }
> 
>  static struct cpufreq_driver exynos_driver = {
> -       .flags          = CPUFREQ_STICKY | CPUFREQ_NEED_INITIAL_FREQ_CHECK,
> +       .flags          = CPUFREQ_STICKY |
> CPUFREQ_NEED_INITIAL_FREQ_CHECK | CPUFREQ_HAVE_GOVERNOR_PER_POLICY,
>         .verify         = cpufreq_generic_frequency_table_verify,
>         .target_index   = exynos_target,
>         .get            = cpufreq_generic_get,
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ