Skip to content
  • Daniel Henrique Barboza's avatar
    dc8e2914
    ppc/pnv: turn 'phb' into a pointer in struct PnvPhb4PecStack · dc8e2914
    Daniel Henrique Barboza authored
    
    
    At this moment, stack->phb is the plain PnvPHB4 device itself instead of
    a pointer to the device. This will present a problem when adding user
    creatable devices because we can't deal with this struct and the
    realize() callback from the user creatable device.
    
    We can't get rid of this attribute, similar to what we did when enabling
    pnv-phb3 user creatable devices, because pnv_phb4_update_regions() needs
    to access stack->phb to do its job. This function is called twice in
    pnv_pec_stk_update_map(), which is one of the nested xscom write
    callbacks (via pnv_pec_stk_nest_xscom_write()). In fact,
    pnv_pec_stk_update_map() code comment is explicit about how the order of
    the unmap/map operations relates with the PHB subregions.
    
    All of this indicates that this code is tied together in a way that we
    either go on a crusade, featuring lots of refactories and redesign and
    considerable pain, to decouple stack and phb mapping, or we allow stack
    update_map operations to access the associated PHB as it is today even
    after introducing pnv-phb4 user devices.
    
    This patch chooses the latter. Instead of getting rid of stack->phb,
    turn it into a PHB pointer. This will allow us to assign an user created
    PHB to an existing stack later. In this process,
    pnv_pec_stk_instance_init() is removed because stack->phb is being
    initialized in stk_realize() instead.
    
    Reviewed-by: default avatarCédric Le Goater <clg@kaod.org>
    Signed-off-by: default avatarDaniel Henrique Barboza <danielhb413@gmail.com>
    Message-Id: <20220111131027.599784-4-danielhb413@gmail.com>
    Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
    dc8e2914
    ppc/pnv: turn 'phb' into a pointer in struct PnvPhb4PecStack
    Daniel Henrique Barboza authored
    
    
    At this moment, stack->phb is the plain PnvPHB4 device itself instead of
    a pointer to the device. This will present a problem when adding user
    creatable devices because we can't deal with this struct and the
    realize() callback from the user creatable device.
    
    We can't get rid of this attribute, similar to what we did when enabling
    pnv-phb3 user creatable devices, because pnv_phb4_update_regions() needs
    to access stack->phb to do its job. This function is called twice in
    pnv_pec_stk_update_map(), which is one of the nested xscom write
    callbacks (via pnv_pec_stk_nest_xscom_write()). In fact,
    pnv_pec_stk_update_map() code comment is explicit about how the order of
    the unmap/map operations relates with the PHB subregions.
    
    All of this indicates that this code is tied together in a way that we
    either go on a crusade, featuring lots of refactories and redesign and
    considerable pain, to decouple stack and phb mapping, or we allow stack
    update_map operations to access the associated PHB as it is today even
    after introducing pnv-phb4 user devices.
    
    This patch chooses the latter. Instead of getting rid of stack->phb,
    turn it into a PHB pointer. This will allow us to assign an user created
    PHB to an existing stack later. In this process,
    pnv_pec_stk_instance_init() is removed because stack->phb is being
    initialized in stk_realize() instead.
    
    Reviewed-by: default avatarCédric Le Goater <clg@kaod.org>
    Signed-off-by: default avatarDaniel Henrique Barboza <danielhb413@gmail.com>
    Message-Id: <20220111131027.599784-4-danielhb413@gmail.com>
    Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
Loading