Received: by 10.223.176.5 with SMTP id f5csp987498wra; Fri, 2 Feb 2018 09:17:37 -0800 (PST) X-Google-Smtp-Source: AH8x227UaO5O9ROww0xisQLKp8N/8EsTKVPdUGPRM/bFJUGVNtEnXrkHOoVl2gjtryCVB7fwj75y X-Received: by 10.99.138.199 with SMTP id y190mr4505071pgd.90.1517591856921; Fri, 02 Feb 2018 09:17:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517591856; cv=none; d=google.com; s=arc-20160816; b=ft1cre06hWQKgTqIvkBPs9v6jq7Z4AFKI1A25cwP54F9KCnApx5iPAKiZ/d4T5UVzH iCJ+AQnmx/UW7G2d8WqPe8tWeoPPtUKsl+zXOEgHf7cBaKGfCKhPTKoVIqbWZf951LAp MHlBTOboCLZqYj7Ipa5r+C68f8N1Yp2Dzd5eV6Se355QrZxrQUpzWtohSfM9CHzxdDLy cz/wfCzaBvymw/eZb4tUswcJ2XA9k9V1X2K+J9djsvOY0Slt1z9genjotN0vFFJwtNV2 o8es28HS4Bt2vf32AgXhTStp6eAp8YbwdJiC+a6eDuQVZSCj1fJYStyvsouH9wH2Kq/g Jykg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=X/EWyOMbDNpDN3pOiJXyH4jtHaQS2Vd8PKeBcNQVOp8=; b=uPkFqs/VIoyG7BFsaZduTWLU+G4dXIkHnl7oO08FomDqkD2dhBdJ/1X20Zx/o12RMh e3icYDI6dewrt92yqLIH1F/lOyak7QN+dHFa6TSpYj02bhOWUVz8GJcawpCjThAi2CmO EIX0v7ZZi7AV+aok7ZQmFLk0JqRICfDCxNNkDMzWwdFlPJ+DkYYcvopOipWR5VAtwmiT KqPRENMfoFIXxO9ebhJWP8I85lR0skURdy1w+J95ar17huRb4cty70EzIcjaSirmlkf/ ZHQ6M4GNrBSkL1TeVRMbrvTs33s3a/yCfjJiltelUP54koHSmuYfkectkq0TQ1HHUxzH crOA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p19-v6si2120443plo.199.2018.02.02.09.17.22; Fri, 02 Feb 2018 09:17:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753776AbeBBRPv (ORCPT + 99 others); Fri, 2 Feb 2018 12:15:51 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:38094 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753267AbeBBRJ4 (ORCPT ); Fri, 2 Feb 2018 12:09:56 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 144EADE5; Fri, 2 Feb 2018 17:09:55 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, shaoyun liu , Felix Kuehling , Oded Gabbay , Sasha Levin Subject: [PATCH 4.14 064/156] drm/amdkfd: Fix SDMA oversubsription handling Date: Fri, 2 Feb 2018 17:57:25 +0100 Message-Id: <20180202140843.187197082@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180202140840.242829545@linuxfoundation.org> References: <20180202140840.242829545@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Felix Kuehling [ Upstream commit 8c946b8988acec785bcf67088b6bd0747f36d2d3 ] SDMA only supports a fixed number of queues. HWS cannot handle oversubscription. Signed-off-by: shaoyun liu Signed-off-by: Felix Kuehling Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 18 +++++++++++++++++ 1 file changed, 18 insertions(+) --- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c @@ -184,6 +184,24 @@ int pqm_create_queue(struct process_queu switch (type) { case KFD_QUEUE_TYPE_SDMA: + if (dev->dqm->queue_count >= + CIK_SDMA_QUEUES_PER_ENGINE * CIK_SDMA_ENGINE_NUM) { + pr_err("Over-subscription is not allowed for SDMA.\n"); + retval = -EPERM; + goto err_create_queue; + } + + retval = create_cp_queue(pqm, dev, &q, properties, f, *qid); + if (retval != 0) + goto err_create_queue; + pqn->q = q; + pqn->kq = NULL; + retval = dev->dqm->ops.create_queue(dev->dqm, q, &pdd->qpd, + &q->properties.vmid); + pr_debug("DQM returned %d for create_queue\n", retval); + print_queue(q); + break; + case KFD_QUEUE_TYPE_COMPUTE: /* check if there is over subscription */ if ((sched_policy == KFD_SCHED_POLICY_HWS_NO_OVERSUBSCRIPTION) &&