Patchwork Fix doorbell type shift

login
register
mail settings
Submitter Michael Neuling
Date June 6, 2011, 2:48 a.m.
Message ID <23877.1307328527@neuling.org>
Download mbox | patch
Permalink /patch/98791/
State Accepted
Commit dc28518f7d7dfd93cd44edb44f9b8e961f5a5c1b
Delegated to: Benjamin Herrenschmidt
Headers show

Comments

Michael Neuling - June 6, 2011, 2:48 a.m.
doorbell type is defined as bits 32:36 so should be shifted by 63-36 =
27 rather than 28.

We never noticed this bug as we've only every used type PPC_DBELL = 0.

Signed-off-by: Michael Neuling <mikey@neuling.org>
---
 arch/powerpc/include/asm/dbell.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Kumar Gala - June 7, 2011, 12:59 p.m.
On Jun 5, 2011, at 9:48 PM, Michael Neuling wrote:

> doorbell type is defined as bits 32:36 so should be shifted by 63-36 =
> 27 rather than 28.
> 
> We never noticed this bug as we've only every used type PPC_DBELL = 0.
> 
> Signed-off-by: Michael Neuling <mikey@neuling.org>
> ---
> arch/powerpc/include/asm/dbell.h |    2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Acked-by: Kumar Gala <galak@kernel.crashing.org>

> 
> Index: linux-ozlabs/arch/powerpc/include/asm/dbell.h
> ===================================================================
> --- linux-ozlabs.orig/arch/powerpc/include/asm/dbell.h
> +++ linux-ozlabs/arch/powerpc/include/asm/dbell.h
> @@ -18,7 +18,7 @@
> #include <asm/ppc-opcode.h>
> 
> #define PPC_DBELL_MSG_BRDCAST	(0x04000000)
> -#define PPC_DBELL_TYPE(x)	(((x) & 0xf) << 28)
> +#define PPC_DBELL_TYPE(x)	(((x) & 0xf) << (63-36))
> enum ppc_dbell {
> 	PPC_DBELL = 0,		/* doorbell */
> 	PPC_DBELL_CRIT = 1,	/* critical doorbell */

Patch

Index: linux-ozlabs/arch/powerpc/include/asm/dbell.h
===================================================================
--- linux-ozlabs.orig/arch/powerpc/include/asm/dbell.h
+++ linux-ozlabs/arch/powerpc/include/asm/dbell.h
@@ -18,7 +18,7 @@ 
 #include <asm/ppc-opcode.h>
 
 #define PPC_DBELL_MSG_BRDCAST	(0x04000000)
-#define PPC_DBELL_TYPE(x)	(((x) & 0xf) << 28)
+#define PPC_DBELL_TYPE(x)	(((x) & 0xf) << (63-36))
 enum ppc_dbell {
 	PPC_DBELL = 0,		/* doorbell */
 	PPC_DBELL_CRIT = 1,	/* critical doorbell */