diff for duplicates of <1492065380.4624.50.camel@neuling.org> diff --git a/a/1.txt b/N1/1.txt index 4b2749a..c20b727 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -1,65 +1,57 @@ On Wed, 2017-04-12 at 17:16 +0530, Gautham R. Shenoy wrote: > From: "Gautham R. Shenoy" <ego@linux.vnet.ibm.com> ->=20 +> > This patch ensures that POWER8 and POWER9 processors use the correct > value of IDLE_THREAD_BITS as POWER8 has 8 threads per core and hence > the IDLE_THREAD_BITS should be 0xFF while POWER9 has only 4 threads > per core and hence the IDLE_THREAD_BITS should be 0xF. -Why don't we derive this from the device tree rather than hard wiring it pe= -r cpu +Why don't we derive this from the device tree rather than hard wiring it per cpu type? Mikey ->=20 +> > Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com> > --- -> =C2=A0arch/powerpc/include/asm/cpuidle.h=C2=A0=C2=A0=C2=A0=C2=A0| 3 ++- -> =C2=A0arch/powerpc/kernel/idle_book3s.S=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0| 9 = -++++++--- -> =C2=A0arch/powerpc/platforms/powernv/idle.c | 5 ++++- -> =C2=A03 files changed, 12 insertions(+), 5 deletions(-) ->=20 +> arch/powerpc/include/asm/cpuidle.h | 3 ++- +> arch/powerpc/kernel/idle_book3s.S | 9 ++++++--- +> arch/powerpc/platforms/powernv/idle.c | 5 ++++- +> 3 files changed, 12 insertions(+), 5 deletions(-) +> > diff --git a/arch/powerpc/include/asm/cpuidle.h > b/arch/powerpc/include/asm/cpuidle.h > index 52586f9..fece6ca 100644 > --- a/arch/powerpc/include/asm/cpuidle.h > +++ b/arch/powerpc/include/asm/cpuidle.h > @@ -34,7 +34,8 @@ -> =C2=A0#define PNV_CORE_IDLE_THREAD_WINKLE_BITS_SHIFT 8 -> =C2=A0#define PNV_CORE_IDLE_THREAD_WINKLE_BITS 0x0000FF00 -> =C2=A0 -> -#define PNV_CORE_IDLE_THREAD_BITS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= -=A0 0x000000FF -> +#define PNV_CORE_IDLE_4THREAD_BITS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= -=C2=A0 0x0000000F -> +#define PNV_CORE_IDLE_8THREAD_BITS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= -=C2=A0 0x000000FF -> =C2=A0 -> =C2=A0/* -> =C2=A0 * =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= -=3D=3D=3D=3D=3D=3D=3D NOTE =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +> #define PNV_CORE_IDLE_THREAD_WINKLE_BITS_SHIFT 8 +> #define PNV_CORE_IDLE_THREAD_WINKLE_BITS 0x0000FF00 +> +> -#define PNV_CORE_IDLE_THREAD_BITS 0x000000FF +> +#define PNV_CORE_IDLE_4THREAD_BITS 0x0000000F +> +#define PNV_CORE_IDLE_8THREAD_BITS 0x000000FF +> +> /* +> * ============================ NOTE ================================= > diff --git a/arch/powerpc/kernel/idle_book3s.S > b/arch/powerpc/kernel/idle_book3s.S > index 2b13fe2..9b747e9 100644 > --- a/arch/powerpc/kernel/idle_book3s.S > +++ b/arch/powerpc/kernel/idle_book3s.S > @@ -223,7 +223,7 @@ lwarx_loop1: -> =C2=A0 add r15,r15,r5 /* Add if winkle */ -> =C2=A0 andc r15,r15,r7 /* Clear thread bit */ -> =C2=A0 +> add r15,r15,r5 /* Add if winkle */ +> andc r15,r15,r7 /* Clear thread bit */ +> > - andi. r9,r15,PNV_CORE_IDLE_THREAD_BITS > + andi. r9,r15,PNV_CORE_IDLE_8THREAD_BITS -> =C2=A0 -> =C2=A0/* -> =C2=A0 * If cr0 =3D 0, then current thread is the last thread of the core= - entering +> +> /* +> * If cr0 = 0, then current thread is the last thread of the core entering > @@ -582,8 +582,11 @@ END_FTR_SECTION_IFSET(CPU_FTR_HVMODE) -> =C2=A0 stwcx. r15,0,r14 -> =C2=A0 bne- 1b -> =C2=A0 isync +> stwcx. r15,0,r14 +> bne- 1b +> isync > - > - andi. r9,r15,PNV_CORE_IDLE_THREAD_BITS > +BEGIN_FTR_SECTION @@ -67,25 +59,24 @@ Mikey > +FTR_SECTION_ELSE > + andi. r9,r15,PNV_CORE_IDLE_8THREAD_BITS > +ALT_FTR_SECTION_END_IFSET(CPU_FTR_ARCH_300) -> =C2=A0 cmpwi cr2,r9,0 -> =C2=A0 -> =C2=A0 /* +> cmpwi cr2,r9,0 +> +> /* > diff --git a/arch/powerpc/platforms/powernv/idle.c > b/arch/powerpc/platforms/powernv/idle.c > index 445f30a..d46920b 100644 > --- a/arch/powerpc/platforms/powernv/idle.c > +++ b/arch/powerpc/platforms/powernv/idle.c > @@ -112,7 +112,10 @@ static void pnv_alloc_idle_core_states(void) -> =C2=A0 size_t paca_ptr_array_size; -> =C2=A0 -> =C2=A0 core_idle_state =3D kmalloc_node(sizeof(u32), GFP_KERNEL, +> size_t paca_ptr_array_size; +> +> core_idle_state = kmalloc_node(sizeof(u32), GFP_KERNEL, > node); -> - *core_idle_state =3D PNV_CORE_IDLE_THREAD_BITS; +> - *core_idle_state = PNV_CORE_IDLE_THREAD_BITS; > + if (cpu_has_feature(CPU_FTR_ARCH_300)) -> + *core_idle_state =3D PNV_CORE_IDLE_4THREAD_BITS; +> + *core_idle_state = PNV_CORE_IDLE_4THREAD_BITS; > + else -> + *core_idle_state =3D PNV_CORE_IDLE_8THREAD_BITS; -> =C2=A0 paca_ptr_array_size =3D (threads_per_core * -> =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0sizeof(struct paca_st= -ruct *)); -> =C2=A0 +> + *core_idle_state = PNV_CORE_IDLE_8THREAD_BITS; +> paca_ptr_array_size = (threads_per_core * +> sizeof(struct paca_struct *)); +> diff --git a/a/content_digest b/N1/content_digest index 90847e5..520f991 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -21,66 +21,58 @@ "b\0" "On Wed, 2017-04-12 at 17:16 +0530, Gautham R. Shenoy wrote:\n" "> From: \"Gautham R. Shenoy\" <ego@linux.vnet.ibm.com>\n" - ">=20\n" + "> \n" "> This patch ensures that POWER8 and POWER9 processors use the correct\n" "> value of IDLE_THREAD_BITS as POWER8 has 8 threads per core and hence\n" "> the IDLE_THREAD_BITS should be 0xFF while POWER9 has only 4 threads\n" "> per core and hence the IDLE_THREAD_BITS should be 0xF.\n" "\n" - "Why don't we derive this from the device tree rather than hard wiring it pe=\n" - "r cpu\n" + "Why don't we derive this from the device tree rather than hard wiring it per cpu\n" "type?\n" "\n" "Mikey\n" "\n" - ">=20\n" + "> \n" "> Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>\n" "> ---\n" - "> =C2=A0arch/powerpc/include/asm/cpuidle.h=C2=A0=C2=A0=C2=A0=C2=A0| 3 ++-\n" - "> =C2=A0arch/powerpc/kernel/idle_book3s.S=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0| 9 =\n" - "++++++---\n" - "> =C2=A0arch/powerpc/platforms/powernv/idle.c | 5 ++++-\n" - "> =C2=A03 files changed, 12 insertions(+), 5 deletions(-)\n" - ">=20\n" + "> \302\240arch/powerpc/include/asm/cpuidle.h\302\240\302\240\302\240\302\240| 3 ++-\n" + "> \302\240arch/powerpc/kernel/idle_book3s.S\302\240\302\240\302\240\302\240\302\240| 9 ++++++---\n" + "> \302\240arch/powerpc/platforms/powernv/idle.c | 5 ++++-\n" + "> \302\2403 files changed, 12 insertions(+), 5 deletions(-)\n" + "> \n" "> diff --git a/arch/powerpc/include/asm/cpuidle.h\n" "> b/arch/powerpc/include/asm/cpuidle.h\n" "> index 52586f9..fece6ca 100644\n" "> --- a/arch/powerpc/include/asm/cpuidle.h\n" "> +++ b/arch/powerpc/include/asm/cpuidle.h\n" "> @@ -34,7 +34,8 @@\n" - "> =C2=A0#define PNV_CORE_IDLE_THREAD_WINKLE_BITS_SHIFT\t8\n" - "> =C2=A0#define PNV_CORE_IDLE_THREAD_WINKLE_BITS\t0x0000FF00\n" - "> =C2=A0\n" - "> -#define PNV_CORE_IDLE_THREAD_BITS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=\n" - "=A0\t0x000000FF\n" - "> +#define PNV_CORE_IDLE_4THREAD_BITS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=\n" - "=C2=A0\t0x0000000F\n" - "> +#define PNV_CORE_IDLE_8THREAD_BITS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=\n" - "=C2=A0\t0x000000FF\n" - "> =C2=A0\n" - "> =C2=A0/*\n" - "> =C2=A0 * =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=\n" - "=3D=3D=3D=3D=3D=3D=3D NOTE =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=\n" - "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n" + "> \302\240#define PNV_CORE_IDLE_THREAD_WINKLE_BITS_SHIFT\t8\n" + "> \302\240#define PNV_CORE_IDLE_THREAD_WINKLE_BITS\t0x0000FF00\n" + "> \302\240\n" + "> -#define PNV_CORE_IDLE_THREAD_BITS\302\240\302\240\302\240\302\240\302\240\302\240\302\240\t0x000000FF\n" + "> +#define PNV_CORE_IDLE_4THREAD_BITS\302\240\302\240\302\240\302\240\302\240\302\240\302\240\t0x0000000F\n" + "> +#define PNV_CORE_IDLE_8THREAD_BITS\302\240\302\240\302\240\302\240\302\240\302\240\302\240\t0x000000FF\n" + "> \302\240\n" + "> \302\240/*\n" + "> \302\240 * ============================ NOTE =================================\n" "> diff --git a/arch/powerpc/kernel/idle_book3s.S\n" "> b/arch/powerpc/kernel/idle_book3s.S\n" "> index 2b13fe2..9b747e9 100644\n" "> --- a/arch/powerpc/kernel/idle_book3s.S\n" "> +++ b/arch/powerpc/kernel/idle_book3s.S\n" "> @@ -223,7 +223,7 @@ lwarx_loop1:\n" - "> =C2=A0\tadd\tr15,r15,r5\t\t\t/* Add if winkle */\n" - "> =C2=A0\tandc\tr15,r15,r7\t\t\t/* Clear thread bit */\n" - "> =C2=A0\n" + "> \302\240\tadd\tr15,r15,r5\t\t\t/* Add if winkle */\n" + "> \302\240\tandc\tr15,r15,r7\t\t\t/* Clear thread bit */\n" + "> \302\240\n" "> -\tandi.\tr9,r15,PNV_CORE_IDLE_THREAD_BITS\n" "> +\tandi.\tr9,r15,PNV_CORE_IDLE_8THREAD_BITS\n" - "> =C2=A0\n" - "> =C2=A0/*\n" - "> =C2=A0 * If cr0 =3D 0, then current thread is the last thread of the core=\n" - " entering\n" + "> \302\240\n" + "> \302\240/*\n" + "> \302\240 * If cr0 = 0, then current thread is the last thread of the core entering\n" "> @@ -582,8 +582,11 @@ END_FTR_SECTION_IFSET(CPU_FTR_HVMODE)\n" - "> =C2=A0\tstwcx.\tr15,0,r14\n" - "> =C2=A0\tbne-\t1b\n" - "> =C2=A0\tisync\n" + "> \302\240\tstwcx.\tr15,0,r14\n" + "> \302\240\tbne-\t1b\n" + "> \302\240\tisync\n" "> -\n" "> -\tandi.\tr9,r15,PNV_CORE_IDLE_THREAD_BITS\n" "> +BEGIN_FTR_SECTION\n" @@ -88,27 +80,26 @@ "> +FTR_SECTION_ELSE\n" "> +\tandi.\tr9,r15,PNV_CORE_IDLE_8THREAD_BITS\n" "> +ALT_FTR_SECTION_END_IFSET(CPU_FTR_ARCH_300)\n" - "> =C2=A0\tcmpwi\tcr2,r9,0\n" - "> =C2=A0\n" - "> =C2=A0\t/*\n" + "> \302\240\tcmpwi\tcr2,r9,0\n" + "> \302\240\n" + "> \302\240\t/*\n" "> diff --git a/arch/powerpc/platforms/powernv/idle.c\n" "> b/arch/powerpc/platforms/powernv/idle.c\n" "> index 445f30a..d46920b 100644\n" "> --- a/arch/powerpc/platforms/powernv/idle.c\n" "> +++ b/arch/powerpc/platforms/powernv/idle.c\n" "> @@ -112,7 +112,10 @@ static void pnv_alloc_idle_core_states(void)\n" - "> =C2=A0\t\tsize_t paca_ptr_array_size;\n" - "> =C2=A0\n" - "> =C2=A0\t\tcore_idle_state =3D kmalloc_node(sizeof(u32), GFP_KERNEL,\n" + "> \302\240\t\tsize_t paca_ptr_array_size;\n" + "> \302\240\n" + "> \302\240\t\tcore_idle_state = kmalloc_node(sizeof(u32), GFP_KERNEL,\n" "> node);\n" - "> -\t\t*core_idle_state =3D PNV_CORE_IDLE_THREAD_BITS;\n" + "> -\t\t*core_idle_state = PNV_CORE_IDLE_THREAD_BITS;\n" "> +\t\tif (cpu_has_feature(CPU_FTR_ARCH_300))\n" - "> +\t\t\t*core_idle_state =3D PNV_CORE_IDLE_4THREAD_BITS;\n" + "> +\t\t\t*core_idle_state = PNV_CORE_IDLE_4THREAD_BITS;\n" "> +\t\telse\n" - "> +\t\t\t*core_idle_state =3D PNV_CORE_IDLE_8THREAD_BITS;\n" - "> =C2=A0\t\tpaca_ptr_array_size =3D (threads_per_core *\n" - "> =C2=A0\t\t\t\t=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0sizeof(struct paca_st=\n" - "ruct *));\n" - > =C2=A0 + "> +\t\t\t*core_idle_state = PNV_CORE_IDLE_8THREAD_BITS;\n" + "> \302\240\t\tpaca_ptr_array_size = (threads_per_core *\n" + "> \302\240\t\t\t\t\302\240\302\240\302\240\302\240\302\240\302\240\302\240sizeof(struct paca_struct *));\n" + > -e6195d16f7b045ce93392f5a72c1ab213ad19eff4097352e81615d6ee648a9db +91b2aba36ae3c122375a9b9e8d397f5cd9fc03f4ba1b1699cc4acd67e1d227fa
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.