From: jsg Date: Mon, 9 Sep 2024 09:26:32 +0000 (+0000) Subject: drm/amdkfd: Reconcile the definition and use of oem_id in struct kfd_topology_device X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a21b1d7c3614b87adc4d86291296ba08315215a0;p=openbsd drm/amdkfd: Reconcile the definition and use of oem_id in struct kfd_topology_device From Michael Chen f163ba83e607f9fa71a342d37af5aeb83752ccdb in linux-6.6.y/6.6.50 10f624ef239bd136cdcc5bbc626157a57b938a31 in mainline linux --- diff --git a/sys/dev/pci/drm/amd/amdkfd/kfd_crat.h b/sys/dev/pci/drm/amd/amdkfd/kfd_crat.h index 74c2d7a0d62..2f54ee08f26 100644 --- a/sys/dev/pci/drm/amd/amdkfd/kfd_crat.h +++ b/sys/dev/pci/drm/amd/amdkfd/kfd_crat.h @@ -42,8 +42,6 @@ #define CRAT_OEMTABLEID_LENGTH 8 #define CRAT_RESERVED_LENGTH 6 -#define CRAT_OEMID_64BIT_MASK ((1ULL << (CRAT_OEMID_LENGTH * 8)) - 1) - /* Compute Unit flags */ #define COMPUTE_UNIT_CPU (1 << 0) /* Create Virtual CRAT for CPU */ #define COMPUTE_UNIT_GPU (1 << 1) /* Create Virtual CRAT for GPU */ diff --git a/sys/dev/pci/drm/amd/amdkfd/kfd_topology.c b/sys/dev/pci/drm/amd/amdkfd/kfd_topology.c index 61157fddc15..8362a71ab70 100644 --- a/sys/dev/pci/drm/amd/amdkfd/kfd_topology.c +++ b/sys/dev/pci/drm/amd/amdkfd/kfd_topology.c @@ -958,8 +958,7 @@ static void kfd_update_system_properties(void) dev = list_last_entry(&topology_device_list, struct kfd_topology_device, list); if (dev) { - sys_props.platform_id = - (*((uint64_t *)dev->oem_id)) & CRAT_OEMID_64BIT_MASK; + sys_props.platform_id = dev->oem_id64; sys_props.platform_oem = *((uint64_t *)dev->oem_table_id); sys_props.platform_rev = dev->oem_revision; } diff --git a/sys/dev/pci/drm/amd/amdkfd/kfd_topology.h b/sys/dev/pci/drm/amd/amdkfd/kfd_topology.h index 27386ce9a02..2d1c9d771be 100644 --- a/sys/dev/pci/drm/amd/amdkfd/kfd_topology.h +++ b/sys/dev/pci/drm/amd/amdkfd/kfd_topology.h @@ -154,7 +154,10 @@ struct kfd_topology_device { struct attribute attr_gpuid; struct attribute attr_name; struct attribute attr_props; - uint8_t oem_id[CRAT_OEMID_LENGTH]; + union { + uint8_t oem_id[CRAT_OEMID_LENGTH]; + uint64_t oem_id64; + }; uint8_t oem_table_id[CRAT_OEMTABLEID_LENGTH]; uint32_t oem_revision; };