On Mon, 2 Jul 2018 19:53:20 +0530 Akshay Adiga <akshay.ad...@linux.vnet.ibm.com> wrote:
> Device-tree parsing happens twice, once while deciding idle state to be > used for hotplug and once during cpuidle init. Hence, parsing the device > tree and caching it will reduce code duplication. Parsing code has been > moved to pnv_parse_cpuidle_dt() from pnv_probe_idle_states(). In addition > to the properties in the device tree the number of available states is > also required. > > Signed-off-by: Akshay Adiga <akshay.ad...@linux.vnet.ibm.com> > --- > arch/powerpc/include/asm/cpuidle.h | 11 ++ > arch/powerpc/platforms/powernv/idle.c | 216 ++++++++++++++++---------- > drivers/cpuidle/cpuidle-powernv.c | 11 +- > 3 files changed, 151 insertions(+), 87 deletions(-) > > diff --git a/arch/powerpc/include/asm/cpuidle.h > b/arch/powerpc/include/asm/cpuidle.h > index e210a83eb196..574b0ce1d671 100644 > --- a/arch/powerpc/include/asm/cpuidle.h > +++ b/arch/powerpc/include/asm/cpuidle.h > @@ -79,6 +79,17 @@ struct stop_sprs { > u64 mmcra; > }; > > +#define PNV_IDLE_NAME_LEN 16 > +struct pnv_idle_states_t { > + char name[PNV_IDLE_NAME_LEN]; > + u32 latency_ns; > + u32 residency_ns; > + u64 psscr_val; > + u64 psscr_mask; > + u32 flags; > + bool valid; > +}; This is a nice looking cleanup. Reviewed-by: Nicholas Piggin <npig...@gmail.com>