All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] cpuidle: coupled: fix ready counter decrement
@ 2012-12-14  8:42 Sivaram Nair
  2012-12-14 23:34 ` Santosh Shilimkar
  2012-12-14 23:37 ` Rafael J. Wysocki
  0 siblings, 2 replies; 4+ messages in thread
From: Sivaram Nair @ 2012-12-14  8:42 UTC (permalink / raw)
  To: ccross, santosh.shilimkar, khilman, rjw, daniel.lezcano
  Cc: linux-kernel, Sivaram Nair

The ready_waiting_counts atomic variable is compared against the wrong
online cpu count. The latter is computed incorrectly using logical-OR
instead of bit-OR. This patch fixes that.

Signed-off-by: Sivaram Nair <sivaramn@nvidia.com>
---
 drivers/cpuidle/coupled.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cpuidle/coupled.c b/drivers/cpuidle/coupled.c
index 3265844..2a297f8 100644
--- a/drivers/cpuidle/coupled.c
+++ b/drivers/cpuidle/coupled.c
@@ -209,7 +209,7 @@ inline int cpuidle_coupled_set_not_ready(struct cpuidle_coupled *coupled)
 	int all;
 	int ret;
 
-	all = coupled->online_count || (coupled->online_count << WAITING_BITS);
+	all = coupled->online_count | (coupled->online_count << WAITING_BITS);
 	ret = atomic_add_unless(&coupled->ready_waiting_counts,
 		-MAX_WAITING_CPUS, all);
 
-- 
1.7.9.5


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

* Re: [PATCH 1/1] cpuidle: coupled: fix ready counter decrement
  2012-12-14  8:42 [PATCH 1/1] cpuidle: coupled: fix ready counter decrement Sivaram Nair
@ 2012-12-14 23:34 ` Santosh Shilimkar
  2012-12-14 23:37 ` Rafael J. Wysocki
  1 sibling, 0 replies; 4+ messages in thread
From: Santosh Shilimkar @ 2012-12-14 23:34 UTC (permalink / raw)
  To: Sivaram Nair; +Cc: ccross, Kevin Hilman, rjw, daniel.lezcano, linux-kernel

On Friday 14 December 2012 09:42 AM, Sivaram Nair wrote:
> The ready_waiting_counts atomic variable is compared against the wrong
> online cpu count. The latter is computed incorrectly using logical-OR
> instead of bit-OR. This patch fixes that.
>
> Signed-off-by: Sivaram Nair <sivaramn@nvidia.com>
> ---
Looks right.
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>


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

* Re: [PATCH 1/1] cpuidle: coupled: fix ready counter decrement
  2012-12-14  8:42 [PATCH 1/1] cpuidle: coupled: fix ready counter decrement Sivaram Nair
  2012-12-14 23:34 ` Santosh Shilimkar
@ 2012-12-14 23:37 ` Rafael J. Wysocki
  2012-12-15  1:53   ` Colin Cross
  1 sibling, 1 reply; 4+ messages in thread
From: Rafael J. Wysocki @ 2012-12-14 23:37 UTC (permalink / raw)
  To: Sivaram Nair
  Cc: ccross, santosh.shilimkar, khilman, daniel.lezcano, linux-kernel

On Friday, December 14, 2012 10:42:08 AM Sivaram Nair wrote:
> The ready_waiting_counts atomic variable is compared against the wrong
> online cpu count. The latter is computed incorrectly using logical-OR
> instead of bit-OR. This patch fixes that.

I'm queuing this up for submission as v3.8 material.

I suppose it should be marked for -stable too?

Rafael


> Signed-off-by: Sivaram Nair <sivaramn@nvidia.com>
> ---
>  drivers/cpuidle/coupled.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cpuidle/coupled.c b/drivers/cpuidle/coupled.c
> index 3265844..2a297f8 100644
> --- a/drivers/cpuidle/coupled.c
> +++ b/drivers/cpuidle/coupled.c
> @@ -209,7 +209,7 @@ inline int cpuidle_coupled_set_not_ready(struct cpuidle_coupled *coupled)
>  	int all;
>  	int ret;
>  
> -	all = coupled->online_count || (coupled->online_count << WAITING_BITS);
> +	all = coupled->online_count | (coupled->online_count << WAITING_BITS);
>  	ret = atomic_add_unless(&coupled->ready_waiting_counts,
>  		-MAX_WAITING_CPUS, all);
>  
> 
-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

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

* Re: [PATCH 1/1] cpuidle: coupled: fix ready counter decrement
  2012-12-14 23:37 ` Rafael J. Wysocki
@ 2012-12-15  1:53   ` Colin Cross
  0 siblings, 0 replies; 4+ messages in thread
From: Colin Cross @ 2012-12-15  1:53 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Sivaram Nair, santosh.shilimkar, khilman, daniel.lezcano, linux-kernel

On Fri, Dec 14, 2012 at 3:37 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> On Friday, December 14, 2012 10:42:08 AM Sivaram Nair wrote:
>> The ready_waiting_counts atomic variable is compared against the wrong
>> online cpu count. The latter is computed incorrectly using logical-OR
>> instead of bit-OR. This patch fixes that.
>
> I'm queuing this up for submission as v3.8 material.
>
> I suppose it should be marked for -stable too?
>
> Rafael

Acked-by: Colin Cross <ccross@android.com>

Looks suitable for stable.

>> Signed-off-by: Sivaram Nair <sivaramn@nvidia.com>
>> ---
>>  drivers/cpuidle/coupled.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/cpuidle/coupled.c b/drivers/cpuidle/coupled.c
>> index 3265844..2a297f8 100644
>> --- a/drivers/cpuidle/coupled.c
>> +++ b/drivers/cpuidle/coupled.c
>> @@ -209,7 +209,7 @@ inline int cpuidle_coupled_set_not_ready(struct cpuidle_coupled *coupled)
>>       int all;
>>       int ret;
>>
>> -     all = coupled->online_count || (coupled->online_count << WAITING_BITS);
>> +     all = coupled->online_count | (coupled->online_count << WAITING_BITS);
>>       ret = atomic_add_unless(&coupled->ready_waiting_counts,
>>               -MAX_WAITING_CPUS, all);
>>
>>
> --
> I speak only for myself.
> Rafael J. Wysocki, Intel Open Source Technology Center.

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

end of thread, other threads:[~2012-12-15  1:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-14  8:42 [PATCH 1/1] cpuidle: coupled: fix ready counter decrement Sivaram Nair
2012-12-14 23:34 ` Santosh Shilimkar
2012-12-14 23:37 ` Rafael J. Wysocki
2012-12-15  1:53   ` Colin Cross

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.