Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdkfd: Fix SDMA queue init. in non-HWS mode

This patch fixes the SDMA queue initialization, when running in non-HWS mode.

The first fix is to move the initialization of SDMA VM parameters before the
initialization of the SDMA MQD.

The second fix is to load the MQD to an HQD after the initialization of the MQD.

Signed-off-by: Ben Goz <ben.goz@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Ben Goz and committed by
Oded Gabbay
4fadf6b6 aaad2d8c

+9 -1
+9 -1
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
··· 645 645 pr_debug(" sdma queue id: %d\n", q->properties.sdma_queue_id); 646 646 pr_debug(" sdma engine id: %d\n", q->properties.sdma_engine_id); 647 647 648 + init_sdma_vm(dqm, q, qpd); 648 649 retval = mqd->init_mqd(mqd, &q->mqd, &q->mqd_mem_obj, 649 650 &q->gart_mqd_addr, &q->properties); 650 651 if (retval != 0) { ··· 653 652 return retval; 654 653 } 655 654 656 - init_sdma_vm(dqm, q, qpd); 655 + retval = mqd->load_mqd(mqd, q->mqd, 0, 656 + 0, NULL); 657 + if (retval != 0) { 658 + deallocate_sdma_queue(dqm, q->sdma_id); 659 + mqd->uninit_mqd(mqd, q->mqd, q->mqd_mem_obj); 660 + return retval; 661 + } 662 + 657 663 return 0; 658 664 } 659 665