Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1639403ybv; Fri, 21 Feb 2020 00:48:34 -0800 (PST) X-Google-Smtp-Source: APXvYqwi5nL0rt2K/t/Rt0R9xs9w6F5leFJ3n8sLou8QwHTtLbsxnTuzgLpZGM8dPaQNaK5AXxwS X-Received: by 2002:a05:6808:5d1:: with SMTP id d17mr1078760oij.129.1582274914586; Fri, 21 Feb 2020 00:48:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582274914; cv=none; d=google.com; s=arc-20160816; b=tDvu3f9YBjlIHiV6k4HUupKpHutcW4XUyitv2AO7ezt/xw2BBikkNozFc039EfEoAc ovLlhF8vbac+Ek/NbCllxn2wNGm71PIeqNdCTxZnR1FeJuWlSmnUcOGBJ3Dk91nJ6q7/ nJ5zkgyh6unapypKkNhWVoPzPirxphKdWg6EEt2SHdhIH5KdBFy/VIslqSG0Ysp5mKoU FORf2T2bkl9XQ/mQQGDlqlNinG14hSx2mvsqzqHlxugrzd7rL7GMklzBTFnsw2iyI8vf 4X3c1/j9vGQtk9YmIFDxvtmDm6D9z2h0Lz74rejND5gxU/eaCiwNctT2S67NDsNJw4o8 AwWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=yKwW0daKMNKKRHEpIIAAVb749jZrHte47BvYTnhVFRY=; b=vEdFZjI1+9zoDcNnj3zI+xR1jz3/yHCRETBmdkcOZxREvF2Y3gPyz5fdHJwOthiCfK NAVxoOGIzlb4pWmdOoXR0Jm8guX6AEE04JbQ0aTDVWYlx/5nNSSNbm2q5hd3K1KohcYH b5rRg8oXwAXNCJe5p6xNP4uFtwBYqiUKO44v4DSDKyrxHZwQIPl6QPAnY/5UPSh1hkLN PXzZu4aNla+lc7JQuVNgKx5bko4+UAHhlARwv8mvm70XjtoXVykb2nkmPPTsNM4D+4FO L8CFoy1dSObgpp5ehU5yNGTMsEqTrJheWuXyed0g3mfXwuBekW3GfceLWA27HQ/1r60/ v93A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FJ1MXocC; 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 q189si507183oic.235.2020.02.21.00.48.22; Fri, 21 Feb 2020 00:48:34 -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; dkim=pass header.i=@kernel.org header.s=default header.b=FJ1MXocC; 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 S1728358AbgBUHr6 (ORCPT + 99 others); Fri, 21 Feb 2020 02:47:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:43828 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728987AbgBUHrx (ORCPT ); Fri, 21 Feb 2020 02:47:53 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1080F20801; Fri, 21 Feb 2020 07:47:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582271272; bh=mEbUikUJPdO2aLyeQBlvtyjvsrmBOXxH5GFU6k+4vuM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FJ1MXocCoyQFYHAvjxogztXqCmqP+ZJX7Iim2aw2fl8OUw/Ho6uEklCsNXE5j2BAl 9x5lbj408sMTHZGaijwQYaCfDhcd9ufVhH+JTNC2zIsNWSM8Sl7u7pSaNijM8SFkwE Ct9j7V2AzvrZPSqiSIxU6TZPClKSTHEo6p46A7WE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yong Zhao , Felix Kuehling , Alex Deucher , Sasha Levin Subject: [PATCH 5.5 102/399] drm/amdkfd: Fix a bug in SDMA RLC queue counting under HWS mode Date: Fri, 21 Feb 2020 08:37:07 +0100 Message-Id: <20200221072412.329629826@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200221072402.315346745@linuxfoundation.org> References: <20200221072402.315346745@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yong Zhao [ Upstream commit f38abc15d157b7b31fa7f651dc8bf92858c963f8 ] The sdma_queue_count increment should be done before execute_queues_cpsch(), which calls pm_calc_rlib_size() where sdma_queue_count is used to calculate whether over_subscription is triggered. With the previous code, when a SDMA queue is created, compute_queue_count in pm_calc_rlib_size() is one more than the actual compute queue number, because the queue_count has been incremented while sdma_queue_count has not. This patch fixes that. Signed-off-by: Yong Zhao Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 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 984c2f2b24b60..d128a8bbe19d0 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c @@ -1225,16 +1225,18 @@ static int create_queue_cpsch(struct device_queue_manager *dqm, struct queue *q, list_add(&q->list, &qpd->queues_list); qpd->queue_count++; + + if (q->properties.type == KFD_QUEUE_TYPE_SDMA) + dqm->sdma_queue_count++; + else if (q->properties.type == KFD_QUEUE_TYPE_SDMA_XGMI) + dqm->xgmi_sdma_queue_count++; + if (q->properties.is_active) { dqm->queue_count++; retval = execute_queues_cpsch(dqm, KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES, 0); } - if (q->properties.type == KFD_QUEUE_TYPE_SDMA) - dqm->sdma_queue_count++; - else if (q->properties.type == KFD_QUEUE_TYPE_SDMA_XGMI) - dqm->xgmi_sdma_queue_count++; /* * Unconditionally increment this counter, regardless of the queue's * type or whether the queue is active. -- 2.20.1