diff mbox

linux-next: Tree for Feb 8 [ smp|cpufreq: WARNING: at kernel/smp.c:245 smp_call_function_single ]

Message ID CAOh2x=nB1LpoiUjg2zDT6TvL6vM9q0D4kDG1cFZPtEnSvZc07w@mail.gmail.com (mailing list archive)
State RFC, archived
Headers show

Commit Message

Viresh Kumar Feb. 8, 2013, 2:50 p.m. UTC
On Fri, Feb 8, 2013 at 7:45 PM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
> "...some...changes..." is not very concrete :-).
> Which commit(s) caused this trouble?
>
> Is current (meanwhile updated?) linux-pm.git#linux-next good (didn't
> check last commit-ids of your tree from Next/ dir)?

Attached patch would fix it for you and it looks like and is going to be
pulled in by Rafael:

From: Viresh Kumar <viresh.kumar@linaro.org>
Date: Fri, 8 Feb 2013 10:35:31 +0530
Subject: [PATCH] cpufreq: Remove unnecessary locking

I have placed some locks intentionally around calls to driver->ops (init/exit),
which look to be wrong as these calls can call routines that potentially sleep.

Lets remove these locks.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/cpufreq.c | 7 -------
 1 file changed, 7 deletions(-)

 	cpumask_or(policy->related_cpus, policy->related_cpus, policy->cpus);
@@ -1100,10 +1095,8 @@ static int __cpufreq_remove_dev(struct device
*dev, struct subsys_interface *sif
 		wait_for_completion(cmp);
 		pr_debug("wait complete\n");

-		spin_lock_irqsave(&cpufreq_driver_lock, flags);
 		if (driver->exit)
 			driver->exit(data);
-		spin_unlock_irqrestore(&cpufreq_driver_lock, flags);

 		free_cpumask_var(data->related_cpus);
 		free_cpumask_var(data->cpus);

Comments

Sedat Dilek Feb. 8, 2013, 3:19 p.m. UTC | #1
On Fri, Feb 8, 2013 at 3:50 PM, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> On Fri, Feb 8, 2013 at 7:45 PM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>> "...some...changes..." is not very concrete :-).
>> Which commit(s) caused this trouble?
>>
>> Is current (meanwhile updated?) linux-pm.git#linux-next good (didn't
>> check last commit-ids of your tree from Next/ dir)?
>
> Attached patch would fix it for you and it looks like and is going to be
> pulled in by Rafael:
>
> From: Viresh Kumar <viresh.kumar@linaro.org>
> Date: Fri, 8 Feb 2013 10:35:31 +0530
> Subject: [PATCH] cpufreq: Remove unnecessary locking
>
> I have placed some locks intentionally around calls to driver->ops (init/exit),
> which look to be wrong as these calls can call routines that potentially sleep.
>
> Lets remove these locks.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

Tested-by: Sedat Dilek <sedat.dilek@gmail.com>

( 0001-cpufreq-Remove-unnecessary-locking.patch fixes the issue here! )

- Sedat -

> ---
>  drivers/cpufreq/cpufreq.c | 7 -------
>  1 file changed, 7 deletions(-)
>
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 5d8a422..04aab05 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -795,10 +795,8 @@ static int cpufreq_add_dev_interface(unsigned int cpu,
>
>         if (ret) {
>                 pr_debug("setting policy failed\n");
> -               spin_lock_irqsave(&cpufreq_driver_lock, flags);
>                 if (driver->exit)
>                         driver->exit(policy);
> -               spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
>         }
>         return ret;
>
> @@ -920,17 +918,14 @@ static int cpufreq_add_dev(struct device *dev,
> struct subsys_interface *sif)
>         init_completion(&policy->kobj_unregister);
>         INIT_WORK(&policy->update, handle_update);
>
> -       spin_lock_irqsave(&cpufreq_driver_lock, flags);
>         /* call driver. From then on the cpufreq must be able
>          * to accept all calls to ->verify and ->setpolicy for this CPU
>          */
>         ret = driver->init(policy);
>         if (ret) {
>                 pr_debug("initialization failed\n");
> -               spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
>                 goto err_set_policy_cpu;
>         }
> -       spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
>
>         /* related cpus should atleast have policy->cpus */
>         cpumask_or(policy->related_cpus, policy->related_cpus, policy->cpus);
> @@ -1100,10 +1095,8 @@ static int __cpufreq_remove_dev(struct device
> *dev, struct subsys_interface *sif
>                 wait_for_completion(cmp);
>                 pr_debug("wait complete\n");
>
> -               spin_lock_irqsave(&cpufreq_driver_lock, flags);
>                 if (driver->exit)
>                         driver->exit(data);
> -               spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
>
>                 free_cpumask_var(data->related_cpus);
>                 free_cpumask_var(data->cpus);
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 5d8a422..04aab05 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -795,10 +795,8 @@  static int cpufreq_add_dev_interface(unsigned int cpu,

 	if (ret) {
 		pr_debug("setting policy failed\n");
-		spin_lock_irqsave(&cpufreq_driver_lock, flags);
 		if (driver->exit)
 			driver->exit(policy);
-		spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
 	}
 	return ret;

@@ -920,17 +918,14 @@  static int cpufreq_add_dev(struct device *dev,
struct subsys_interface *sif)
 	init_completion(&policy->kobj_unregister);
 	INIT_WORK(&policy->update, handle_update);

-	spin_lock_irqsave(&cpufreq_driver_lock, flags);
 	/* call driver. From then on the cpufreq must be able
 	 * to accept all calls to ->verify and ->setpolicy for this CPU
 	 */
 	ret = driver->init(policy);
 	if (ret) {
 		pr_debug("initialization failed\n");
-		spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
 		goto err_set_policy_cpu;
 	}
-	spin_unlock_irqrestore(&cpufreq_driver_lock, flags);

 	/* related cpus should atleast have policy->cpus */