Skip to content
  • Frederic Barrat's avatar
    ddf0676f
    pnv_phb4_pec: Simplify/align code to parent user-created PHBs · ddf0676f
    Frederic Barrat authored
    
    
    When instantiating a user-created PHB on P9/P10, we don't really have
    a reason any more to go through an indirection in pnv_chip_add_phb()
    in pnv.c, we can go straight to the right function in
    pnv_phb4_pec.c. That way, default PHBs and user-created PHBs are all
    handled in the same file.  This patch also renames pnv_phb4_get_pec()
    to pnv_pec_add_phb() to better reflect that it "hooks" a PHB to a PEC.
    
    For P8, the PHBs are parented to the chip directly, so it makes sense
    to keep calling pnv_chip_add_phb() in pnv.c, to also be consistent
    with where default PHBs are handled. The only change here is that,
    since that function is now only used for P8, we can refine the return
    type.
    
    So overall, the PnvPHB front-end now has a pnv_phb_user_get_parent()
    function which handles the parenting of the user-created PHBs by
    calling the right function in the right file based on the processor
    version. It's also easily extensible if we ever need to support a
    different parent object.
    
    Signed-off-by: default avatarFrederic Barrat <fbarrat@linux.ibm.com>
    Message-Id: <20230302163715.129635-5-fbarrat@linux.ibm.com>
    Reviewed-by: default avatarDaniel Henrique Barboza <danielhb413@gmail.com>
    Signed-off-by: default avatarDaniel Henrique Barboza <danielhb413@gmail.com>
    ddf0676f
    pnv_phb4_pec: Simplify/align code to parent user-created PHBs
    Frederic Barrat authored
    
    
    When instantiating a user-created PHB on P9/P10, we don't really have
    a reason any more to go through an indirection in pnv_chip_add_phb()
    in pnv.c, we can go straight to the right function in
    pnv_phb4_pec.c. That way, default PHBs and user-created PHBs are all
    handled in the same file.  This patch also renames pnv_phb4_get_pec()
    to pnv_pec_add_phb() to better reflect that it "hooks" a PHB to a PEC.
    
    For P8, the PHBs are parented to the chip directly, so it makes sense
    to keep calling pnv_chip_add_phb() in pnv.c, to also be consistent
    with where default PHBs are handled. The only change here is that,
    since that function is now only used for P8, we can refine the return
    type.
    
    So overall, the PnvPHB front-end now has a pnv_phb_user_get_parent()
    function which handles the parenting of the user-created PHBs by
    calling the right function in the right file based on the processor
    version. It's also easily extensible if we ever need to support a
    different parent object.
    
    Signed-off-by: default avatarFrederic Barrat <fbarrat@linux.ibm.com>
    Message-Id: <20230302163715.129635-5-fbarrat@linux.ibm.com>
    Reviewed-by: default avatarDaniel Henrique Barboza <danielhb413@gmail.com>
    Signed-off-by: default avatarDaniel Henrique Barboza <danielhb413@gmail.com>
Loading