[PATCH] drm/amdkfd: Add partition id field to location_id

Kim, Jonathan Jonathan.Kim at amd.com
Fri Feb 23 16:26:24 UTC 2024


[Public]

> -----Original Message-----
> From: Lazar, Lijo <Lijo.Lazar at amd.com>
> Sent: Thursday, February 22, 2024 10:49 PM
> To: amd-gfx at lists.freedesktop.org
> Cc: Zhang, Hawking <Hawking.Zhang at amd.com>; Deucher, Alexander
> <Alexander.Deucher at amd.com>; Kim, Jonathan <Jonathan.Kim at amd.com>;
> Poag, Charis <Charis.Poag at amd.com>; Cheung, Donald
> <donald.cheung at amd.com>; Yat Sin, David <David.YatSin at amd.com>;
> Chaudhary, Jatin Jaikishan <JatinJaikishan.Chaudhary at amd.com>
> Subject: [PATCH] drm/amdkfd: Add partition id field to location_id
>
> On devices which have multi-partition nodes, keep partition id in
> location_id[31:28].
>
> Signed-off-by: Lijo Lazar <lijo.lazar at amd.com>

Reviewed-by: Jonathan Kim <jonathan.kim at amd.com>

> ---
>  drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
> b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
> index aee2fcab241f..0da747d52975 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
> @@ -1997,8 +1997,9 @@ int kfd_topology_add_device(struct kfd_node
> *gpu)
>                       HSA_CAP_ASIC_REVISION_MASK);
>
>       dev->node_props.location_id = pci_dev_id(gpu->adev->pdev);
> -     if (KFD_GC_VERSION(dev->gpu->kfd) == IP_VERSION(9, 4, 3))
> -             dev->node_props.location_id |= dev->gpu->node_id;
> +     /* On multi-partition nodes, node id = location_id[31:28] */
> +     if (gpu->kfd->num_nodes > 1)
> +             dev->node_props.location_id |= (dev->gpu->node_id << 28);
>
>       dev->node_props.domain = pci_domain_nr(gpu->adev->pdev->bus);
>       dev->node_props.max_engine_clk_fcompute =
> --
> 2.25.1



More information about the amd-gfx mailing list