Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4FC9C606A322 for ; Thu, 3 Dec 2026 17:42:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=2MNBxRro Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DCAB010E800; Thu, 3 Dec 2026 17:42:44 +0000 (UTC) Received: from CH1PR05CU001.outbound.protection.outlook.com (mail-northcentralusazon11010070.outbound.protection.outlook.com [52.101.193.70]) by gabe.freedesktop.org (Postfix) with ESMTPS id A239A10E7F7 for ; Thu, 3 Dec 2026 17:42:33 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qce65DwRRlNKsK2hOzEYTuKLbeqXEAk7C6hmzAeVmvee7KrF3DrI6nU8Jl+QJiEDGRK82Qi04RKoa023gWfuMpIUXPVkvK9R4Zmdw1S8IdiuDjL+ynksGop0EYK2H/vbcaUMIpJloP0wby+DIKiIpX8Sor11R+BzyO5apkoUv6xxn6nEv5FwNQM8K2hrUwm3kVZMnwAFNjnY+k8T6MjyvQXm+1unZnFbTzfjprBdBIA5XeGfYfo/9yDEFLPYkHmEGjyBSCCLGGYccFujv7l83Tear6h454Wg4/HvspzDn4h7IpXldRGL25ShwFTfwm7Nx9n9EIvBPE0S6jAkiOzJCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cM3j5GiL3ngW2tnrmLMFanI54jXkKqHhqJrzUm1WAu8=; b=fnDdef073xoNoO3oHjr+4UTrmxvFvZqO4VGu7Ls+YW+MkGzJ2znKoW5n3Cvicd1hgzZM9GCPEaHkfo2kCxg0G8pmhK9FOnHVW4wC9EmCwOcSlPaeuJZGVL3zXs101Xlb0bKpEqT6BHEa12AM2ujcW+32G/zrvF4SomIjeMq9srVU48H+XJc+18J28wDig3l9+QDHAQF6sgamoGKOvJLcGaVQZI7ot/RubEe44viS1JTD7AzO5vD9Z8I1fedsgl3uIyHA38FN4057+dw1oMQbHddEF5t9erUyop45EZKyCFz97FyWTKSpKIz2q29uhNhtJ/cOMQcEM4nJdzYlz/Cvqw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cM3j5GiL3ngW2tnrmLMFanI54jXkKqHhqJrzUm1WAu8=; b=2MNBxRrorGmFBbfWnnx8lnsb1vdGqefkNAkgPD/JwvhVDHoCePBa2sRwip5vtFM9g4hS7CR9w+M4sOzrXR5mqEvXtcZ6TiaUzqMkMzpKxglOjDsrI85XQFwqdhy2ZfkKfAy+weRdZveZdfZ7GCD3ZUvUZt/wtTDeB3rTqkLqBIo= Received: from MW4PR03CA0337.namprd03.prod.outlook.com (2603:10b6:303:dc::12) by SA1PR12MB7151.namprd12.prod.outlook.com (2603:10b6:806:2b1::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.10; Thu, 3 Dec 2026 17:42:27 +0000 Received: from MW1PEPF00018894.namprd03.prod.outlook.com (2603:10b6:303:dc:cafe::ab) by MW4PR03CA0337.outlook.office365.com (2603:10b6:303:dc::12) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.688.12 via Frontend Transport; Thu, 3 Dec 2026 17:42:26 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by MW1PEPF00018894.mail.protection.outlook.com (10.167.249.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.709.6 via Frontend Transport; Thu, 3 Dec 2026 17:42:26 +0000 Received: from mukjoshi-dev.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Thu, 3 Dec 2026 11:42:24 -0600 From: Mukul Joshi To: CC: , , , Mukul Joshi Subject: [PATCH 2/2] drm/amdkfd: remove all queues of a process with a single MES call Date: Thu, 3 Dec 2026 12:41:36 -0500 Message-ID: <20261203174136.865568-2-mukul.joshi@amd.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261203174136.865568-1-mukul.joshi@amd.com> References: <20261203174136.865568-1-mukul.joshi@amd.com> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: satlexmb08.amd.com (10.181.42.217) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MW1PEPF00018894:EE_|SA1PR12MB7151:EE_ X-MS-Office365-Filtering-Correlation-Id: c8c833ac-2844-49fb-baa5-08df5164cbbc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|376014|23010399003|36860700016|1800799024|11063799006|261009223027099003|22082099003|18002099003|10067099003|261021121427099003|261102123227099003|261026121527099003|261026140227099003|261028144727099003|261021123027099003|261022105027099003|261022075727099003|56012099006; X-Microsoft-Antispam-Message-Info: J3Mc5Nidfxs8eyW4rk5uA0Lj7xYaRxed4aHoJf9w/ThxU4RIbRBQqdY6HGyMSNJjw6kLXkkmrQhfrS6q9MOOY4oJIilKcmsLjWdVTYccEnLTdqrHCiMXugKHWqmJAcnwlQMM3AqXV1Xk/uGBOx5itqquTNBAFRmB0DGgIUrs0u30Y2xP/sEp6FHAplyA/7opgw5qsOyY3aa54GcTTkd3aGT++ODw8uRc0p8kw5tNgQXI7PriXjVZ1cctoNoQgG4eh5zB36xIfavurogZWbsaJ+SmfqOc8DKkbnhEWavZiSf9m2pVGjtvG+yKw7legpv94lPpS7d7PFdV+CNEZJeaU5GJdUEtkllondz+plnroDYnsFv+TSHHLUa6ENQ0e/Byq7fwQX4QC2BB81F0PaqTVobXGJU0ib4js832tcCpYd38T9KUI0ZAsfyEstoTtsWGKAO63gi/2g4dceixgCwoj+Z4QTPAQUHkkIb2wJEla9R5V4jg59x3WgtCRT6iPtskYma3uWnDtb2N00IPr00e3PD2gSaD5tJC7kXiFPXy5xoTXeM7SWwYNuGttpFyxCkpXQabAFIdor+dB+EqOd+flKsHC1cfpnmJm+KPppFT9lkbJMdvshxYHZhqjwxOL76TvWXZTqcMn+cgo0pCr4Vl5ypP7r4miaH2YTO83I7id08adWJKM3+BVyjz2PbjphqlymAq984pFYunBO+ciZSjPw== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:satlexmb07.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(82310400026)(376014)(23010399003)(36860700016)(1800799024)(11063799006)(261009223027099003)(22082099003)(18002099003)(10067099003)(261021121427099003)(261102123227099003)(261026121527099003)(261026140227099003)(261028144727099003)(261021123027099003)(261022105027099003)(261022075727099003)(56012099006); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7OHStAOEhnZFKmVuOCNaMJm/x2rJ67/d1qDpaZaKUcNeN75TcTdTw2EgzDERUkaSPwiLGJC+Qx97Ax8ZfxfDpuvkhdbH0xoHQlw/81pJQwEKYWH7x4RZ4XPfSPulB8hn2D6Q497+b5szMZSEVbxSAqW2joZ7XgHah1RSFKfz4eA1DN1ExXDUzYMObZ1hCCVGV/yLmbTkgS86U59bYyKOoqjjc58frT+LttA2o47UTNGZck0/SosctfbSh3m2Lj8lJharO7/To+DIBZQgkLWiHeeKCkqlt286bacN9dN7S9/dyfgOCQiGnE46DWc9CbGnc7UaKf3YekG8p9/8MLes6Ky0SuvZSfIbedM3/XJpwrwLPEfJALhJFBl+Y8UujirqsoGe/z54HZs8wU2VVX9sRguAzJdTOKvahr2MBubsq+CIoZzgV2VB++9k8ZvNu2Zp X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2026 17:42:26.5258 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c8c833ac-2844-49fb-baa5-08df5164cbbc X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MW1PEPF00018894.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7151 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "amd-gfx" X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On process eviction, termination and scheduler halt/stop, KFD sends one MES REMOVE_QUEUE per active queue. If MES supports it, remove all queues of a process, by PASID, with a single request instead. remove_queue_mes() sends this request when called with a NULL queue. On failure, the same request is passed to the MES queue reset path, which sends it again if no hung queue is found. Signed-off-by: Mukul Joshi --- .../drm/amd/amdkfd/kfd_device_queue_manager.c | 122 ++++++++++++++---- 1 file changed, 96 insertions(+), 26 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c index 58c7da599752..c6b2f95a5e09 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c @@ -79,7 +79,9 @@ static struct queue *find_queue_by_doorbell_offset(struct device_queue_manager * u32 doorbell_offset); static void set_queue_as_reset(struct device_queue_manager *dqm, struct queue *q, struct qcm_process_device *qpd, bool verbose); -static int reset_queues_mes(struct device_queue_manager *dqm, struct queue *q); +static int reset_queues_mes(struct device_queue_manager *dqm, + struct kfd_process_device *pdd, + struct mes_remove_queue_input *queue_input); static inline enum KFD_MQD_TYPE get_mqd_type_from_queue_type(enum kfd_queue_type type) @@ -299,6 +301,23 @@ static int add_queue_mes(struct device_queue_manager *dqm, struct queue *q, return r; } +/* A queue that is active and not reset is still in MES */ +static bool qpd_has_mes_queue(struct qcm_process_device *qpd) +{ + struct queue *q; + + list_for_each_entry(q, &qpd->queues_list, list) + if (q->properties.is_active && !q->properties.is_reset) + return true; + + return false; +} + +/* + * Remove queue q from MES. If q is NULL, remove all queues of the process + * with a single request, see amdgpu_mes_remove_all_process_queues_supported(). + * This must be done while the queues are still marked active. + */ static int remove_queue_mes_on_reset_option(struct device_queue_manager *dqm, struct queue *q, struct qcm_process_device *qpd, bool is_for_reset, @@ -308,8 +327,8 @@ static int remove_queue_mes_on_reset_option(struct device_queue_manager *dqm, st int r; struct mes_remove_queue_input queue_input; - /* queue was already removed during reset */ - if (q->properties.is_reset) + /* queue(s) already removed during reset */ + if (q ? q->properties.is_reset : !qpd_has_mes_queue(qpd)) return 0; if (!dqm->sched_running || dqm->sched_halt) @@ -318,12 +337,17 @@ static int remove_queue_mes_on_reset_option(struct device_queue_manager *dqm, st return -EIO; memset(&queue_input, 0x0, sizeof(struct mes_remove_queue_input)); - queue_input.doorbell_offset = q->properties.doorbell_off; - queue_input.gang_context_addr = q->gang_ctx_gpu_addr; - queue_input.queue_type = convert_to_amdgpu_ring_type(q->properties.type); - queue_input.remove_queue_after_reset = flush_mes_queue; + if (q) { + queue_input.doorbell_offset = q->properties.doorbell_off; + queue_input.gang_context_addr = q->gang_ctx_gpu_addr; + queue_input.queue_type = convert_to_amdgpu_ring_type(q->properties.type); + queue_input.remove_queue_after_reset = flush_mes_queue; + queue_input.gang_context_array_index = q->gang_ctx_array_index; + } else { + queue_input.remove_all_process_queues = true; + queue_input.pasid = qpd_to_pdd(qpd)->pasid; + } queue_input.xcc_id = ffs(dqm->dev->xcc_mask) - 1; - queue_input.gang_context_array_index = q->gang_ctx_array_index; amdgpu_mes_lock(&adev->mes); r = adev->mes.funcs->remove_hw_queue(&adev->mes, &queue_input); @@ -335,10 +359,15 @@ static int remove_queue_mes_on_reset_option(struct device_queue_manager *dqm, st return r; /* remove_hw_queue failure indicates a queue hang. reset the queue */ - r = reset_queues_mes(dqm, q); + queue_input.remove_queue_after_reset = false; + r = reset_queues_mes(dqm, qpd_to_pdd(qpd), &queue_input); if (r && amdgpu_gpu_recovery) { - dev_err(adev->dev, "failed to remove queue from MES, doorbell=0x%x\n", - q->properties.doorbell_off); + if (q) + dev_err(adev->dev, "failed to remove queue from MES, doorbell=0x%x\n", + q->properties.doorbell_off); + else + dev_err(adev->dev, "failed to remove queues of pasid 0x%x from MES\n", + queue_input.pasid); dev_err(adev->dev, "MES might be in unrecoverable state, issue a GPU reset\n"); kfd_hws_hang(dqm); } @@ -363,6 +392,8 @@ static int remove_queue_mes(struct device_queue_manager *dqm, struct queue *q, static int remove_all_kfd_queues_mes(struct device_queue_manager *dqm) { + struct amdgpu_device *adev = (struct amdgpu_device *)dqm->dev->adev; + bool remove_all = amdgpu_mes_remove_all_process_queues_supported(adev); struct device_process_node *cur; struct device *dev = dqm->dev->adev->dev; struct qcm_process_device *qpd; @@ -371,6 +402,16 @@ static int remove_all_kfd_queues_mes(struct device_queue_manager *dqm) list_for_each_entry(cur, &dqm->queues, list) { qpd = cur->qpd; + if (remove_all) { + retval = remove_queue_mes(dqm, NULL, qpd); + if (retval) { + dev_err(dev, "%s: Failed to remove queues of pasid 0x%x for dev %d", + __func__, qpd_to_pdd(qpd)->pasid, dqm->dev->id); + return retval; + } + continue; + } + list_for_each_entry(q, &qpd->queues_list, list) { if (q->properties.is_active) { retval = remove_queue_mes(dqm, q, qpd); @@ -452,15 +493,19 @@ int kfd_reset_queue_mes(struct device_queue_manager *dqm, int queue_type, return reset_queue_mes(dqm, q, queue_type, pipe, queue, db); } -static int reset_queues_mes(struct device_queue_manager *dqm, struct queue *q) +/* + * queue_input is the remove request for the bad queue(s). If MES doesn't + * detect a hung queue, it is sent again before the queues are resumed. + */ +static int reset_queues_mes(struct device_queue_manager *dqm, + struct kfd_process_device *pdd, + struct mes_remove_queue_input *queue_input) { struct amdgpu_device *adev = (struct amdgpu_device *)dqm->dev->adev; struct drm_wedge_task_info *info = NULL; struct amdgpu_task_info *ti = NULL; - struct kfd_process_device *pdd; unsigned int num_hung = 0; int r = 0; - struct mes_remove_queue_input queue_input; if (!amdgpu_mes_queue_reset_by_mes_supported(adev)) { r = -ENOTRECOVERABLE; @@ -471,18 +516,11 @@ static int reset_queues_mes(struct device_queue_manager *dqm, struct queue *q) if (WARN_ON(dqm->detect_hang_count > 0)) return 0; - memset(&queue_input, 0x0, sizeof(struct mes_remove_queue_input)); - queue_input.doorbell_offset = q->properties.doorbell_off; - queue_input.gang_context_addr = q->gang_ctx_gpu_addr; - queue_input.gang_context_array_index = q->gang_ctx_array_index; - queue_input.queue_type = convert_to_amdgpu_ring_type(q->properties.type); - queue_input.remove_queue_after_reset = false; - queue_input.xcc_id = ffs(dqm->dev->xcc_mask) - 1; /* pass the known bad queue info to the reset function */ - r = amdgpu_gfx_reset_mes_compute(adev, dqm->dev->xcp, NULL, NULL, NULL, &num_hung, &queue_input); + r = amdgpu_gfx_reset_mes_compute(adev, dqm->dev->xcp, NULL, NULL, NULL, &num_hung, + queue_input); if (r) goto fail; - pdd = kfd_get_process_device_data(q->device, q->process); if (pdd) { ti = amdgpu_vm_get_task_info_pasid(adev, pdd->pasid); if (ti) { @@ -1493,6 +1531,7 @@ static int evict_process_queues_cpsch(struct device_queue_manager *dqm, struct queue *q; struct device *dev = dqm->dev->adev->dev; struct kfd_process_device *pdd; + bool remove_all; int retval = 0; dqm_lock(dqm); @@ -1514,6 +1553,17 @@ static int evict_process_queues_cpsch(struct device_queue_manager *dqm, if (dqm->dev->kfd->shared_resources.enable_mes) pdd->last_evict_timestamp = get_jiffies_64(); + remove_all = dqm->dev->kfd->shared_resources.enable_mes && + amdgpu_mes_remove_all_process_queues_supported(dqm->dev->adev); + if (remove_all) { + retval = remove_queue_mes(dqm, NULL, qpd); + if (retval) { + dev_err(dev, "Failed to evict queues of pasid 0x%x\n", + pdd->pasid); + goto out; + } + } + /* Mark all queues as evicted. Deactivate all active queues on * the qpd. */ @@ -1525,7 +1575,7 @@ static int evict_process_queues_cpsch(struct device_queue_manager *dqm, q->properties.is_active = false; decrement_queue_count(dqm, qpd, q); - if (dqm->dev->kfd->shared_resources.enable_mes) { + if (dqm->dev->kfd->shared_resources.enable_mes && !remove_all) { retval = remove_queue_mes(dqm, q, qpd); if (retval) { dev_err(dev, "Failed to evict queue %d\n", @@ -3286,6 +3336,7 @@ static int process_termination_cpsch(struct device_queue_manager *dqm, enum kfd_unmap_queues_filter filter = KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES; bool found = false; + bool remove_all; dqm_lock(dqm); @@ -3298,6 +3349,15 @@ static int process_termination_cpsch(struct device_queue_manager *dqm, filter = KFD_UNMAP_QUEUES_FILTER_ALL_QUEUES; } + remove_all = dqm->dev->kfd->shared_resources.enable_mes && + amdgpu_mes_remove_all_process_queues_supported(dqm->dev->adev); + if (remove_all) { + retval = remove_queue_mes(dqm, NULL, qpd); + if (retval) + dev_err(dev, "Failed to remove queues of pasid 0x%x\n", + qpd_to_pdd(qpd)->pasid); + } + /* Clear all user mode queues */ list_for_each_entry(q, &qpd->queues_list, list) { if (q->properties.type == KFD_QUEUE_TYPE_SDMA) @@ -3308,7 +3368,7 @@ static int process_termination_cpsch(struct device_queue_manager *dqm, if (q->properties.is_active) { decrement_queue_count(dqm, qpd, q); - if (dqm->dev->kfd->shared_resources.enable_mes) { + if (dqm->dev->kfd->shared_resources.enable_mes && !remove_all) { retval = remove_queue_mes(dqm, q, qpd); if (retval) dev_err(dev, "Failed to remove queue %d\n", @@ -3610,7 +3670,17 @@ int kfd_dqm_suspend_bad_queue_mes(struct kfd_node *knode, u32 pasid, u32 doorbel list_for_each_entry(q, &qpd->queues_list, list) { if (q->doorbell_id == doorbell_id && q->properties.is_active) { - if (reset_queues_mes(dqm, q)) + struct mes_remove_queue_input queue_input; + + memset(&queue_input, 0x0, sizeof(struct mes_remove_queue_input)); + queue_input.doorbell_offset = q->properties.doorbell_off; + queue_input.gang_context_addr = q->gang_ctx_gpu_addr; + queue_input.gang_context_array_index = q->gang_ctx_array_index; + queue_input.queue_type = + convert_to_amdgpu_ring_type(q->properties.type); + queue_input.xcc_id = ffs(dqm->dev->xcc_mask) - 1; + + if (reset_queues_mes(dqm, pdd, &queue_input)) dev_dbg(knode->adev->dev, "Fail to remove bad queue. doorbell_id 0x%x\n", q->doorbell_id); q->properties.is_evicted = true; -- 2.56.0