Received: by 10.223.176.5 with SMTP id f5csp1138447wra; Fri, 2 Feb 2018 11:53:10 -0800 (PST) X-Google-Smtp-Source: AH8x227DRI+nNCVXmkqPiOsq3RTgiAdxqxQoBN6NcB89R2jDoapnVL+1q8roiwBHE858OTSOJyFq X-Received: by 10.99.185.78 with SMTP id v14mr2492694pgo.112.1517601190336; Fri, 02 Feb 2018 11:53:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517601190; cv=none; d=google.com; s=arc-20160816; b=tMeVDFrsaak10q0jLWoY9ooAcIu5hISP1uFpQyy/uDiddCh/m9ft1hnCaw5IHaV+ui ufFN7ZDDqD5/3qQONO4u3XoCGkuhufC5QMjdY2/3+ze43HQifqZtBrMy6qLjWeI55GGm SYbabg4yq/OJFlH3bvvB18To3AY3QwxKfAV+SonYXuiSqQQCCRjV0UUexh7E+u4qGft3 fe7yoI0CMjwKYh85iPkyRoEzFimsjahW8j4fpjpw9eWculC7jzsjQuVbkL262/303PHl AnDaKQEKienXYTH+cgKpvLPHNgdheaCUeg7lK74YHMQfVQGRJGxFQsQeyZT9sEDMBsCf 4j/g== 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=JIj7g/cSUXY8YZDVGsVZk/QDjlVg/TZPnPLdCHOWibQ=; b=umZup9NqqVFLbtm5MkyFWMMP1SowXmD89u+2ILpM5flodvRmoiaTjGceo8b6rNl1JX qpgvY2TNY8z6+wXfs4CcaPWuS/jaCNbz1CKFlWgwP2LMEECcUqF4uJN6FIqx0apDQQj9 sHIiXmC6Nu4f6lwd3CeLLMxWAEpYUyFx3j1YrxwteT87ylqO2hPBY6829j/zayMGahKA 4L7ZF4WxZroVLS4I7v2kLFb4d8nYCGnelTfK7OAaip0/yHBAY7C2Uzh4dkbo9NtNY+Z5 4m88MiZyYKZDwoGBy4pn4GFfA54NBNFzn6v/FgmuRxjlNp7lgVIySzCZIVXPi2hAg6uE 0zRQ== 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 d64si2380338pfa.40.2018.02.02.11.52.55; Fri, 02 Feb 2018 11:53:10 -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 S1754627AbeBBSYN (ORCPT + 99 others); Fri, 2 Feb 2018 13:24:13 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:35394 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752595AbeBBRCT (ORCPT ); Fri, 2 Feb 2018 12:02:19 -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 936ABDFF; Fri, 2 Feb 2018 17:02:18 +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.4 32/67] drm/amdkfd: Fix SDMA oversubsription handling Date: Fri, 2 Feb 2018 17:58:01 +0100 Message-Id: <20180202140819.157522461@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180202140815.091718203@linuxfoundation.org> References: <20180202140815.091718203@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.4-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 @@ -205,6 +205,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) &&