All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: fix psci power state pack
@ 2014-02-12  9:22 Prashant Gaikwad
  2014-02-12 10:19 ` Will Deacon
  0 siblings, 1 reply; 3+ messages in thread
From: Prashant Gaikwad @ 2014-02-12  9:22 UTC (permalink / raw)
  To: linux-arm-kernel

Values has to be shifted right to create pack.

Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
---
 arch/arm64/kernel/psci.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/kernel/psci.c b/arch/arm64/kernel/psci.c
index 4f97db3..6e8f1df 100644
--- a/arch/arm64/kernel/psci.c
+++ b/arch/arm64/kernel/psci.c
@@ -87,11 +87,11 @@ static int psci_to_linux_errno(int errno)
 static u32 psci_power_state_pack(struct psci_power_state state)
 {
 	return	((state.id & PSCI_POWER_STATE_ID_MASK)
-			<< PSCI_POWER_STATE_ID_SHIFT)	|
+			>> PSCI_POWER_STATE_ID_SHIFT)	|
 		((state.type & PSCI_POWER_STATE_TYPE_MASK)
-			<< PSCI_POWER_STATE_TYPE_SHIFT)	|
+			>> PSCI_POWER_STATE_TYPE_SHIFT)	|
 		((state.affinity_level & PSCI_POWER_STATE_AFFL_MASK)
-			<< PSCI_POWER_STATE_AFFL_SHIFT);
+			>> PSCI_POWER_STATE_AFFL_SHIFT);
 }
 
 /*
-- 
1.7.4.1

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

* [PATCH] arm64: fix psci power state pack
  2014-02-12  9:22 [PATCH] arm64: fix psci power state pack Prashant Gaikwad
@ 2014-02-12 10:19 ` Will Deacon
  2014-02-12 10:42   ` Prashant Gaikwad
  0 siblings, 1 reply; 3+ messages in thread
From: Will Deacon @ 2014-02-12 10:19 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Feb 12, 2014 at 09:22:38AM +0000, Prashant Gaikwad wrote:
> Values has to be shifted right to create pack.

NAK. This doesn't make any sense to me.

> Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
> ---
>  arch/arm64/kernel/psci.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm64/kernel/psci.c b/arch/arm64/kernel/psci.c
> index 4f97db3..6e8f1df 100644
> --- a/arch/arm64/kernel/psci.c
> +++ b/arch/arm64/kernel/psci.c
> @@ -87,11 +87,11 @@ static int psci_to_linux_errno(int errno)
>  static u32 psci_power_state_pack(struct psci_power_state state)
>  {
>  	return	((state.id & PSCI_POWER_STATE_ID_MASK)
> -			<< PSCI_POWER_STATE_ID_SHIFT)	|
> +			>> PSCI_POWER_STATE_ID_SHIFT)	|
>  		((state.type & PSCI_POWER_STATE_TYPE_MASK)
> -			<< PSCI_POWER_STATE_TYPE_SHIFT)	|
> +			>> PSCI_POWER_STATE_TYPE_SHIFT)	|

So for the type field, this becomes:

  (state.type & 0x1) >> 16

Are you sure?

Will

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

* [PATCH] arm64: fix psci power state pack
  2014-02-12 10:19 ` Will Deacon
@ 2014-02-12 10:42   ` Prashant Gaikwad
  0 siblings, 0 replies; 3+ messages in thread
From: Prashant Gaikwad @ 2014-02-12 10:42 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 2014-02-12 at 15:49 +0530, Will Deacon wrote:
> On Wed, Feb 12, 2014 at 09:22:38AM +0000, Prashant Gaikwad wrote:
> > Values has to be shifted right to create pack.
> 
> NAK. This doesn't make any sense to me.
> 
> > Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
> > ---
> >  arch/arm64/kernel/psci.c |    6 +++---
> >  1 files changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/arch/arm64/kernel/psci.c b/arch/arm64/kernel/psci.c
> > index 4f97db3..6e8f1df 100644
> > --- a/arch/arm64/kernel/psci.c
> > +++ b/arch/arm64/kernel/psci.c
> > @@ -87,11 +87,11 @@ static int psci_to_linux_errno(int errno)
> >  static u32 psci_power_state_pack(struct psci_power_state state)
> >  {
> >  	return	((state.id & PSCI_POWER_STATE_ID_MASK)
> > -			<< PSCI_POWER_STATE_ID_SHIFT)	|
> > +			>> PSCI_POWER_STATE_ID_SHIFT)	|
> >  		((state.type & PSCI_POWER_STATE_TYPE_MASK)
> > -			<< PSCI_POWER_STATE_TYPE_SHIFT)	|
> > +			>> PSCI_POWER_STATE_TYPE_SHIFT)	|
> 
> So for the type field, this becomes:
> 
>   (state.type & 0x1) >> 16

Ahhh, my bad. I got my mistake.

Thanks for the review Will!!

> 
> Are you sure?
> 
> Will

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

end of thread, other threads:[~2014-02-12 10:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-12  9:22 [PATCH] arm64: fix psci power state pack Prashant Gaikwad
2014-02-12 10:19 ` Will Deacon
2014-02-12 10:42   ` Prashant Gaikwad

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.