• Gautham R. Shenoy's avatar
    cpuidle: pseries: Add function to parse extended CEDE records · 054e44ba
    Gautham R. Shenoy authored
    Currently we use CEDE with latency-hint 0 as the only other idle state
    on a dedicated LPAR apart from the polling "snooze" state.
    
    The platform might support additional extended CEDE idle states, which
    can be discovered through the "ibm,get-system-parameter" rtas-call
    made with CEDE_LATENCY_TOKEN.
    
    This patch adds a function to obtain information about the extended
    CEDE idle states from the platform and parse the contents to populate
    an array of extended CEDE states. These idle states thus discovered
    will be added to the cpuidle framework in the next patch.
    
    dmesg on a POWER8 and POWER9 LPAR, demonstrating the output of parsing
    the extended CEDE latency parameters are as follows
    
    POWER8
    [   10.093279] xcede : xcede_record_size = 10
    [   10.093285] xcede : Record 0 : hint = 1, latency = 0x3c00 tb ticks, Wake-on-irq = 1
    [   10.093291] xcede : Record 1 : hint = 2, latency = 0x4e2000 tb ticks, Wake-on-irq = 0
    [   10.093297] cpuidle : Skipping the 2 Extended CEDE idle states
    
    POWER9
    [    5.913180] xcede : xcede_record_size = 10
    [    5.913183] xcede : Record 0 : hint = 1, latency = 0x400 tb ticks, Wake-on-irq = 1
    [    5.913188] xcede : Record 1 : hint = 2, latency = 0x3e8000 tb ticks, Wake-on-irq = 0
    [    5.913193] cpuidle : Skipping the 2 Extended CEDE idle states
    Signed-off-by: default avatarGautham R. Shenoy <ego@linux.vnet.ibm.com>
    [mpe: Make space for 16 records, drop memset, minor cleanup & formatting]
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    Link: https://lore.kernel.org/r/1596087177-30329-3-git-send-email-ego@linux.vnet.ibm.com
    054e44ba
cpuidle-pseries.c 10.4 KB