Disable GPUVM-mapped doorbell on gfx802

gfx802 requires a workaround for a VM TLB bug in which lookups use
the ACTIVE bit of the 8th PTE within any aligned group of 8 PTEs.
Until this is fixed in amdgpu the GPUVM doorbell logic will fail.

Change-Id: I5ec7b1fcd8b7677011a141d27cfc486c45d9a415
Signed-off-by: Jay Cornwall <Jay.Cornwall@amd.com>


[ROCm/ROCR-Runtime commit: 5493ae420b]
Этот коммит содержится в:
Jay Cornwall
2016-10-10 18:34:15 -05:00
родитель 6f2c876923
Коммит 469f3a5b5d
+29 -15
Просмотреть файл
@@ -207,6 +207,33 @@ HSAKMT_STATUS init_process_doorbells(unsigned int NumNodes)
return ret;
}
static struct device_info *get_device_info_by_dev_id(uint16_t dev_id)
{
int i = 0;
while (supported_devices[i].dev_id != 0) {
if (supported_devices[i].dev_id == dev_id) {
return supported_devices[i].dev_info;
}
i++;
}
return NULL;
}
static bool use_gpuvm_doorbell(uint16_t dev_id)
{
struct device_info *dev_info;
dev_info = get_device_info_by_dev_id(dev_id);
/*
* GPUVM doorbell on Tonga requires a workaround for VM TLB ACTIVE bit
* lookup bug. Remove ASIC check when this is implemented in amdgpu.
*/
return (topology_is_dgpu(dev_id) &&
dev_info->asic_family != CHIP_TONGA);
}
void destroy_process_doorbells(void)
{
unsigned int i;
@@ -218,7 +245,7 @@ void destroy_process_doorbells(void)
if (doorbells[i].need_mmap)
continue;
if (topology_is_dgpu(get_device_id_by_node(i))) {
if (use_gpuvm_doorbell(get_device_id_by_node(i))) {
fmm_unmap_from_gpu(doorbells[i].doorbells);
fmm_release(doorbells[i].doorbells);
} else
@@ -281,7 +308,7 @@ static HSAKMT_STATUS map_doorbell(HSAuint32 NodeId, HSAuint32 gpu_id,
return HSAKMT_STATUS_SUCCESS;
}
if (topology_is_dgpu(get_device_id_by_node(NodeId)))
if (use_gpuvm_doorbell(get_device_id_by_node(NodeId)))
status = map_doorbell_dgpu(NodeId, gpu_id, doorbell_offset);
else
status = map_doorbell_apu(NodeId, gpu_id, doorbell_offset);
@@ -291,19 +318,6 @@ static HSAKMT_STATUS map_doorbell(HSAuint32 NodeId, HSAuint32 gpu_id,
return status;
}
static struct device_info *get_device_info_by_dev_id(uint16_t dev_id)
{
int i = 0;
while (supported_devices[i].dev_id != 0) {
if (supported_devices[i].dev_id == dev_id) {
return supported_devices[i].dev_info;
}
i++;
}
return NULL;
}
static void free_queue_cpu(struct queue *q)
{
if (q->eop_buffer)