Skip to contentSkip to conversation

arm64: fix psci power state pack

PATCH New Prashant Gaikwad 2 participants 3 messages Feb 12, 2014 arm64

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: fix psci power state pack

Values has to be shifted right to create pack.

---
 arch/arm64/kernel/psci.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
arch/arm64/kernel/psci.c +3 -3
index 4f97db3..6e8f1df 100644
@@ -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);
 }
 
 /*
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH 1/1 arm64: fix psci power state pack

Quoted 1 line · Prashant Gaikwad

Values has to be shifted right to create pack.

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

Quoted 10 lines
---
 arch/arm64/kernel/psci.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
arch/arm64/kernel/psci.c +0 -0
index 4f97db3..6e8f1df 100644

arch/arm64/kernel/psci.c static int psci_to_linux_errno(int errno) · line 92

Quoted 8 lines
arch/arm64/kernel/psci.c +2 -2
@@ -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

#2 lore raw

PATCH 1/1 arm64: fix psci power state pack

Quoted 26 lines · Will Deacon
Quoted 1 line · Prashant Gaikwad

Values has to be shifted right to create pack.

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

Quoted 10 lines
---
 arch/arm64/kernel/psci.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
arch/arm64/kernel/psci.c +0 -0
index 4f97db3..6e8f1df 100644

arch/arm64/kernel/psci.c static int psci_to_linux_errno(int errno) · line 92

Quoted 8 lines
arch/arm64/kernel/psci.c +2 -2
@@ -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:

Quoted 1 line

(state.type & 0x1) >> 16

Ahhh, my bad. I got my mistake.

Thanks for the review Will!!

Quoted 4 lines

Are you sure?

Will