Received: by 10.223.176.46 with SMTP id f43csp280621wra; Tue, 23 Jan 2018 20:58:28 -0800 (PST) X-Google-Smtp-Source: AH8x226TQxhCaSPzjYmqiDSp0vNASWpPabxL2fzfRypGmZdr8kkFeUKhc4bF8e7fTGzHa9OHBVh3 X-Received: by 2002:a17:902:229:: with SMTP id 38-v6mr5203642plc.429.1516769908574; Tue, 23 Jan 2018 20:58:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516769908; cv=none; d=google.com; s=arc-20160816; b=ORcaKxcsPu5koLtlqIrVBEFF/WbBXLcgRBkWGoNgqDIcgvZ8pQxPpTtJpQrGMILiU2 15nub1DR1aR93rpq+R9peC5BgkEbN1dk4P6o7xTWih5uuiF/Uwntv6TlxmsDP1Liif7E R3c8zY3qjitgpU+l5Z94eIQbi0RymwbQBuJy9FcM4o2SiWLnQUaMp4BBRTxSoAyrj7ql KCJnOIzZhSNLF+nD9NHwMNd5ok5NKaQQaXIXO9wxSKUnCik5YbZ/vC1jr3JH9n/nSsme Ob8k7e7rxio7QxorlPTM8rB9+A5iGAxmeA+AG4WbYMl+4d1ImRiq/KQVGtjiaIbbNK8S DmQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=Y3Xa7E4Y8OOy5Yn0WEkGHTDHZt1h7QLrMX83mBRb30E=; b=vOhU089U24Jh5FFnvhb/Ky6R06yIHnOGkmaUWPcpvnoOw56pB6i9IfnvvyYbGuMo+c xlaO9tT8fxBK4kLvYs+si9/pq4RvQxp3SS32nflVwUn37bxwJeINM8+abwe3JddU9TCx JeT7MMT5V7iprwfhjd7cNyWKYWssU4gkRceshZxShRii48sqDZHFzXzui2yrxuFVRufj gEvQq1veCtXFN79eLOFfPz3btpX+C2vltAnE+9RhlXWEsILF6di7ZBZm87tC2zsYHemD F9z9/hQeSH85Vs+qCqBQC1q+5GtocJ04N8NRVNsZQvME6xyD6UpAUp8zL6RjS8fOKKKf Vmvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=abLBjZfX; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z66si2350906pfj.156.2018.01.23.20.58.15; Tue, 23 Jan 2018 20:58:28 -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=@microsoft.com header.s=selector1 header.b=abLBjZfX; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932167AbeAXEPT (ORCPT + 99 others); Tue, 23 Jan 2018 23:15:19 -0500 Received: from mail-sn1nam01on0111.outbound.protection.outlook.com ([104.47.32.111]:45037 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932149AbeAXEPP (ORCPT ); Tue, 23 Jan 2018 23:15:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Y3Xa7E4Y8OOy5Yn0WEkGHTDHZt1h7QLrMX83mBRb30E=; b=abLBjZfXJCiT+W9PH7shdP+oZIbt+gpEGxOw3WEGRA/whq3rrvB3RJ1JL6dnSYaZUstL6aixpWgQT4QDOtrQEmIZcoo22ZC3N64w5JVxrxjokw8lbyDPlr9ojsIqjIUQdlauH8fqQlWNBwbfMa4y3ltzDIQB37oCeUnE9rYTVzM= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0998.namprd21.prod.outlook.com (52.132.133.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.464.0; Wed, 24 Jan 2018 04:15:10 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::6485:b98:d15e:9da7]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::6485:b98:d15e:9da7%2]) with mapi id 15.20.0464.000; Wed, 24 Jan 2018 04:15:10 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Felix Kuehling , shaoyun liu , Oded Gabbay , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 035/100] drm/amdkfd: Fix SDMA oversubsription handling Thread-Topic: [PATCH AUTOSEL for 4.14 035/100] drm/amdkfd: Fix SDMA oversubsription handling Thread-Index: AQHTlMnbxiz8o9nag0KAD/rgBJ9f6Q== Date: Wed, 24 Jan 2018 04:14:41 +0000 Message-ID: <20180124041414.32065-35-alexander.levin@microsoft.com> References: <20180124041414.32065-1-alexander.levin@microsoft.com> In-Reply-To: <20180124041414.32065-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0998;7:kVwWsdUwEdDvXtZzB7clzVkrbSvqXmAqkKx5VemecsWaVlgEWzUdKBekR2M0Ay5ECTRtfh0PINfVlM9nCdNobPhOqJDCd3r2TGt4VnMMhXK/+LT+Fo51X5oS2SgjV+AUZerRzonWp+f7zo7x0rthtPtjqjG2IzSBpO3+lLoOez9O45q9yjROaYE/w9dDWRtWctObsyf0HFnD/cNcRnLfB39e8mGJKMXrWhd3lrBR2jgvuI0DyuWdSQ5LeHBt0VmJ x-ms-office365-filtering-correlation-id: 5d79e79c-b38d-48cf-707e-08d562e10f64 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(2017052603307)(7193020);SRVR:DM5PR2101MB0998; x-ms-traffictypediagnostic: DM5PR2101MB0998: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(85827821059158)(767451399110); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(6040501)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231046)(2400081)(944501161)(10201501046)(3002001)(6055026)(61426038)(61427038)(6041288)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB0998;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0998; x-forefront-prvs: 056297E276 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(39380400002)(346002)(39860400002)(396003)(376002)(199004)(189003)(14454004)(3660700001)(6346003)(10290500003)(105586002)(66066001)(6506007)(8676002)(22452003)(86612001)(54906003)(10090500001)(81166006)(81156014)(76176011)(110136005)(86362001)(68736007)(106356001)(8936002)(3280700002)(36756003)(25786009)(107886003)(39060400002)(2501003)(6666003)(99286004)(2906002)(26005)(2950100002)(72206003)(102836004)(305945005)(6116002)(3846002)(5660300001)(4326008)(478600001)(316002)(53936002)(97736004)(8666007)(2900100001)(5250100002)(6512007)(6436002)(6486002)(1076002)(7736002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0998;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: Xra4kn2TZGfgtIJ8MSav/5HMTBnRq5MdB1Yy+Xx9CGFCtjjpPADiHgCqkpJxdyDKOeerYV3Rb6nl4c6yIPKLRA== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5d79e79c-b38d-48cf-707e-08d562e10f64 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jan 2018 04:14:41.2677 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0998 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 18 ++++++++++++++= ++++ 1 file changed, 18 insertions(+) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c b/drive= rs/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c index 03bec765b03d..f9a1a4db9be7 100644 --- 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_queue_manager *pqm= , =20 switch (type) { case KFD_QUEUE_TYPE_SDMA: + if (dev->dqm->queue_count >=3D + CIK_SDMA_QUEUES_PER_ENGINE * CIK_SDMA_ENGINE_NUM) { + pr_err("Over-subscription is not allowed for SDMA.\n"); + retval =3D -EPERM; + goto err_create_queue; + } + + retval =3D create_cp_queue(pqm, dev, &q, properties, f, *qid); + if (retval !=3D 0) + goto err_create_queue; + pqn->q =3D q; + pqn->kq =3D NULL; + retval =3D 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 =3D=3D KFD_SCHED_POLICY_HWS_NO_OVERSUBSCRIPTION) && --=20 2.11.0