From patchwork Tue Aug 24 21:01:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 12455819 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 5FFC5C4338F for ; Tue, 24 Aug 2021 21:01:50 +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 28CF16113B for ; Tue, 24 Aug 2021 21:01:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 28CF16113B Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2B85A89915; Tue, 24 Aug 2021 21:01:44 +0000 (UTC) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2087.outbound.protection.outlook.com [40.107.236.87]) by gabe.freedesktop.org (Postfix) with ESMTPS id AA31D897DC; Tue, 24 Aug 2021 21:01:41 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PsSW4vaRWSpN9s2Z2HhY+OgLnn8p4kbWcCz17ujimL/7FMl5wBcEIT7OT0Utg/VqxqbtgrC4jrri9T7MUnf0NcQJkRlja4BM99juOpqE1eCRUmBFOjhQoIL1PiEk48TFZoUAJWWv4vZVJqwJHfPA0GRQGL4ZWQm3+y3XOeq4ZY9iUjeO96SH2fg0hNeZQYcpBFNw1+fURY8PVq4kF1kmt0BiMB+G2DgQBXH1ceLAzI0Nbu8ygfYLR9MAHr9gCCHJ/4a1vnoqcVHdxKRRhrme9o/7bOf1GjcnjCdd4SQi3xYskMxRee9soSy9+Mn0PLM/l5i4EGK+izyahOGsgRfxLw== 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=vTHxzSKayYlEuicgvMmGDvLQVJUe7R8sga6HW19lYsQ=; b=HyDZA9w+WJtWibYK0zSCPuM1PlBNZx8SQCF0qUQ1ZrpC+zpdoeQvMCPR1Ieorkb9kmkNlk9tK+r+hD//vhQkGgVNvjkMhsn3OwawzUzcjc1OCHBCwyirkyPZTfWQT00yWQ3ZOjRcSdUc2MtXdAaJWEnGzMRoJCtgITIwuIe5/hOaKJOi0B+hVHHyJYVUcg9we3osq8RWJLKGWqUow8vcgaoeb9kNRxuA5d3rh4k17LLQQjCdU6hjXXUkiCAxylDYeFygAB6dyxDxGd7eq8FZwO461RoMouzEZUu+TCx1/RboEhQeXMoO3piQuFrRQJFzaDCYhIHCq/98C1t15odz2g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vTHxzSKayYlEuicgvMmGDvLQVJUe7R8sga6HW19lYsQ=; b=FHudlf+Ao+VOQDdACd3UeSx0cnS2sxUGeyzBl9SAwdN2L5sQaLKYQ1zUbVEw13kFVJ2HHXpvarbj0sBCA9LlfP+X3rUu+oTPWOOgJsAXB8CeY89srI454N6OCG7VvSzNOsO9wGFFtAGd25pkjzpK5ec6gEIXYFMmXVjCeKkZytQ= Received: from BN9PR03CA0159.namprd03.prod.outlook.com (2603:10b6:408:f4::14) by CO6PR12MB5428.namprd12.prod.outlook.com (2603:10b6:5:35c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 21:01:39 +0000 Received: from BN8NAM11FT021.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f4:cafe::86) by BN9PR03CA0159.outlook.office365.com (2603:10b6:408:f4::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17 via Frontend Transport; Tue, 24 Aug 2021 21:01:39 +0000 X-MS-Exchange-Authentication-Results: spf=pass (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=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT021.mail.protection.outlook.com (10.13.177.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4457.17 via Frontend Transport; Tue, 24 Aug 2021 21:01:39 +0000 Received: from agrodzovsky-All-Series.amd.com (10.180.168.240) 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.2242.12; Tue, 24 Aug 2021 16:01:36 -0500 From: Andrey Grodzovsky To: , CC: , Andrey Grodzovsky Subject: [PATCH 1/4] drm/amdgpu: Move flush VCE idle_work during HW fini Date: Tue, 24 Aug 2021 17:01:17 -0400 Message-ID: <20210824210120.49812-2-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210824210120.49812-1-andrey.grodzovsky@amd.com> References: <20210824210120.49812-1-andrey.grodzovsky@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e518ae9d-10db-48c3-af2d-08d967425de7 X-MS-TrafficTypeDiagnostic: CO6PR12MB5428: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:172; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QBHXg68e6Sco+TiM5jxNlNNa5U1IjSSksq0STedmGywMcHK/ht6LD5FnEG/C1z01ZSDna2zuoosELLN1kBcIgYyUpx34zKoPWN4dKRcfbVs5z9LQisW8gh0bB4Sn364Yb7Dw5SzD8cQsHWjXScdXNWRZNen/hbHz4PPqH9gnxqhrAp43bQa17yfgGFkYbGWh7v0VL19N28ufqHzN/vD74U9CthhmHKqbMb/CwUOHTGiTw0LUSYc9q3V7CHO5rvhlcxIW82nJjBTvyoH/tEhUKBcoOD3x1vISx4fCbQ4FWqU0tCv0xeeKRH03hGGPd2GOc9WoZoqFhOTeGbIvegPORR7+zuQuFGnaHTgK2yocTB72br/Y6WcgG6l7KdndAzPO24zj2VOnAj36WitHsEYg2N9DOEIFyDW1KwHcKeW8zGjrFeNrhwSFHKXXs/dVCXBVwycwNRr+kh//K7bsTXTyeVX8+wDhDqQyoMyoYfDEyk1jtZ+GqiHxAoYuLgwbecSJH/xTbB1Wu7hCn2EiCcXJhynF1pVVLPDwo0VVLps1KkWyNRv6uHga+BqEjQQVzQuE/8CYDnwqyDPki7xW+OVa0oTQ14AOjNECRDFVR5syIVfnIn3wLTmM/wCn+uAUlSpS8rntTjEC/TyoacTD8uZ2qeczMg9fnxZbu/04rAQZiTDeYsQ9Zvkw4/AIMJong1GdSlRbBHqKvKWg7urBCC2Tcojt3KqL3Eclpk8CGDh7APM= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(39860400002)(376002)(346002)(396003)(136003)(36840700001)(46966006)(316002)(82740400003)(336012)(2616005)(54906003)(8936002)(6666004)(82310400003)(86362001)(8676002)(4326008)(356005)(186003)(36860700001)(5660300002)(44832011)(83380400001)(7696005)(70586007)(47076005)(1076003)(2906002)(70206006)(36756003)(478600001)(26005)(81166007)(426003)(16526019)(110136005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 21:01:39.0173 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e518ae9d-10db-48c3-af2d-08d967425de7 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=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT021.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR12MB5428 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Attepmts to powergate after device is removed lead to crash. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 1 - drivers/gpu/drm/amd/amdgpu/vce_v2_0.c | 4 ++++ drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 5 ++++- drivers/gpu/drm/amd/amdgpu/vce_v4_0.c | 2 ++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c index 1ae7f824adc7..8e8dee9fac9f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c @@ -218,7 +218,6 @@ int amdgpu_vce_sw_fini(struct amdgpu_device *adev) if (adev->vce.vcpu_bo == NULL) return 0; - cancel_delayed_work_sync(&adev->vce.idle_work); drm_sched_entity_destroy(&adev->vce.entity); amdgpu_bo_free_kernel(&adev->vce.vcpu_bo, &adev->vce.gpu_addr, diff --git a/drivers/gpu/drm/amd/amdgpu/vce_v2_0.c b/drivers/gpu/drm/amd/amdgpu/vce_v2_0.c index c7d28c169be5..716dfdd020b4 100644 --- a/drivers/gpu/drm/amd/amdgpu/vce_v2_0.c +++ b/drivers/gpu/drm/amd/amdgpu/vce_v2_0.c @@ -477,6 +477,10 @@ static int vce_v2_0_hw_init(void *handle) static int vce_v2_0_hw_fini(void *handle) { + struct amdgpu_device *adev = (struct amdgpu_device *)handle; + + cancel_delayed_work_sync(&adev->vce.idle_work); + return 0; } diff --git a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c index 3b82fb289ef6..49581c6e0cea 100644 --- a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c +++ b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c @@ -495,7 +495,10 @@ static int vce_v3_0_hw_fini(void *handle) return r; vce_v3_0_stop(adev); - return vce_v3_0_set_clockgating_state(adev, AMD_CG_STATE_GATE); + r = vce_v3_0_set_clockgating_state(adev, AMD_CG_STATE_GATE); + cancel_delayed_work_sync(&adev->vce.idle_work); + + return r; } static int vce_v3_0_suspend(void *handle) diff --git a/drivers/gpu/drm/amd/amdgpu/vce_v4_0.c b/drivers/gpu/drm/amd/amdgpu/vce_v4_0.c index 90910d19db12..3297405fd32d 100644 --- a/drivers/gpu/drm/amd/amdgpu/vce_v4_0.c +++ b/drivers/gpu/drm/amd/amdgpu/vce_v4_0.c @@ -550,6 +550,8 @@ static int vce_v4_0_hw_fini(void *handle) DRM_DEBUG("For SRIOV client, shouldn't do anything.\n"); } + cancel_delayed_work_sync(&adev->vce.idle_work); + return 0; } From patchwork Tue Aug 24 21:01:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 12455821 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 B8988C432BE for ; Tue, 24 Aug 2021 21:01:54 +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 84D5C6113B for ; Tue, 24 Aug 2021 21:01:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 84D5C6113B Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2CC376E0D9; Tue, 24 Aug 2021 21:01:48 +0000 (UTC) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam07on2061.outbound.protection.outlook.com [40.107.95.61]) by gabe.freedesktop.org (Postfix) with ESMTPS id 51072897DC; Tue, 24 Aug 2021 21:01:42 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WDerxI/9atC0HNDQ1tV5qRYbLvF53OubH3XZVryFi01PUvAdcm/4U1hcyqZlK+q6vSU/JI2SQxeWJVUb8YCwe0FBExH1QMglGZT3JPEHsUY4GxF0eyS75sQch1QZePAI1piJZwYB11b79ht24A6iNoJgjElXFtz0++NCu8Z7MmyexaVI3iRO5wCShvAq0WNoUIwO1v8/AIGfEFFMNHmIL5347nVtghjEeM3ejDiO8uFVz8fyqGgXRQ9PIxMS4hXhlGu3YLV/mnN7ulEvm6S5cBd8orgBGS8FnohEcF5J6sFdSococxjeO9Exe5ASpw+InODcVyhXLEBVWQyquYsuqQ== 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=djB1kWKxkOwN4AMciuiPVqqI4CTGOw4VEaM/8IOYJYk=; b=nr6fLQmrn8JY0dlOeSZw2ShgIHtbDxUyzng7fMfD2+L9kJIq1/Gi5DGA6cV0ebJ0Xmsba0Hs8CBjT1tpD5/0AGPuhRmQ/i09XfcdTGmLDZwL+RiTZupB5vwpkEFi+GbARVF4l5VA5i+63rjj6BXfBTYHlxOFRYnqxlDJxEULmjStUqrh0kRAo9tpCFz/aaqkYWkzB8XFohDlUHwgDnmcyJsIaI2FFz0WsjQuSG2GTsdaTaRabAiw8CfIH/WAOSq7mI2iQTg4PNb9uaIp+7uyHYLpanDWPiSmPWtZh3bfjTrc6qiagy6mSenzkYdPer9FdPrlKRighVm5jIaUjUoeCA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=djB1kWKxkOwN4AMciuiPVqqI4CTGOw4VEaM/8IOYJYk=; b=hC/E7DlunVKvUMO+twCOq6YXtdPB1kr3BSTh8cAV/QY8g6U9tE8kzxoJ6buNqzp6QhdxL/J7TGZx9QRjdOni4n47od09aMwlMx1cWwgDAmMlrTGztGisZvOPhe8UgxdoTmC8YG6e3ytlz/M36lwQL05xuk86N5o5NqQgR26bg7I= Received: from BN9PR03CA0153.namprd03.prod.outlook.com (2603:10b6:408:f4::8) by SN6PR12MB2718.namprd12.prod.outlook.com (2603:10b6:805:6f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 21:01:40 +0000 Received: from BN8NAM11FT021.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f4:cafe::5f) by BN9PR03CA0153.outlook.office365.com (2603:10b6:408:f4::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 21:01:40 +0000 X-MS-Exchange-Authentication-Results: spf=pass (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=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT021.mail.protection.outlook.com (10.13.177.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4457.17 via Frontend Transport; Tue, 24 Aug 2021 21:01:39 +0000 Received: from agrodzovsky-All-Series.amd.com (10.180.168.240) 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.2242.12; Tue, 24 Aug 2021 16:01:38 -0500 From: Andrey Grodzovsky To: , CC: , Andrey Grodzovsky , =?utf-8?q?Christian_K=C3=B6n?= =?utf-8?q?ig?= Subject: [PATCH 2/4] drm/ttm: Create pinned list Date: Tue, 24 Aug 2021 17:01:18 -0400 Message-ID: <20210824210120.49812-3-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210824210120.49812-1-andrey.grodzovsky@amd.com> References: <20210824210120.49812-1-andrey.grodzovsky@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c5d8ef97-5d7a-45da-685d-08d967425e78 X-MS-TrafficTypeDiagnostic: SN6PR12MB2718: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3276; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pP4rO3Rh5F1rJ2lyhvUwBFJ9lhktZ3wX6G4CmyXaEL654/JVx36EvilwbQETxssLnub0YuTTu/tgHfluFGpTIsQ6BlwNgS1O9ibA6gouoR1MMV3gxJHc9SXf0k9npMFroUderVtfIvo15r7YPTowOmF9nPwCRuheCtLlllLV5iqBIEbkYKkNPXrt9zCQT1m2+z9xgAcwPScn/e8LdCG9zlLCZz+BjGPVecaU55n0nd+IGOkAD7NJ2Wujlw6ZnmNK1duIMQ04kEnqULljGsr8wM/jIa9CHkIKhrNv3w7WG9PoYY80XuNMUl+gyrOBsye1KFdXDh/cpuWPo4QJ04xNQdvrOVIu7Iezp4daUgc+GHlgSKO3mFULsUDoO/KcYSv512EcyJuYsOy4DWykOH8BiBlqj4fqtWM0gFHGckYyyQNgSJl4o4xMQu7ERJWDqh0AvziZr+gmT7Z7z3phtaJ6WTS9QgWWWt8YmlmfbFmcvlVL1IAF8czLTWnsU9Ev7SJdsU+V2DBfN0rZ7xA2N4hfd0cE2+hPNBuI8vdks4mSAa7uLRK2Cdz1foIAnzkw2ht4G45C9Kjr5MKrzauYWP+LqYdVazAdfP9Vg0L0lWmlSA6LqRwnkxRdcI7+e855WIhIrh+tfTme9dej7wDifET/itay/Od+zTI4k+w/u6HVOyNkNAThLU1laCZ12o+gWgQ3ZxyybSBm7J2VT+aqFm8/rKHrhjFR2VzqJDxcW7eXDmQ= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(376002)(396003)(346002)(39860400002)(136003)(36840700001)(46966006)(356005)(81166007)(4326008)(82740400003)(6666004)(54906003)(316002)(7696005)(44832011)(83380400001)(478600001)(2906002)(66574015)(1076003)(8676002)(5660300002)(70586007)(70206006)(36756003)(336012)(36860700001)(47076005)(86362001)(26005)(186003)(2616005)(16526019)(82310400003)(426003)(8936002)(110136005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 21:01:39.9647 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c5d8ef97-5d7a-45da-685d-08d967425e78 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=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT021.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR12MB2718 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This list will be used to capture all non VRAM BOs not on LRU so when device is hot unplugged we can iterate the list and unmap DMA mappings before device is removed. Signed-off-by: Andrey Grodzovsky Suggested-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo.c | 24 +++++++++++++++++++++--- drivers/gpu/drm/ttm/ttm_resource.c | 1 + include/drm/ttm/ttm_resource.h | 1 + 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 1b950b45cf4b..84ba76ace58f 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -69,16 +69,34 @@ static void ttm_bo_mem_space_debug(struct ttm_buffer_object *bo, } } -static void ttm_bo_del_from_lru(struct ttm_buffer_object *bo) +static void ttm_bo_del_from_lru_imp(struct ttm_buffer_object *bo, bool final) { struct ttm_device *bdev = bo->bdev; + struct ttm_resource_manager *man = NULL; - list_del_init(&bo->lru); + if (bo->resource) + man = ttm_manager_type(bdev, bo->resource->mem_type); + + + if (!final && man && man->use_tt) + list_move_tail(&bo->lru, &man->pinned); + else + list_del_init(&bo->lru); if (bdev->funcs->del_from_lru_notify) bdev->funcs->del_from_lru_notify(bo); } +static inline void ttm_bo_del_from_lru_final(struct ttm_buffer_object *bo) +{ + ttm_bo_del_from_lru_imp(bo, true); +} + +static inline void ttm_bo_del_from_lru(struct ttm_buffer_object *bo) +{ + ttm_bo_del_from_lru_imp(bo, false); +} + static void ttm_bo_bulk_move_set_pos(struct ttm_lru_bulk_move_pos *pos, struct ttm_buffer_object *bo) { @@ -453,7 +471,7 @@ static void ttm_bo_release(struct kref *kref) } spin_lock(&bo->bdev->lru_lock); - ttm_bo_del_from_lru(bo); + ttm_bo_del_from_lru_final(bo); list_del(&bo->ddestroy); spin_unlock(&bo->bdev->lru_lock); diff --git a/drivers/gpu/drm/ttm/ttm_resource.c b/drivers/gpu/drm/ttm/ttm_resource.c index 2431717376e7..91165f77fe0e 100644 --- a/drivers/gpu/drm/ttm/ttm_resource.c +++ b/drivers/gpu/drm/ttm/ttm_resource.c @@ -85,6 +85,7 @@ void ttm_resource_manager_init(struct ttm_resource_manager *man, for (i = 0; i < TTM_MAX_BO_PRIORITY; ++i) INIT_LIST_HEAD(&man->lru[i]); + INIT_LIST_HEAD(&man->pinned); man->move = NULL; } EXPORT_SYMBOL(ttm_resource_manager_init); diff --git a/include/drm/ttm/ttm_resource.h b/include/drm/ttm/ttm_resource.h index 140b6b9a8bbe..1ec0d5ebb59f 100644 --- a/include/drm/ttm/ttm_resource.h +++ b/include/drm/ttm/ttm_resource.h @@ -130,6 +130,7 @@ struct ttm_resource_manager { */ struct list_head lru[TTM_MAX_BO_PRIORITY]; + struct list_head pinned; /* * Protected by @move_lock. From patchwork Tue Aug 24 21:01:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 12455825 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 84C5CC4338F for ; Tue, 24 Aug 2021 21:01: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 463FE610FD for ; Tue, 24 Aug 2021 21:01:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 463FE610FD Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 610C46E0D7; Tue, 24 Aug 2021 21:01:48 +0000 (UTC) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2067.outbound.protection.outlook.com [40.107.94.67]) by gabe.freedesktop.org (Postfix) with ESMTPS id 766EA89956; Tue, 24 Aug 2021 21:01:44 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lc7faOdvB5BU6ZZrs5EwKwEhUei7Q5yQAzCkssybj41y2RkjzFjXWLrlp0VmrJfjhhTDwzaEEfql2Pca7KX3e8XM6ZDWsEBi+GNVf017YkxEmZzZd4K6mKC3PcsiAFXsxDpzgsgRKlbzXF7Pbl5Eoksu3+uBlqfi4L17FT5AXWkHu50TeC3Hm/MCnQNGz8fIN6gUDvNYxkxZ1+n0VotqdpqIEs1EntS9MceHXNu4NJ8bw4NZT1BYzPDEwUc2sHZuPKhO8Kq2NNu8IPPb3hgvfmydF1oMz85y1qGSXrPJN0ybxocaM5bxALdErjFlrdnLhsukrL8rfAo9visEQ9hf2g== 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=TR+vxD0UyRyl1iLBDS44VrFQma2+Bc6q1K7WPu8TqDQ=; b=F+4X+KstVFGMtOgrTV3ywCL8eONPUZUx+WpJpYtW4OyHmgzHHeOfE8TNibSsAw/0b6fqJ/AjZ2v1j76QYbjt+SI4oGOvdl7thGqoy1TTBIVxP+erngvfYhOLf/wOzS5IgH0O0K15uUfuZ7u7VvVEcHwFHZNxKKUWHhjbrYzT9LaX++2DRyT5G2EpYuq55nSIaDzO7Vdg3fA0a7Qtd5v83elXqdaIdGISvPJ4taVIEBCHk1JyVjGUQW+5Mud73EojORqboEQdqOogKNL4sDdkYVgjrrbNmy6yGM1kwfExD23AJzM6Fxzr8L8DcRdq2RnmZSVzeMKkSVkQIR/s/Zvm+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TR+vxD0UyRyl1iLBDS44VrFQma2+Bc6q1K7WPu8TqDQ=; b=qAcZpH0QPpb7BpYmYdNik3Eq7YWvf5yugV4dcobnQ8sQSQqx7pOFmghlHgHZzL5PIFO9GJcqC0Y1OfPIK8tsxvXwZhzTZPuegkQzF6EK5+XmRFz0Eh5+i1OPKIHWbM66eLC0COG9ucvAenDczWd3VPn+8ZrXNvQrNbmzpdIb5x8= Received: from BN9PR03CA0152.namprd03.prod.outlook.com (2603:10b6:408:f4::7) by DM4PR12MB5088.namprd12.prod.outlook.com (2603:10b6:5:38b::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 21:01:42 +0000 Received: from BN8NAM11FT021.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f4:cafe::7b) by BN9PR03CA0152.outlook.office365.com (2603:10b6:408:f4::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 21:01:42 +0000 X-MS-Exchange-Authentication-Results: spf=pass (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=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT021.mail.protection.outlook.com (10.13.177.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4457.17 via Frontend Transport; Tue, 24 Aug 2021 21:01:42 +0000 Received: from agrodzovsky-All-Series.amd.com (10.180.168.240) 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.2242.12; Tue, 24 Aug 2021 16:01:39 -0500 From: Andrey Grodzovsky To: , CC: , Andrey Grodzovsky Subject: [PATCH 3/4] drm/amdgpu: drm/amdgpu: Handle IOMMU enabled case Date: Tue, 24 Aug 2021 17:01:19 -0400 Message-ID: <20210824210120.49812-4-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210824210120.49812-1-andrey.grodzovsky@amd.com> References: <20210824210120.49812-1-andrey.grodzovsky@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4d7cb3f1-1af3-4767-0517-08d967425fe7 X-MS-TrafficTypeDiagnostic: DM4PR12MB5088: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:935; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lel73pvFaTL5p1aCgyFzU+gSuBfwWoYoHDEl2BnQijIHVx5iJUtnO1Q9NRxL1+323PV5cOLfSYB2jnVVWHvMAeN6JEVt31dWnfBHwT+ubimMx7OjKDvS950lSlbTQfs/hG9886+sRNQ5EOrVVV4e8RUkNdNnDZr9mslmsNrp3zH7XmzhqGtKH8syZMjXh9Cj1hdC7FVTzmSkxLhcy527ABHFd0ufsc4YiHDPXGRd7AJ6YeMKv02TElhEULME+iaEjZg0otwHdFWywLC5knhUPQ0/3wJWWamNTjPzaGT3ltEWbm0q2G/PcInQxhWUSbqU/ifrDOgDyaQsl+SF8oWxsmek97KKyEBQ5VUDSQLuod/CXBt2VSGRuq2KsF4e6gkIRXqGNEfMXGC7HwjS+H+NDg1YOdHmZAPgrwSFr+9bG+0C6+EjFCEDmlVlAUnl/RUoBzO/Wda3eV0kn03rSDlB72FThPXLIoW9JzgGJFWS18muW2L6e0gikGpOeOw34FIrVxqQLYS748hIBf2WVQ1i1tnw2DiX+DhZBNqEMYXtOPHi9u4fsV5OapJsPttngtTcRoFreAQOS0UabTe+kPXD4FzLihhKUIdpO5ej/6BGIK7Chf4AgmuqclWlgZmGFjv4cibxCCmeREhhfHPrR4rQsXmA3bIhlEUaSsdz4Bln2L4G/5vrRf+MvqYQ9yInGgPy2TAlBUc9ZPTihF3M1SaSwC0iM6M7q0xAlsH3/zCcIkc= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(39860400002)(136003)(396003)(346002)(376002)(36840700001)(46966006)(336012)(36860700001)(70206006)(426003)(82740400003)(70586007)(356005)(8676002)(8936002)(47076005)(81166007)(4326008)(316002)(36756003)(16526019)(86362001)(6666004)(186003)(83380400001)(44832011)(2906002)(5660300002)(26005)(2616005)(7696005)(110136005)(1076003)(54906003)(478600001)(82310400003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 21:01:42.3684 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4d7cb3f1-1af3-4767-0517-08d967425fe7 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=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT021.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5088 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Handle all DMA IOMMU group related dependencies before the group is removed and we try to access it after free. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 + drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 50 ++++++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | 1 + 3 files changed, 53 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 0b5764aa98a4..288a465b8101 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -3860,6 +3860,8 @@ void amdgpu_device_fini_hw(struct amdgpu_device *adev) amdgpu_device_ip_fini_early(adev); + amdgpu_ttm_clear_dma_mappings(adev); + amdgpu_gart_dummy_page_fini(adev); amdgpu_device_unmap_mmio(adev); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index 446943e32e3e..f73d807db3b0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -64,6 +64,7 @@ static int amdgpu_ttm_backend_bind(struct ttm_device *bdev, struct ttm_tt *ttm, struct ttm_resource *bo_mem); + static void amdgpu_ttm_backend_unbind(struct ttm_device *bdev, struct ttm_tt *ttm); @@ -2293,6 +2294,55 @@ static ssize_t amdgpu_iomem_write(struct file *f, const char __user *buf, return result; } +void amdgpu_ttm_clear_dma_mappings(struct amdgpu_device *adev) +{ + struct ttm_device *bdev = &adev->mman.bdev; + struct ttm_resource_manager *man; + struct ttm_buffer_object *bo; + unsigned int i, j; + + spin_lock(&bdev->lru_lock); + for (i = TTM_PL_SYSTEM; i < TTM_NUM_MEM_TYPES; ++i) { + man = ttm_manager_type(bdev, i); + if (!man || !man->use_tt) + continue; + + while (!list_empty(&man->pinned)) { + bo = list_first_entry(&man->pinned, struct ttm_buffer_object, lru); + /* Take ref against racing releases once lru_lock is unlocked */ + ttm_bo_get(bo); + list_del_init(&bo->lru); + spin_unlock(&bdev->lru_lock); + + if (bo->ttm) { + amdgpu_ttm_backend_unbind(bo->bdev, bo->ttm); + ttm_tt_destroy_common(bo->bdev, bo->ttm); + } + + ttm_bo_put(bo); + spin_lock(&bdev->lru_lock); + } + + for (j = 0; j < TTM_MAX_BO_PRIORITY; ++j) { + while (!list_empty(&man->lru[j])) { + bo = list_first_entry(&man->lru[j], struct ttm_buffer_object, lru); + ttm_bo_get(bo); + list_del_init(&bo->lru); + spin_unlock(&bdev->lru_lock); + + if (bo->ttm) { + amdgpu_ttm_backend_unbind(bo->bdev, bo->ttm); + ttm_tt_destroy_common(bo->bdev, bo->ttm); + } + ttm_bo_put(bo); + spin_lock(&bdev->lru_lock); + } + } + } + spin_unlock(&bdev->lru_lock); + +} + static const struct file_operations amdgpu_ttm_iomem_fops = { .owner = THIS_MODULE, .read = amdgpu_iomem_read, diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h index e69f3e8e06e5..02c8eac48a64 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h @@ -190,6 +190,7 @@ bool amdgpu_ttm_tt_is_readonly(struct ttm_tt *ttm); uint64_t amdgpu_ttm_tt_pde_flags(struct ttm_tt *ttm, struct ttm_resource *mem); uint64_t amdgpu_ttm_tt_pte_flags(struct amdgpu_device *adev, struct ttm_tt *ttm, struct ttm_resource *mem); +void amdgpu_ttm_clear_dma_mappings(struct amdgpu_device *adev); void amdgpu_ttm_debugfs_init(struct amdgpu_device *adev); From patchwork Tue Aug 24 21:01:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 12455823 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 9CB98C4338F for ; Tue, 24 Aug 2021 21:01:56 +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 6C68461220 for ; Tue, 24 Aug 2021 21:01:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6C68461220 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C11216E0DD; Tue, 24 Aug 2021 21:01:48 +0000 (UTC) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2081.outbound.protection.outlook.com [40.107.237.81]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5F8546E0D5; Tue, 24 Aug 2021 21:01:46 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VGTGMZlzt5sSbNTpGbxS/OcJW4P7ewBwnow38J7YbG2akU/A1NCJV1dxWRpjo/+kwnqjj8cepH2ncgv5Yn917xL4relBBb+74D1C5vAP4MrL6YnfpRNRLJz3jZSPSh4WGRFqVv3MfBgOtayloWe7KLd6rImv9TAsvnDCfs82XlSk24V3DulMCKX6jAp98OphD80Xc4TQS9LoxabJJmYJODuVTG6E50IF8gjMeyYsjGdn3Boi3pQlTiPkoFiuPDXeNwRcT/AyQYS+SBg0dUID/4vz7WjRNV0FcPn3vxkgO9ZmRN7lvWt7H77p7zQOCnAzet3fAxXKR9lRqFSRLj0gmQ== 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=jVjj2p1/2cub+2D3463dfzFPKnfwfhsAgOXarlqz1oY=; b=bGZiN1AotV/wIGhfOOW8s61fKkRVGD6pHK0VMrZul/rgazLez/KUkw+MDwqo94cSMZ5coCIBzDBk43FxnlDsrHJpMyeUwOXfdUnNMIdhqm6IByzzStYlePGw012g8ETw72LdkOg7yrT1cnpuuqCgf4N6Qf799aouDUhqvR2HNWmJJY/QvkGJ1muUIcAyVz7fQYZ96sT0Svrk/eMFYhEB5EfE0MEPc8e3egDSfKo/K985NFfM1/JQZTrac1fY6ESITB0uzLWNXeuzcbLt/WAlz7TY5uaGE4DR6qDzpwmpfI9Z0WB0bi6Rtxbi8B78/MEGCpecqzKueTHrHuC1qic4nw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jVjj2p1/2cub+2D3463dfzFPKnfwfhsAgOXarlqz1oY=; b=2gFiCwpp0Uho+yOuLOsZl8dndMr8EIOF7VwT9FrujUuPS9Zk1uGfcs0BsL6HTLvur3P1mdRP6raxbez9zHckihOxJF8RGHEH8B0bkpIfBaPUH27UiY8OMyL1/2IPdIj2ED7VChUbhz0o+Y10BCvgCGXZ3DQDAKEQpF5ZvmRDWZM= Received: from BN9PR03CA0179.namprd03.prod.outlook.com (2603:10b6:408:f4::34) by SN6PR12MB4751.namprd12.prod.outlook.com (2603:10b6:805:df::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17; Tue, 24 Aug 2021 21:01:43 +0000 Received: from BN8NAM11FT021.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f4:cafe::9b) by BN9PR03CA0179.outlook.office365.com (2603:10b6:408:f4::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17 via Frontend Transport; Tue, 24 Aug 2021 21:01:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (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=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT021.mail.protection.outlook.com (10.13.177.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4457.17 via Frontend Transport; Tue, 24 Aug 2021 21:01:43 +0000 Received: from agrodzovsky-All-Series.amd.com (10.180.168.240) 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.2242.12; Tue, 24 Aug 2021 16:01:42 -0500 From: Andrey Grodzovsky To: , CC: , Andrey Grodzovsky Subject: [PATCH 4/4] drm/amdgpu: Add a UAPI flag for hot plug/unplug Date: Tue, 24 Aug 2021 17:01:20 -0400 Message-ID: <20210824210120.49812-5-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210824210120.49812-1-andrey.grodzovsky@amd.com> References: <20210824210120.49812-1-andrey.grodzovsky@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1a013591-6a51-4514-f040-08d967426095 X-MS-TrafficTypeDiagnostic: SN6PR12MB4751: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:296; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NHwINAEOVGGBq2fFEr3qrR7uEEofu5l0HPQdq45e8l9z2WQrPR7zRXF5kdxEGG8yfovKqhPWtx9WVhyl0/qhot+ZOm3vTzKD7GVziFYFeBGQ5uh3ctT+x3zg2YxSng+hI30hJ1L0aLPEHxA7znYe9zqR972RJqTFNe6w+RE1U8XrRG8iLTfArEuLXRynKhwjVNqMYPki9pbXGRNG0H8HdIRPQb8bkcfKzJhOc59UM+10+cD5vdAhZwp7Hk00RrQG9Yy16iC4qzbXBClLdxMvmDQxRDaZqEfpVayUB9QiEmFNIBihCb5DPtgS9lrb7gXKv3nS1eTgEUnWby+3AgVeA+3N28AP3mZkh0Ucdx1ZQ4nN7R3oB3RHwTGpNxnjvfBcMLoAKxsYTmShmIGrutrqWebxnHmnb7wf/f7zbeqhLl6Udn0JObdPwY1bll3jEUapKmKCTmayWQV3EG1E8U2m0pw4oChSPOC1IMhVns0owqo1DuzXHx138RH15+uKWqIh6zOpvwCs8mojaz0tR6IdnFMqHBNCQEjdCsmH95hv77tgrT2iAv3II83vT+DiM+eWvBXv2mQOdAHbqh2M3IlWgBXwqSskp0TAl8CguT1btS2DW9xJTgjrdvvcBJAb4JHNpKvjiJZ4ggvypMVtS15mxyAXSEuj0UlDsqPhKZhSp0qxVb2M7kudayB6KF7/p+5tECL+6xvLXy70a6hp/vWG2oEExC+TE6i3moJeEIkStJE= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(376002)(39860400002)(346002)(136003)(396003)(46966006)(36840700001)(36756003)(82310400003)(54906003)(44832011)(478600001)(4326008)(83380400001)(336012)(2616005)(47076005)(1076003)(86362001)(82740400003)(7696005)(426003)(6666004)(356005)(36860700001)(4744005)(8936002)(8676002)(186003)(81166007)(110136005)(16526019)(2906002)(5660300002)(70586007)(26005)(70206006)(316002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 21:01:43.5147 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1a013591-6a51-4514-f040-08d967426095 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=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT021.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR12MB4751 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To support libdrm tests. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 6400259a7c4b..c2fdf67ff551 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -96,9 +96,10 @@ * - 3.40.0 - Add AMDGPU_IDS_FLAGS_TMZ * - 3.41.0 - Add video codec query * - 3.42.0 - Add 16bpc fixed point display support + * - 3.43.0 - Add device hot plug/unplug support */ #define KMS_DRIVER_MAJOR 3 -#define KMS_DRIVER_MINOR 42 +#define KMS_DRIVER_MINOR 43 #define KMS_DRIVER_PATCHLEVEL 0 int amdgpu_vram_limit;