linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: edubezval@gmail.com (Eduardo Valentin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] thermal: cpu_cooling: fix lockdep problems in cpu_cooling
Date: Thu, 13 Aug 2015 21:50:11 -0700	[thread overview]
Message-ID: <20150814045009.GB10354@localhost.localdomain> (raw)
In-Reply-To: <E1ZPQfV-0005nb-DN@rmk-PC.arm.linux.org.uk>

Hi Russell,

On Wed, Aug 12, 2015 at 08:41:49AM +0100, Russell King wrote:

<cut>

> 
> For some reason, despite Rafael saying that this should go in, despite it
> having been reviewed, Eduardo appears to be ignoring basic fixes to code
> under his control.  Having waited more than a reasonable amount of time,
> it is now time to take some action against this blockage.  Hence, I'm
> putting this into linux-next in the hope that it'll conflict and elicit
> a response for this important bug fix.

Sorry if I let this one to fall into the cracks for this long.

I am looking at this now and queuing as soon as possible.

Thanks for pushing this fix.

BR,

Eduardo

> 
> Relevant message IDs:
> 20141214213655.GA11285 at n2100.arm.linux.org.uk
> 7573578.UE8ufgjWuX at vostro.rjw.lan
> 20141215230922.GL11285 at n2100.arm.linux.org.uk
> CAKohponhkk9BK6-7ScHeZa4R43iooWQFV8YoPLv6LjO40GNq=A at mail.gmail.com
> 20150518185645.GA28053 at n2100.arm.linux.org.uk
> 2574268.XBqpdL2VLI at vostro.rjw.lan
> ---
>  drivers/thermal/cpu_cooling.c | 22 ++++++++++++++++------
>  1 file changed, 16 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c
> index 6509c61b9648..d1fd02eec58d 100644
> --- a/drivers/thermal/cpu_cooling.c
> +++ b/drivers/thermal/cpu_cooling.c
> @@ -107,6 +107,9 @@ struct cpufreq_cooling_device {
>  static DEFINE_IDR(cpufreq_idr);
>  static DEFINE_MUTEX(cooling_cpufreq_lock);
>  
> +static unsigned int cpufreq_dev_count;
> +
> +static DEFINE_MUTEX(cooling_list_lock);
>  static LIST_HEAD(cpufreq_dev_list);
>  
>  /**
> @@ -221,7 +224,7 @@ static int cpufreq_thermal_notifier(struct notifier_block *nb,
>  	switch (event) {
>  
>  	case CPUFREQ_ADJUST:
> -		mutex_lock(&cooling_cpufreq_lock);
> +		mutex_lock(&cooling_list_lock);
>  		list_for_each_entry(cpufreq_dev, &cpufreq_dev_list, node) {
>  			if (!cpumask_test_cpu(policy->cpu,
>  					      &cpufreq_dev->allowed_cpus))
> @@ -233,7 +236,7 @@ static int cpufreq_thermal_notifier(struct notifier_block *nb,
>  				cpufreq_verify_within_limits(policy, 0,
>  							     max_freq);
>  		}
> -		mutex_unlock(&cooling_cpufreq_lock);
> +		mutex_unlock(&cooling_list_lock);
>  		break;
>  	default:
>  		return NOTIFY_DONE;
> @@ -865,12 +868,15 @@ __cpufreq_cooling_register(struct device_node *np,
>  	cpufreq_dev->cool_dev = cool_dev;
>  
>  	mutex_lock(&cooling_cpufreq_lock);
> +	mutex_lock(&cooling_list_lock);
> +	list_add(&cpufreq_dev->node, &cpufreq_dev_list);
> +	mutex_unlock(&cooling_list_lock);
>  
>  	/* Register the notifier for first cpufreq cooling device */
> -	if (list_empty(&cpufreq_dev_list))
> +	if (cpufreq_dev_count == 0)
>  		cpufreq_register_notifier(&thermal_cpufreq_notifier_block,
>  					  CPUFREQ_POLICY_NOTIFIER);
> -	list_add(&cpufreq_dev->node, &cpufreq_dev_list);
> +	cpufreq_dev_count++;
>  
>  	mutex_unlock(&cooling_cpufreq_lock);
>  
> @@ -1014,14 +1020,18 @@ void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)
>  
>  	cpufreq_dev = cdev->devdata;
>  	mutex_lock(&cooling_cpufreq_lock);
> -	list_del(&cpufreq_dev->node);
> +	cpufreq_dev_count--;
>  
>  	/* Unregister the notifier for the last cpufreq cooling device */
> -	if (list_empty(&cpufreq_dev_list))
> +	if (cpufreq_dev_count == 0)
>  		cpufreq_unregister_notifier(&thermal_cpufreq_notifier_block,
>  					    CPUFREQ_POLICY_NOTIFIER);
>  	mutex_unlock(&cooling_cpufreq_lock);
>  
> +	mutex_lock(&cooling_list_lock);
> +	list_del(&cpufreq_dev->node);
> +	mutex_unlock(&cooling_list_lock);
> +
>  	thermal_cooling_device_unregister(cpufreq_dev->cool_dev);
>  	release_idr(&cpufreq_idr, cpufreq_dev->id);
>  	kfree(cpufreq_dev->time_in_idle_timestamp);
> -- 
> 2.1.0
> 

  parent reply	other threads:[~2015-08-14  4:50 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-14 21:36 3.18: lockdep problems in cpufreq Russell King - ARM Linux
2014-12-14 22:23 ` Rafael J. Wysocki
2014-12-15  3:56   ` Viresh Kumar
2014-12-15 13:28     ` Yadwinder Singh Brar
2014-12-15 13:46       ` Russell King - ARM Linux
2014-12-15 14:54         ` Yadwinder Singh Brar
2014-12-15 17:43           ` Russell King - ARM Linux
2014-12-15 21:41             ` Rafael J. Wysocki
2014-12-15 23:09               ` Russell King - ARM Linux
2014-12-16  3:41                 ` Viresh Kumar
2015-01-06 15:38                   ` Russell King - ARM Linux
2015-05-18 18:56                   ` Russell King - ARM Linux
2015-05-18 22:05                     ` Rafael J. Wysocki
2015-08-11 17:03                       ` Russell King - ARM Linux
2015-08-12  5:16                         ` Viresh Kumar
2015-08-12  7:21                           ` Russell King - ARM Linux
2015-08-12  7:35                             ` Viresh Kumar
2015-08-12  7:41                               ` [PATCH] thermal: cpu_cooling: fix lockdep problems in cpu_cooling Russell King
2015-08-12  8:11                                 ` Viresh Kumar
2015-08-12  9:08                                   ` Russell King - ARM Linux
2015-08-12  9:18                                     ` Viresh Kumar
2015-08-14  4:50                                 ` Eduardo Valentin [this message]
2015-08-14  5:53                                   ` Viresh Kumar
2015-08-15  1:19                                     ` Eduardo Valentin
2015-08-15  3:06                                       ` Viresh Kumar
2015-08-12  7:49                               ` 3.18: lockdep problems in cpufreq Russell King - ARM Linux
2015-08-12  8:12                                 ` Viresh Kumar
2015-08-12  9:08                                   ` Russell King - ARM Linux
2015-08-12  9:19                                     ` Viresh Kumar
2015-08-13  1:20                         ` Rafael J. Wysocki
2015-08-13  8:17                           ` Russell King - ARM Linux
2015-08-13  8:22                             ` Viresh Kumar
2015-08-18  1:32                             ` Rafael J. Wysocki
2015-08-18  9:30                               ` Eduardo Valentin
2014-12-16  3:37           ` Viresh Kumar
2014-12-15 14:38       ` Viresh Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150814045009.GB10354@localhost.localdomain \
    --to=edubezval@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).