Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8EDEC2D0C6 for ; Wed, 11 Dec 2019 20:07:28 +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 88B3320836 for ; Wed, 11 Dec 2019 20:07:28 +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="ArsWDvjZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 88B3320836 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=amd-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4F4426EBC7; Wed, 11 Dec 2019 20:07:28 +0000 (UTC) Received: from NAM04-SN1-obe.outbound.protection.outlook.com (mail-eopbgr700071.outbound.protection.outlook.com [40.107.70.71]) by gabe.freedesktop.org (Postfix) with ESMTPS id D913F6EBC7 for ; Wed, 11 Dec 2019 20:07:26 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fuA6PeulLlTnh0Cg5F1IJU1gXnQD1YNhbGOP5y2k4zJIuYR6Rfjb4VIncjYgcCsTVV0M4CQ8pb5krmfdZ6TNfDJHCCUqbSoqpv+/OWMPBZSM5A32fnxfGqEB70zhh0PkO4OFZuOU91xpk4P/9vzRjsORw+qhZ8hQsGL0EAvQ1ZV25F9Q8ApQm72rb6gWc9lIytViizo+8tYU6yTMSWLLsz0gHHxDGLfeLotdE0razFkzUmdVcaFY9lf76kzvIYJRmS1A34aTBSIvat0/OGVRFIe6dwF2bkNYFAsKaS22mgJdeCmVLOVsPBdx2NaGjlgOlfqs3mWihi2od/XDaactYg== 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=JSEt2f9/EfxdoaHGLa7jypJphLCUQe7rpLGN/Y3n8iI=; b=TSnU49/l3hB4kbU2ue7Z0q1pK4EMzu0gTCLEelkGuBOFWT4DfCmbinN7/fxXykOiewcY1p5vcOuOegsHG0wh9CLxHbAtseh+WE/HCGxXnoL1nIOwgM58mD9JeCcxgd9bObejGHl2KvZ2Yhk0nGZZOM5znv6TewliXI8kebjSOOY763SNJzwoEr3lr0QM2mhLovGrHU4b7TZn9gD8it07iCv/Epv7ETlbpFi9MTK/yUNREx5SKbJvlX+muapl2MB1nGM7iaiIU9tOryl1eSVG9e7AUxJwi7i/F7/fwq+IFoNmX2M4cGUP9jrpYsghOUnLK/8gQiKbVRsA3i+c0DlL8Q== 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=JSEt2f9/EfxdoaHGLa7jypJphLCUQe7rpLGN/Y3n8iI=; b=ArsWDvjZgqLsebfVqvmyVTqxP4kFm8anrovuIaX8CudGu1zR8rXX9CgDmsU2jo7dBZhyM4R52l9Lzv7CfMXgy2c1PoEx+e837yk4YjqDt8gBWqeeVwbbP/KOnQfIFP4e4PwjWOWxOWryguAPX5kl42QQZElX0/+cWE6wWlX8gLg= Received: from DM5PR12CA0004.namprd12.prod.outlook.com (2603:10b6:4:1::14) by BY5PR12MB4066.namprd12.prod.outlook.com (2603:10b6:a03:207::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.15; Wed, 11 Dec 2019 20:07:22 +0000 Received: from CO1NAM11FT016.eop-nam11.prod.protection.outlook.com (2a01:111:f400:7eab::209) by DM5PR12CA0004.outlook.office365.com (2603:10b6:4:1::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.15 via Frontend Transport; Wed, 11 Dec 2019 20:07:21 +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 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; Wed, 11 Dec 2019 20:07:21 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) 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; Wed, 11 Dec 2019 14:07:20 -0600 Received: from SATLEXMB01.amd.com (10.181.40.142) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 11 Dec 2019 14:07:20 -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; Wed, 11 Dec 2019 14:07:19 -0600 From: Andrey Grodzovsky To: Subject: [PATCH 3/5] drm/amdgpu: Add task barrier to XGMI hive. Date: Wed, 11 Dec 2019 15:07:07 -0500 Message-ID: <1576094829-2245-3-git-send-email-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1576094829-2245-1-git-send-email-andrey.grodzovsky@amd.com> References: <1576094829-2245-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)(39860400002)(376002)(396003)(346002)(428003)(199004)(189003)(336012)(2616005)(6666004)(54906003)(478600001)(186003)(26005)(4326008)(6916009)(8676002)(356004)(70206006)(70586007)(5660300002)(2906002)(86362001)(36756003)(316002)(426003)(7696005)(81166006)(81156014)(44832011)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY5PR12MB4066; H:SATLEXMB02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 343f77d8-5263-4b00-553a-08d77e75bb42 X-MS-TrafficTypeDiagnostic: BY5PR12MB4066: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:913; X-Forefront-PRVS: 024847EE92 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: slbaz/mJ7Ky+ar4Y/NKOmnNkvyZmu88tAnyH8wX/k1ddAhDEVaASAHe1YtaAplOnj8Q3+mMgk0566Lp90SuwP8CZhTlb1bJTNFUS9SyijeMKyfQP1F6tLXr9EIVGmiqA2qbSukgDnj+W3SQ9eSXVVeJRa4g1IDgap2qcc0P5lsHbllwSV3g7l6s0UfPDnrbE4aAauG1FrBkQ5UF3qAHL+poUAbHIQvbbvBavHaUZARNiW/1nt2DHukybrgd9wF0NV9bItzBsdsGObL2nVn6cXVbPuX6cVUiy5x+2ctD8ZN0WHSjG6qAi2jHaBwNmLDXnX9o+lZUcSRy3A31JJ3ckDgFufwQiUTXfevgsfwyyZxZcJdjvK6TR0W1WunffBqESsVpd+4PCn9VtOjTGEJZFrZfwKbNO2Nk6LFVvWsJCxO/K0FT0VlpXorp0FLSQreBb X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2019 20:07:21.2603 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 343f77d8-5263-4b00-553a-08d77e75bb42 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: BY5PR12MB4066 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexander.Deucher@amd.com, Le.Ma@amd.com, Evan.Quan@amd.com, Andrey Grodzovsky , hawking.zhang@amd.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" Signed-off-by: Andrey Grodzovsky --- 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); -- 2.7.4 _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx