From patchwork Fri Dec 13 16:54:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 11291265 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 62603188B for ; Fri, 13 Dec 2019 21:09:57 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 39C272467A for ; Fri, 13 Dec 2019 21:09:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="NLIwunO7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 39C272467A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ED73F6E2E6; Fri, 13 Dec 2019 16:54:20 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2062.outbound.protection.outlook.com [40.107.243.62]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2A02C6E2E3; Fri, 13 Dec 2019 16:54:19 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TGEVdoGqpPScPY7B3nARUKrufw543XMc4ESEqXE2f7pdD7q2OrMF2fy/4p6rnVUJAIaHghz6H0EN6qOUrnv36IuX5aHymQ5CiX7ouEx/fe63M9liazAxdLbEocVa1C9njURJJwD6vse7PkYG3BTRtWvHgSCIhUUbgGwKAByKTS4J2oWWuMrHODDZkAHvQll1Vw4tv9uBmej3MmwBZUPPQ+Y+Qg8rosgkMaARGVWG8qYLsDJJYeSkbJ7NgS7O7DKGN/sulf9gX/6oTOLESyoqjXUW6i52y7WHbRUvVCwJIOxTuOWY+4IAaFG22F0O6slz1BLrjGQ2sZLrOV1JlIfWkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NDwg+b2cbwvlRGEvcobvo1+FkdCcR9r5kl2HPayfpko=; b=jh95sHBu5SEpFZ0WIHvXbHpNFGeRRY7qH9uzllvxJTmlaG0whQl5p1VPzSuFcqiA0LjV60iMeqj4OYuyAHGgFg8s21cua65srGnDDkHZjAancMCLwJC3kgI1OlSBz1HIw6ciVKdcBHuJTq6ztdck7/+2dgOAbEJcxWOIWFJgBwe1OU0wjW7tFLnRFLKVbgEbeMo0AQBetjFoDM5ZPa1TsqzTH2lQXzrygppO8gh1qV+rg65Vc4BdOs6VDOxwFduaayTtMUjWTnQ21GXgq1Hn9vzAzMUjssJ0OhAKNeMiAmLWpU8iGN/3fDfgdK+tki+xn4ncz4W9dLOQGyqO9WPjwA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=permerror action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NDwg+b2cbwvlRGEvcobvo1+FkdCcR9r5kl2HPayfpko=; b=NLIwunO75JdFdWRmsjhlKns9b61l8YT45/Y6KgD6u/Yrv0QwznwaXQH+l0/lM91XxDJwjbwWbVdYG+hN/4bMsCP/LtvOTtAZEQuvnQlRQAddqMKcqTnFvevZhNEjjBgdN6sSH1gZ2Npnf+674O1zNU0Jg0NQkm+X4k6hNJQabpY= Received: from DM3PR12CA0115.namprd12.prod.outlook.com (2603:10b6:0:51::11) by MN2PR12MB3389.namprd12.prod.outlook.com (2603:10b6:208:ca::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.16; Fri, 13 Dec 2019 16:54:17 +0000 Received: from CO1NAM11FT016.eop-nam11.prod.protection.outlook.com (2a01:111:f400:7eab::205) by DM3PR12CA0115.outlook.office365.com (2603:10b6:0:51::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.17 via Frontend Transport; Fri, 13 Dec 2019 16:54:16 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXMB01.amd.com (165.204.84.17) by CO1NAM11FT016.mail.protection.outlook.com (10.13.175.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.2538.14 via Frontend Transport; Fri, 13 Dec 2019 16:54:15 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB01.amd.com (10.181.40.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 13 Dec 2019 10:54:15 -0600 Received: from SATLEXMB01.amd.com (10.181.40.142) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 13 Dec 2019 10:54:14 -0600 Received: from agrodzovsky-All-Series.amd.com (10.180.168.240) by SATLEXMB01.amd.com (10.181.40.142) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Fri, 13 Dec 2019 10:54:14 -0600 From: Andrey Grodzovsky To: , Subject: [PATCH v2 1/5] drm/amdgpu: reverts commit b01245ff54db66073b104ac9d9fbefb7b264b36d. Date: Fri, 13 Dec 2019 11:54:05 -0500 Message-ID: <1576256049-12838-1-git-send-email-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(376002)(136003)(346002)(39860400002)(396003)(428003)(189003)(199004)(81166006)(2616005)(316002)(54906003)(44832011)(8936002)(86362001)(26005)(5660300002)(81156014)(110136005)(2906002)(186003)(356004)(6666004)(426003)(478600001)(450100002)(8676002)(336012)(36756003)(7696005)(4326008)(70586007)(70206006); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR12MB3389; H:SATLEXMB01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c9706983-3f69-45ec-014d-08d77fed16ad X-MS-TrafficTypeDiagnostic: MN2PR12MB3389: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:546; X-Forefront-PRVS: 0250B840C1 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oXgTabTY+ZWYrQG1aSUaQuan1LdugeExtgCPHgCW4/tvodrrZb769Fn4y06yVJ1nkRwtMfcauTY3pGgob91BwXox+DUenSwJDnB1IoBTtQlg+JJGPdqUL1+FsibkvDS1fTeBzg9r6uPwsVmeZoIIwMnbvfn93MvpqIA/UOwz7F4VcXCNruDWM6CXyEZrEtf/NNPuT2PIAz7aHisFMyFHot9hBnpop6JWYYzQHJjVEpKokTeNmRm7s2c22w6xgtiOkVjh65ypKZYe4xMv0oQFU4m8n/IZ89f+iFo2x9E4SwUY+mbdopfszngcn+NO1GNksgEmnB52uZltCS9p/h+edjGuUTem+mJPEFXqoN06xnYDcQlTF+mM55p3+sv1dJksLSr7aT+YQySS1WHeM/qO72BwQnx5dyk8iQzQbORyxmsMiyRLGGBTq0LqnXRVUy0n X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2019 16:54:15.9006 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c9706983-3f69-45ec-014d-08d77fed16ad 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=[SATLEXMB01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3389 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexander.Deucher@amd.com, Le.Ma@amd.com, Evan.Quan@amd.com, hawking.zhang@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" In preparation for doing XGMI reset synchronization using task barrier. Signed-off-by: Andrey Grodzovsky Reviewed-by: Le Ma Signed-off-by: Andrey Grodzovsky > Reviewed-by: Le Ma > --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 - drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 76 +++++------------------------- 2 files changed, 12 insertions(+), 66 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index a78a363..50bab33 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -1001,8 +1001,6 @@ struct amdgpu_device { bool pm_sysfs_en; bool ucode_sysfs_en; - - bool in_baco; }; static inline struct amdgpu_device *amdgpu_ttm_adev(struct ttm_bo_device *bdev) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 7324a5f..1d19edfa 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -2667,7 +2667,7 @@ static void amdgpu_device_xgmi_reset_func(struct work_struct *__work) if (amdgpu_asic_reset_method(adev) == AMD_RESET_METHOD_BACO) adev->asic_reset_res = (adev->in_baco == false) ? amdgpu_device_baco_enter(adev->ddev) : - amdgpu_device_baco_exit(adev->ddev); + qamdgpu_device_baco_exit(adev->ddev); else adev->asic_reset_res = amdgpu_asic_reset(adev); @@ -3796,18 +3796,13 @@ static int amdgpu_device_pre_asic_reset(struct amdgpu_device *adev, return r; } -static int amdgpu_do_asic_reset(struct amdgpu_device *adev, - struct amdgpu_hive_info *hive, +static int amdgpu_do_asic_reset(struct amdgpu_hive_info *hive, struct list_head *device_list_handle, bool *need_full_reset_arg) { struct amdgpu_device *tmp_adev = NULL; bool need_full_reset = *need_full_reset_arg, vram_lost = false; int r = 0; - int cpu = smp_processor_id(); - bool use_baco = - (amdgpu_asic_reset_method(adev) == AMD_RESET_METHOD_BACO) ? - true : false; /* * ASIC reset has to be done on all HGMI hive nodes ASAP @@ -3815,62 +3810,22 @@ static int amdgpu_do_asic_reset(struct amdgpu_device *adev, */ if (need_full_reset) { list_for_each_entry(tmp_adev, device_list_handle, gmc.xgmi.head) { - /* - * For XGMI run all resets in parallel to speed up the - * process by scheduling the highpri wq on different - * cpus. For XGMI with baco reset, all nodes must enter - * baco within close proximity before anyone exit. - */ + /* For XGMI run all resets in parallel to speed up the process */ if (tmp_adev->gmc.xgmi.num_physical_nodes > 1) { - if (!queue_work_on(cpu, system_highpri_wq, - &tmp_adev->xgmi_reset_work)) + if (!queue_work(system_highpri_wq, &tmp_adev->xgmi_reset_work)) r = -EALREADY; - cpu = cpumask_next(cpu, cpu_online_mask); } else r = amdgpu_asic_reset(tmp_adev); - if (r) - break; - } - - /* For XGMI wait for all work to complete before proceed */ - if (!r) { - list_for_each_entry(tmp_adev, device_list_handle, - gmc.xgmi.head) { - if (tmp_adev->gmc.xgmi.num_physical_nodes > 1) { - flush_work(&tmp_adev->xgmi_reset_work); - r = tmp_adev->asic_reset_res; - if (r) - break; - if (use_baco) - tmp_adev->in_baco = true; - } - } - } - /* - * For XGMI with baco reset, need exit baco phase by scheduling - * xgmi_reset_work one more time. PSP reset and sGPU skips this - * phase. Not assume the situation that PSP reset and baco reset - * coexist within an XGMI hive. - */ - - if (!r && use_baco) { - cpu = smp_processor_id(); - list_for_each_entry(tmp_adev, device_list_handle, - gmc.xgmi.head) { - if (tmp_adev->gmc.xgmi.num_physical_nodes > 1) { - if (!queue_work_on(cpu, - system_highpri_wq, - &tmp_adev->xgmi_reset_work)) - r = -EALREADY; - if (r) - break; - cpu = cpumask_next(cpu, cpu_online_mask); - } + if (r) { + DRM_ERROR("ASIC reset failed with error, %d for drm dev, %s", + r, tmp_adev->ddev->unique); + break; } } - if (!r && use_baco) { + /* For XGMI wait for all PSP resets to complete before proceed */ + if (!r) { list_for_each_entry(tmp_adev, device_list_handle, gmc.xgmi.head) { if (tmp_adev->gmc.xgmi.num_physical_nodes > 1) { @@ -3878,21 +3833,15 @@ static int amdgpu_do_asic_reset(struct amdgpu_device *adev, r = tmp_adev->asic_reset_res; if (r) break; - tmp_adev->in_baco = false; } } } - - if (r) { - DRM_ERROR("ASIC reset failed with error, %d for drm dev, %s", - r, tmp_adev->ddev->unique); - goto end; - } } if (!r && amdgpu_ras_intr_triggered()) amdgpu_ras_intr_cleared(); + list_for_each_entry(tmp_adev, device_list_handle, gmc.xgmi.head) { if (need_full_reset) { /* post card */ @@ -4181,8 +4130,7 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev, if (r) adev->asic_reset_res = r; } else { - r = amdgpu_do_asic_reset(adev, hive, device_list_handle, - &need_full_reset); + r = amdgpu_do_asic_reset(hive, device_list_handle, &need_full_reset); if (r && r == -EAGAIN) goto retry; } From patchwork Fri Dec 13 16:54:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 11291263 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2BEA46C1 for ; Fri, 13 Dec 2019 21:09:57 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 017CD2467A for ; Fri, 13 Dec 2019 21:09:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="JLkTH0Li" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 017CD2467A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 79FF86EB07; Fri, 13 Dec 2019 16:54:21 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2074.outbound.protection.outlook.com [40.107.244.74]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2A8026E2E3; Fri, 13 Dec 2019 16:54:20 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E9JPNsBFEt3MQi9RxT+/gTyXgzHiWKRX9FD/+LF77F036CXxWBhZuGPuNw3on9XBQgZaEk38ErdhplckQ8pNM9cRHtVc2CJGjf0afD7e7yZKmemOfjQsu6fG3JTErfLj4C9cSO21QPeF/0EW2s0WeyND8is/Hiebudqr2ySLytipEusoc0mjmhgU5f3Svxb8F3zAa3vOJQCckDYrJonptl5OEg6TKo0tGBvFva8WjudOho9KHScVR9FtzTcG0MnT6urD0JzbHvcf3gI1WzPO/4p0NZF+rYxioECpzGuO0wdSzp/jfEg7Ijn8sBRLt/Kx8cMX6Y46D99cvGSA1gCyKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=P9hLAlbOBcOrvhJTLP7Z5HWVHFACHBIs8J6Zs6QsJwM=; b=XOUgpRkscKe2ztXAKPJ3BcGR5DdieyNqai0Z8QRNL0DnRITDfdXaWOsYV78AXaspT3Zouj+x4uZbGPe4HYL/pcowEY7FX3L9P/7K6AWxpOYig0Jg8MmB8NCjQhyYefDgZMKytot/ZCFa0HYtUqb6CdiIFU8Q77ZLnmPVx8nxhPNSCDtzNEsnpCTtXI6EHXEUfmK/wkiaphku9bwefMWH1vhbpbitfl0PfDx8RoGO8Xh93xvKSYUuPsKM3WFeXdjOw9/zx5hzKfZ2SXGLVrM/yRVhIQ3AtCGfhcstyMY8llhdgEl1fduvgCO9+T3Y+S96RNKD9T55gczdHgxu93fsMw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=permerror action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=P9hLAlbOBcOrvhJTLP7Z5HWVHFACHBIs8J6Zs6QsJwM=; b=JLkTH0Li2Q5CR01yHje2pVVA+wPPVkls50DMsQEbeKNdMSn5C5Y+s1wRucsnSQOqmM9qFLH1HM3wAmPU6PPeicBeCuJ4B1LPd+hpkPJKVF0Vg5LXGHrfBW6y0wV1w5t77RsWYk3cwZb4b+8+KXVzuXoBKmTWdVStx5V0FTqcCC4= Received: from MWHPR12CA0071.namprd12.prod.outlook.com (2603:10b6:300:103::33) by BYAPR12MB2872.namprd12.prod.outlook.com (2603:10b6:a03:12e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2516.17; Fri, 13 Dec 2019 16:54:18 +0000 Received: from BN8NAM11FT067.eop-nam11.prod.protection.outlook.com (2a01:111:f400:7eae::204) by MWHPR12CA0071.outlook.office365.com (2603:10b6:300:103::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.15 via Frontend Transport; Fri, 13 Dec 2019 16:54:18 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXMB02.amd.com (165.204.84.17) by BN8NAM11FT067.mail.protection.outlook.com (10.13.177.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.2538.14 via Frontend Transport; Fri, 13 Dec 2019 16:54:17 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB02.amd.com (10.181.40.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 13 Dec 2019 10:54:16 -0600 Received: from SATLEXMB01.amd.com (10.181.40.142) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 13 Dec 2019 10:54:16 -0600 Received: from agrodzovsky-All-Series.amd.com (10.180.168.240) by SATLEXMB01.amd.com (10.181.40.142) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Fri, 13 Dec 2019 10:54:15 -0600 From: Andrey Grodzovsky To: , Subject: [PATCH v2 2/5] drm: Add Reusable task barrier. Date: Fri, 13 Dec 2019 11:54:06 -0500 Message-ID: <1576256049-12838-2-git-send-email-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1576256049-12838-1-git-send-email-andrey.grodzovsky@amd.com> References: <1576256049-12838-1-git-send-email-andrey.grodzovsky@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(136003)(39850400004)(376002)(346002)(396003)(428003)(189003)(199004)(966005)(36756003)(4326008)(26005)(86362001)(8936002)(316002)(450100002)(110136005)(186003)(7696005)(54906003)(426003)(70206006)(8676002)(44832011)(478600001)(70586007)(5660300002)(81166006)(2616005)(6666004)(336012)(2906002)(356004)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR12MB2872; H:SATLEXMB02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 24b25414-3d85-4da1-a014-08d77fed177d X-MS-TrafficTypeDiagnostic: BYAPR12MB2872: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-Forefront-PRVS: 0250B840C1 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +eJuq7N5lx1Ubrc+pjnhU6PdJcKZ/02RzyADqv1puLUncNr5PZ+ErflZhQMHxnc9tWx/ZXu0peWSPD3uWzk+uqGRgQ8996F2Nkiu6iydtBYWgw7iliIIGVh5dvCVof2etoYImkCvVygXxgMfGFqYCn7iO+PDdNiAvLsXsyRAFOkc6SA1eqY0iM/6JI8G7sU/W7R3TKkLyLvQxSQcf1//SfMYs7Y7eSXY06+2nkBbMViBvPWv/RP4BoYcxxXbo/LcdjWISv7wLqHapgc2c4qkMnkLpZphvfS3zFqXbu2G/NB5B8obkXk13i6qKO1X6ox/KIpfgFgxdvZ1yxmLQblaf6JOLh4XLrbu1uijt84F7601wiZEwLPFbyzBmY2WK11ppVEzIwibczsqnT3+/RPRfOrKLziRvAK2mH5zjHJ9Ys/EZP0CiKTFpB/9X7FIZRadHBVXTa8OnIfXKZEG3z8FDwF30n21+GrYSCBBhGzJ5po= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2019 16:54:17.2008 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 24b25414-3d85-4da1-a014-08d77fed177d 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=[SATLEXMB02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB2872 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexander.Deucher@amd.com, Le.Ma@amd.com, Evan.Quan@amd.com, hawking.zhang@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" It is used to synchronize N threads at a rendevouz point before execution of critical code that has to be started by all the threads at approximatly the same time. v2: Remove mention of reset use case, improve doc. Signed-off-by: Andrey Grodzovsky --- include/drm/task_barrier.h | 107 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 include/drm/task_barrier.h diff --git a/include/drm/task_barrier.h b/include/drm/task_barrier.h new file mode 100644 index 0000000..087e3f6 --- /dev/null +++ b/include/drm/task_barrier.h @@ -0,0 +1,107 @@ +/* + * Copyright 2019 Advanced Micro Devices, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + */ +#include +#include + +/* + * Reusable 2 PHASE task barrier (randevouz point) implementation for N tasks. + * Based on the Little book of sempahores - https://greenteapress.com/wp/semaphores/ + */ + + + +#ifndef DRM_TASK_BARRIER_H_ +#define DRM_TASK_BARRIER_H_ + +/* + * Represents an instance of a task barrier. + */ +struct task_barrier { + unsigned int n; + atomic_t count; + struct semaphore enter_turnstile; + struct semaphore exit_turnstile; +}; + +static inline void task_barrier_signal_turnstile(struct semaphore *turnstile, + unsigned int n) +{ + int i; + + for (i = 0 ; i < n; i++) + up(turnstile); +} + +static inline void task_barrier_init(struct task_barrier *tb) +{ + tb->n = 0; + atomic_set(&tb->count, 0); + sema_init(&tb->enter_turnstile, 0); + sema_init(&tb->exit_turnstile, 0); +} + +static inline void task_barrier_add_task(struct task_barrier *tb) +{ + tb->n++; +} + +static inline void task_barrier_rem_task(struct task_barrier *tb) +{ + tb->n--; +} + +/* + * Lines up all the threads BEFORE the critical point. + * + * When all thread passed this code the entry barrier is back to locked state. + */ +static inline void task_barrier_enter(struct task_barrier *tb) +{ + if (atomic_inc_return(&tb->count) == tb->n) + task_barrier_signal_turnstile(&tb->enter_turnstile, tb->n); + + down(&tb->enter_turnstile); +} + +/* + * Lines up all the threads AFTER the critical point. + * + * This function is used to avoid any one thread running ahead if the barrier is + * used repeatedly . + */ +static inline void task_barrier_exit(struct task_barrier *tb) +{ + if (atomic_dec_return(&tb->count) == 0) + task_barrier_signal_turnstile(&tb->exit_turnstile, tb->n); + + down(&tb->exit_turnstile); +} + +/* Convinieince function when nothing to be done in between entry and exit */ +static inline void task_barrier_full(struct task_barrier *tb) +{ + task_barrier_enter(tb); + task_barrier_exit(tb); +} + +#endif From patchwork Fri Dec 13 16:54:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 11291271 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EFA661902 for ; Fri, 13 Dec 2019 21:09:57 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C342A206E2 for ; Fri, 13 Dec 2019 21:09:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="qlagc9IY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C342A206E2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1FFC36EB25; Fri, 13 Dec 2019 16:54:24 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM04-CO1-obe.outbound.protection.outlook.com (mail-eopbgr690086.outbound.protection.outlook.com [40.107.69.86]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9A7266EB1E; Fri, 13 Dec 2019 16:54:21 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IJaGpV890HTutxrX6He/6F4DudhL5A8gSozksU4CJPP93OrJAELadDt4wCOULl8DD2ZSlXlhmymza6EdrAcymz9w9J/2KO12cRXz4LBxPT2XxUW+Pq7rkfabE2JcaTDdSMKBKYygRWN55NFoLskvtJdMWqGLiPyGldVdna1uQBPyU262bWOU2DU6k4xFvN1JiZhynodzg84B4tUGcBpGfv0TnqVJP5YateqYtzb0dQ7BOKmjHYW4OHvi7xGVdDCwD6kAZoJIB7eYF6mEX8xjj/jlRfTzH9dSLP2Q0ry0GgbswXl0e7oTusrNKEJKRz4rcj9qvIXPU+2RqG+ayZb8VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=S7YCTovCGCupkwEREoIPbAFjwbGRtVuJJLOKH97FXfg=; b=G15p/jP/Df33zN/AmpIGTCuwGVIfukIZMyT1xAQz0bCP2beu9e0i7KJ/5ftCZgZ0iyMnvXZ+XxSRFYRfYdf79T6Wq6v0XoO3832S5HLWM9rDRW0MJjEWMUqM6fXx1iz/S634Lvpx+Lwv/aaycGGi3ZkxR/oc5WtGMMIVg8FCkBZ6+izU0DiVa9lyxhoKj+bCIypW7FvaRI5pYaef/HyNoin4QA+vG/X7Pu3qUmkyhk76YksRkLmxJ0S41LANGL5EmAM/l2pbTeEGkfFqOttyQtagMR40wZ9GJQA3tS/w4a/dHJbL/TdRJ5bca2ajc2SMCqcNrnIscAmBtHp4qsZ+xg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=permerror action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=S7YCTovCGCupkwEREoIPbAFjwbGRtVuJJLOKH97FXfg=; b=qlagc9IY5hM7PDEORKaeVZ2IV3k/ABOGmahLtEnahbZ5/BfYuChf5/qGYIMQD0COu/KRLg6aUFHnOtD5/Wlk7ax9UuCpW6y3ALWdL4/dmhDCD92RJqdEMxnRpOql+wq1MI53DAPaVJPGkWuPJjqBhuaXtd706OThMg5FHeH5vqE= Received: from CY4PR1201CA0002.namprd12.prod.outlook.com (2603:10b6:910:16::12) by BN6PR12MB1395.namprd12.prod.outlook.com (2603:10b6:404:1f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.15; Fri, 13 Dec 2019 16:54:20 +0000 Received: from CO1NAM11FT054.eop-nam11.prod.protection.outlook.com (2a01:111:f400:7eab::201) by CY4PR1201CA0002.outlook.office365.com (2603:10b6:910:16::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.17 via Frontend Transport; Fri, 13 Dec 2019 16:54:19 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXMB01.amd.com (165.204.84.17) by CO1NAM11FT054.mail.protection.outlook.com (10.13.174.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.2538.14 via Frontend Transport; Fri, 13 Dec 2019 16:54:18 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB01.amd.com (10.181.40.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 13 Dec 2019 10:54:18 -0600 Received: from SATLEXMB01.amd.com (10.181.40.142) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 13 Dec 2019 10:54:17 -0600 Received: from agrodzovsky-All-Series.amd.com (10.180.168.240) by SATLEXMB01.amd.com (10.181.40.142) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Fri, 13 Dec 2019 10:54:17 -0600 From: Andrey Grodzovsky To: , Subject: [PATCH v2 3/5] drm/amdgpu: Add task barrier to XGMI hive. Date: Fri, 13 Dec 2019 11:54:07 -0500 Message-ID: <1576256049-12838-3-git-send-email-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1576256049-12838-1-git-send-email-andrey.grodzovsky@amd.com> References: <1576256049-12838-1-git-send-email-andrey.grodzovsky@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(396003)(136003)(376002)(39850400004)(346002)(428003)(189003)(199004)(186003)(356004)(26005)(6666004)(336012)(7696005)(44832011)(70586007)(70206006)(450100002)(478600001)(4326008)(86362001)(54906003)(8936002)(110136005)(81156014)(81166006)(2616005)(2906002)(8676002)(426003)(316002)(36756003)(5660300002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR12MB1395; H:SATLEXMB01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c6f71fd3-0122-4b3e-f53c-08d77fed1873 X-MS-TrafficTypeDiagnostic: BN6PR12MB1395: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:913; X-Forefront-PRVS: 0250B840C1 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6n75C5YyGqZs84dGdUEA/O061I53L/nktNny0ii58O7hf/xINGCQa9QpFW+VjdV8TEp9Pd7WFXrqlxLhXgJh2c7c8mNdFqnYaRV0so9nehm5qeP05YexzZiuSoXN9dWIY3808ekIl43fRYs6ibDNcXca5nkFYd5L20JO95XvgyWPF2rxjo1WripVwfKLetsnWlm5Vty/pB2JT4dOe/Cx9BmucyoFgkTapGfvIKPYG2jQzqLK5axpNQUJtCQ6FaWQiNMqXhN48vMZWEobUmf+dOxAyC8EMOiwaddnBJE/ovrkhjbEqMMRYkvW0Gthf0dIUYh3zjL1O+nPz06WhBktV2lTDg2S5llJcNCYJ7Ymtcm+hUY6q8GCSh6L+ajegbvNBzoWhwgMBguR30cuS1ODZFsnb0AidNSBcpUCwDK2cOIT0sqZLSnomFKCO6SbTOQI X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2019 16:54:18.8842 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c6f71fd3-0122-4b3e-f53c-08d77fed1873 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=[SATLEXMB01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1395 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexander.Deucher@amd.com, Le.Ma@amd.com, Evan.Quan@amd.com, hawking.zhang@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Signed-off-by: Andrey Grodzovsky Reviewed-by: Le Ma --- drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 4 ++++ drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c index 61d13d8..5cf920d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c @@ -261,6 +261,7 @@ struct amdgpu_hive_info *amdgpu_get_xgmi_hive(struct amdgpu_device *adev, int lo INIT_LIST_HEAD(&tmp->device_list); mutex_init(&tmp->hive_lock); mutex_init(&tmp->reset_lock); + task_barrier_init(&tmp->tb); if (lock) mutex_lock(&tmp->hive_lock); @@ -408,6 +409,8 @@ int amdgpu_xgmi_add_device(struct amdgpu_device *adev) top_info->num_nodes = count; hive->number_devices = count; + task_barrier_add_task(&hive->tb); + if (amdgpu_device_ip_get_ip_block(adev, AMD_IP_BLOCK_TYPE_PSP)) { list_for_each_entry(tmp_adev, &hive->device_list, gmc.xgmi.head) { /* update node list for other device in the hive */ @@ -470,6 +473,7 @@ void amdgpu_xgmi_remove_device(struct amdgpu_device *adev) mutex_destroy(&hive->hive_lock); mutex_destroy(&hive->reset_lock); } else { + task_barrier_rem_task(&hive->tb); amdgpu_xgmi_sysfs_rem_dev_info(adev, hive); mutex_unlock(&hive->hive_lock); } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.h index bbf504f..74011fb 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.h @@ -22,6 +22,7 @@ #ifndef __AMDGPU_XGMI_H__ #define __AMDGPU_XGMI_H__ +#include #include "amdgpu_psp.h" struct amdgpu_hive_info { @@ -33,6 +34,7 @@ struct amdgpu_hive_info { struct device_attribute dev_attr; struct amdgpu_device *adev; int pstate; /*0 -- low , 1 -- high , -1 unknown*/ + struct task_barrier tb; }; struct amdgpu_hive_info *amdgpu_get_xgmi_hive(struct amdgpu_device *adev, int lock); From patchwork Fri Dec 13 16:54:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 11291277 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 593E61AA3 for ; Fri, 13 Dec 2019 21:09:58 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2FCCB24692 for ; Fri, 13 Dec 2019 21:09:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="SfdSW/Og" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2FCCB24692 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 514C86EB26; Fri, 13 Dec 2019 16:54:25 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2069.outbound.protection.outlook.com [40.107.244.69]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5936F6EB20; Fri, 13 Dec 2019 16:54:22 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vhu4fvjFgfigeuGCeZfrZzBQO+EsF0QDlLFMpCr4Cspx+RIHTQY6C92NvOO44aAFblFf6rO7R2CpqOQRH/6wZocFDBGg5AnV76eG6yVs2EXDVutA3obwv3Om5WwqIxA90UPcypUJacjRvOI8iy1dWt1ebmgfb9LMvZfH/IpGrVl7EHfeNcVo/YZKa08OaFaiF58Wbx4MwQgI0s698pUo4jJ2ENh+kW7s/5EavJ79kPFSeNh1bCICS7v6gzHB/jB9j8rAP22Ai7jGTAziRA0jIdfIuCmPy4U7LxYC7dhFhhQcZV2xQ3IYeAjJRQg/lg/16dWgdmcZOLfyfGUCJtveqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zNH2v+Pq0texW9HG5gKRtqnHAfB4p9nn4My1m3Yxh+U=; b=CxM2V/zEJwIqirFZ4EsWWJ9w2Vg8v08s17W2sTjhX2YOw2+TznDFubZBtWBq45tQDlRjnjPp873Y8ywbsWvvNve99prYblLolvHZJ5hstVV44xm79f2msXECnKXOQycAMkXdekcq0rHtFdMnMVux6BbOkmUh3W1usosww61MAPh7kEqOvtXAxiqv+F+/FBdUTLDbDt3MwVhSzqk/lPfWAei9+//leEUyoSSCQRJwbQlj0XLfCCPs19vlLbzdc8h3Fqf/Dd7gxWb7fuu3x6aCrZMHd04EZ52oLtFCfXWnhDi3UIO33WDD/WI3z9QtC1Iz2AJ/mSPX0aH/ggwQFreHrg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=permerror action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zNH2v+Pq0texW9HG5gKRtqnHAfB4p9nn4My1m3Yxh+U=; b=SfdSW/OgYmpDEwohLhkHp+fBWVv2vDH9LfVKc3DVdGJi1el0O15K72cIgtClEJV/BHva1mo6Fqrij+gDS/eP1jBB7DVRHQzPoWL8jdUuMBeZtkfnBG5XZ4rP1o6i+7rn9+KYvHW1pkdG1Ht2rr4niLli7Oo3Ew4DEs5YrbkDITQ= Received: from DM6PR12CA0013.namprd12.prod.outlook.com (2603:10b6:5:1c0::26) by MWHPR12MB1581.namprd12.prod.outlook.com (2603:10b6:301:f::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.14; Fri, 13 Dec 2019 16:54:20 +0000 Received: from BN8NAM11FT056.eop-nam11.prod.protection.outlook.com (2a01:111:f400:7eae::203) by DM6PR12CA0013.outlook.office365.com (2603:10b6:5:1c0::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.16 via Frontend Transport; Fri, 13 Dec 2019 16:54:20 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXMB02.amd.com (165.204.84.17) by BN8NAM11FT056.mail.protection.outlook.com (10.13.177.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.2538.14 via Frontend Transport; Fri, 13 Dec 2019 16:54:19 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB02.amd.com (10.181.40.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 13 Dec 2019 10:54:18 -0600 Received: from SATLEXMB01.amd.com (10.181.40.142) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 13 Dec 2019 10:54:18 -0600 Received: from agrodzovsky-All-Series.amd.com (10.180.168.240) by SATLEXMB01.amd.com (10.181.40.142) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Fri, 13 Dec 2019 10:54:18 -0600 From: Andrey Grodzovsky To: , Subject: [PATCH v2 4/5] Subject: drm/amdgpu: Redo XGMI reset synchronization. Date: Fri, 13 Dec 2019 11:54:08 -0500 Message-ID: <1576256049-12838-4-git-send-email-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1576256049-12838-1-git-send-email-andrey.grodzovsky@amd.com> References: <1576256049-12838-1-git-send-email-andrey.grodzovsky@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(376002)(396003)(136003)(346002)(39860400002)(428003)(189003)(199004)(26005)(54906003)(4326008)(86362001)(186003)(5660300002)(70586007)(70206006)(36756003)(316002)(110136005)(7696005)(336012)(8676002)(8936002)(2906002)(81166006)(81156014)(450100002)(426003)(2616005)(356004)(6666004)(44832011)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1581; H:SATLEXMB02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: eb1b9a88-0849-4efd-9063-08d77fed18d6 X-MS-TrafficTypeDiagnostic: MWHPR12MB1581: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-Forefront-PRVS: 0250B840C1 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uM53W1D5HSGSgyU5kWNp+6L4BRMQYOL5IQMkD9N580Ci2NtzyiA2HFdYnjzRHmhCmK57RMmQrGjPIFkkHdLNLBG7xE/ygPxEQUlSoWje8H6lukZd7Obh4nh5QHQ7iFZiVqowPBtSPhy0UdrHxM1+09qj9atFVf3uNLxBR+YeFvOoiXccyvLlG/JhTpQJGlSTFO6arJYgWSyaqJNUVqqhl9PquK/uAQbK9nPYnU5KlaKB2KjRgxLY0HeEm3YwUi2hWgCKWI3vmgRo5bLlG0jchdGcGGS5q3KR8hJXv0RQ1lyHQVWA7ZT5FFABaauV1rdj4mQXR+Vf3jMHLoxm+TXilWvVP8F8Z08u0E0vNJArxj7TwAIeTSJOQrzft1ojteKAh3fBms3kMsbFSLpPLvUxCvE0ru2gf17yyuQSXgKmoWMssVQtwZ40+t/tGivA+nxh X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2019 16:54:19.6473 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eb1b9a88-0849-4efd-9063-08d77fed18d6 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=[SATLEXMB02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1581 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexander.Deucher@amd.com, Le.Ma@amd.com, Evan.Quan@amd.com, hawking.zhang@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Use task barrier in XGMI hive to synchronize ASIC resets across devices in XGMI hive. v2: Retrun right away with a warning if no xgmi hive, update doc. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 37 +++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 1d19edfa..2ae944c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -67,6 +67,7 @@ #include "amdgpu_tmz.h" #include +#include MODULE_FIRMWARE("amdgpu/vega10_gpu_info.bin"); MODULE_FIRMWARE("amdgpu/vega12_gpu_info.bin"); @@ -2663,14 +2664,38 @@ static void amdgpu_device_xgmi_reset_func(struct work_struct *__work) { struct amdgpu_device *adev = container_of(__work, struct amdgpu_device, xgmi_reset_work); + struct amdgpu_hive_info *hive = amdgpu_get_xgmi_hive(adev, 0); - if (amdgpu_asic_reset_method(adev) == AMD_RESET_METHOD_BACO) - adev->asic_reset_res = (adev->in_baco == false) ? - amdgpu_device_baco_enter(adev->ddev) : - qamdgpu_device_baco_exit(adev->ddev); - else - adev->asic_reset_res = amdgpu_asic_reset(adev); + /* It's a bug to not have a hive within this function */ + if (WARN_ON(!hive)) + return; + + /* + * Use task barrier to synchronize all xgmi reset works across the + * hive. task_barrier_enter and task_barrier_exit will block + * until all the threads running the xgmi reset works reach + * those points. task_barrier_full will do both blocks. + */ + if (amdgpu_asic_reset_method(adev) == AMD_RESET_METHOD_BACO) { + + task_barrier_enter(&hive->tb); + adev->asic_reset_res = amdgpu_device_baco_enter(adev->ddev); + + if (adev->asic_reset_res) + goto fail; + + task_barrier_exit(&hive->tb); + adev->asic_reset_res = amdgpu_device_baco_exit(adev->ddev); + + if (adev->asic_reset_res) + goto fail; + } else { + + task_barrier_full(&hive->tb); + adev->asic_reset_res = amdgpu_asic_reset(adev); + } +fail: if (adev->asic_reset_res) DRM_WARN("ASIC reset failed with error, %d for drm dev, %s", adev->asic_reset_res, adev->ddev->unique); From patchwork Fri Dec 13 16:54:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 11291295 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EF7F618B6 for ; Fri, 13 Dec 2019 21:09:58 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B9F372469C for ; Fri, 13 Dec 2019 21:09:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="fxazWXaR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B9F372469C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C8CD36EB30; Fri, 13 Dec 2019 16:54:24 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2076.outbound.protection.outlook.com [40.107.243.76]) by gabe.freedesktop.org (Postfix) with ESMTPS id F3EE16EB03; Fri, 13 Dec 2019 16:54:22 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wde0CTCt3yw8vkcXtyaJpO6gFJ6t2aLM1RcPys74kDFQQGqnG7RsWAtjZHOxzlJjW+JS+HwniuwA1e0rgAky7gSRPeZXahNCl8zQ0gAI7tBxC67G3AzQj8QRPyrdcrKwUC8YLU1mYOqYIPiHlxG24U/PxLVlSuW9CgmrkdRpyAGqsmUuspa0Tve84l9XSViYX1Ghc6+RAWiyZzZZHWAz7dvut59WN5BcFEAiI3aOsnXoy1wxLl9Wlac0ayJUBO4C84WP53Qp+5pJRfP2e/S1a5KFuRarYcDF+J50NOhixUjA9AlAmTOdfPCGv6QUJW5aAtP+4UJf3BzQUTygiuyO/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cD943eFKsAoKQeJgeCZKhRnzxthli9UqNhUInHkSilo=; b=MkFjCbUosDWFiDcEv0MhbrVGP+UtUriZM86PLBIB978Tpri9He9QrWXl/b5oZlQSlbbQQgUwlmD1SXsZ9mboIpL7FeMy+VfepNDU8sBPIefAwpMd1hRRGyKcyw5HY3MD+koKmLJTy9S2W5I6S38xea6RI9clJ9TMmfXG8Caa9tOA+JmC4xv4PoGaQH6o37kBe/YX92eBbS6sGAOcNFFgeH1s7860o3oWWKF7sQLCJZNm+70nNoBtsF0OePHPLOAdCwFbN5y2P3Ym/W4z8CJCJ7R13uKtVdDGMdnoCRvVBLB3RmFhqDOf0aeYADr5ASuQ1DPg5vIQCRoCE2J9KAXjWA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=permerror action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cD943eFKsAoKQeJgeCZKhRnzxthli9UqNhUInHkSilo=; b=fxazWXaRDPbM11LjYVBY84ovCv5iduE4GCussVE7qD8M3cDla4XfaFK1coTyDhGvgy5p3K0URh09SOYC3tUZ5WodOSI/9eXGmdcOS/YAL0KMFt0Jz76zMFiEs4gKALkZvnaQQcSdYkFIWkrT0rQhltJwgKL/rjl+RzNWpkgneO0= Received: from CY4PR1201CA0007.namprd12.prod.outlook.com (2603:10b6:910:16::17) by BYAPR12MB3463.namprd12.prod.outlook.com (2603:10b6:a03:ac::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.16; Fri, 13 Dec 2019 16:54:21 +0000 Received: from CO1NAM11FT054.eop-nam11.prod.protection.outlook.com (2a01:111:f400:7eab::206) by CY4PR1201CA0007.outlook.office365.com (2603:10b6:910:16::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.16 via Frontend Transport; Fri, 13 Dec 2019 16:54:20 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXMB01.amd.com (165.204.84.17) by CO1NAM11FT054.mail.protection.outlook.com (10.13.174.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.2538.14 via Frontend Transport; Fri, 13 Dec 2019 16:54:20 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB01.amd.com (10.181.40.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 13 Dec 2019 10:54:20 -0600 Received: from SATLEXMB01.amd.com (10.181.40.142) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 13 Dec 2019 10:54:19 -0600 Received: from agrodzovsky-All-Series.amd.com (10.180.168.240) by SATLEXMB01.amd.com (10.181.40.142) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Fri, 13 Dec 2019 10:54:19 -0600 From: Andrey Grodzovsky To: , Subject: [PATCH v2 5/5] drm/amdgpu: Switch from system_highpri_wq to system_unbound_wq Date: Fri, 13 Dec 2019 11:54:09 -0500 Message-ID: <1576256049-12838-5-git-send-email-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1576256049-12838-1-git-send-email-andrey.grodzovsky@amd.com> References: <1576256049-12838-1-git-send-email-andrey.grodzovsky@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(346002)(396003)(39860400002)(136003)(376002)(428003)(189003)(199004)(8676002)(110136005)(81166006)(81156014)(7696005)(54906003)(8936002)(70206006)(36756003)(2616005)(44832011)(86362001)(5660300002)(336012)(70586007)(356004)(6666004)(186003)(2906002)(450100002)(4326008)(316002)(26005)(426003)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR12MB3463; H:SATLEXMB01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4a500348-6e14-4132-e40a-08d77fed1952 X-MS-TrafficTypeDiagnostic: BYAPR12MB3463: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-Forefront-PRVS: 0250B840C1 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a6i1BelcigYPXIITflDTF9M9li9m1/XmSDTsLxRqCtEBpMWnrtnGcJtKz/7kYxBJF+mKKZayAZPgjZo4m4C7kBnIt6gHhSOYMzqN52k8K9xIMiqEjs0Whi2Ijn+OcJcyK+acWU65t72YSXgnBkBANUkJEWniVBDTXhvWL05Smywvt1LoTkN12xPZBCRdTA7t+3TDF7W0zIxkO1G261LBzoi7gJNjtyFsguM4i8Mqyr//pWCkPyZ0w3BT3nF4yY8sPTz34SSZcy4vkb6x+/6SgBt9o/ZSnhMTnLNrHXFrmQSek0hBGsJ+hqP+tLyroYPUX9T6Vvzea/g2CNVY/QhYAcl58LLpILXZu/ITjH8I6G9oa/kwcJMwhod6M/C69jzM0VeGZxyJ4wJpCg0gxpaUkgejGmv6IHxwVmegjOK3z6fMMpbeZeMmYNjW/V6CcE30 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2019 16:54:20.3452 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4a500348-6e14-4132-e40a-08d77fed1952 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=[SATLEXMB01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB3463 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexander.Deucher@amd.com, Le.Ma@amd.com, Evan.Quan@amd.com, hawking.zhang@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This is to avoid queueing jobs to same CPU during XGMI hive reset because there is a strict timeline for when the reset commands must reach all the GPUs in the hive. Signed-off-by: Andrey Grodzovsky Reviewed-by: Le Ma --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 2ae944c..03b85b1 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -3837,7 +3837,7 @@ static int amdgpu_do_asic_reset(struct amdgpu_hive_info *hive, list_for_each_entry(tmp_adev, device_list_handle, gmc.xgmi.head) { /* For XGMI run all resets in parallel to speed up the process */ if (tmp_adev->gmc.xgmi.num_physical_nodes > 1) { - if (!queue_work(system_highpri_wq, &tmp_adev->xgmi_reset_work)) + if (!queue_work(system_unbound_wq, &tmp_adev->xgmi_reset_work)) r = -EALREADY; } else r = amdgpu_asic_reset(tmp_adev);