From patchwork Fri Aug 27 20:39:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 12462897 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.8 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,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 3B034C4320E for ; Fri, 27 Aug 2021 20:39:32 +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 093D760FF2 for ; Fri, 27 Aug 2021 20:39:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 093D760FF2 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 0A8806E9C6; Fri, 27 Aug 2021 20:39:29 +0000 (UTC) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2055.outbound.protection.outlook.com [40.107.244.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id 635D06E9C4; Fri, 27 Aug 2021 20:39:27 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nsE6E9b1kaLJA2lT+4MSLAieTpIWi7HaqQE3Y7a5h/Nx9uKawBlRfjvrU8dTqOp364yjtzJ3v1MXhtw8AFrehrsi+IQwdfNGovMIoGOug7lhIw3KROxoPSmPXp1wRqEzWXYbIlg5yyqmW8Wf+/mSCR+856rsHnxwM23zxSn5c9/b6gxEOdcK5LMVMXrfaYo/01c5KKhona9W/MGQJHNQhbw0eQaarIpBKX0Yqia8LniMCV1EAqeFKWUZEHb98PZVDg8DnNiZo8GqT5qTpwU5ESGWvK9N2wKY9BWdbyhxAOysRuhRzmY7AY8dk3wYOHue5Sgq9+q3ii/AxxCR4nK43Q== 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=8RCxkVSnIiuESSryJAyDhBVJSPBV+Cn0g1VMezY9JM8=; b=Ontq4X7b7mibMt9T/zOWS0/kkcz3nsHI3BIsX03F4cR+DYMtWBC9yBMCA4OqlP3uVSy6GYY6DSf4ScO8MQCrr21qgZZ91tmthqtx190UuhHrepMoKTeiyeRsoXrd4q9OFEdWwQI23UlrN5bk2qegWK27G58FGncBMiBfcg0AoRxy04Y392vC6md4K22tNOqbXl2YOD7olEsFVZlQs3gEUn7/h7nn2rIzJ/4J2oKruiUvkpk/FNS5tjEt3WydB6ElT/37tJoWIm3HHLyEY7wADY+UNrlF+BBml6SFO5xFTb7g77vircCc5mjfGjAOBAVas5dja9vZ6c7ZX7GGwgkyNw== 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=8RCxkVSnIiuESSryJAyDhBVJSPBV+Cn0g1VMezY9JM8=; b=eDS3Ee3+Ach1N5pHWAPdEZeLZ5Sxb5vgujVleWtb/Gm9SoelVvQZAFT6aDfUaaVtV9kgzPZuy0rWYVlkb7qmHEGNNRwnCyfURbUFzUVImbiRfuUVjiveQeOASL0vg2yNuZ6vvnFED5c+ZQQ11eKUwe0quaedpCnweQNrigrQxlc= Received: from BN6PR1101CA0017.namprd11.prod.outlook.com (2603:10b6:405:4a::27) by BL0PR12MB5538.namprd12.prod.outlook.com (2603:10b6:208:1c9::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.23; Fri, 27 Aug 2021 20:39:22 +0000 Received: from BN8NAM11FT050.eop-nam11.prod.protection.outlook.com (2603:10b6:405:4a:cafe::49) by BN6PR1101CA0017.outlook.office365.com (2603:10b6:405:4a::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.20 via Frontend Transport; Fri, 27 Aug 2021 20:39:22 +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 BN8NAM11FT050.mail.protection.outlook.com (10.13.177.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4457.17 via Frontend Transport; Fri, 27 Aug 2021 20:39:22 +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; Fri, 27 Aug 2021 15:39:21 -0500 From: Andrey Grodzovsky To: , CC: , Andrey Grodzovsky , =?utf-8?q?Christian_K=C3=B6n?= =?utf-8?q?ig?= Subject: [PATCH v3 1/4] drm/ttm: Create pinned list Date: Fri, 27 Aug 2021 16:39:07 -0400 Message-ID: <20210827203910.5565-2-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210827203910.5565-1-andrey.grodzovsky@amd.com> References: <20210827203910.5565-1-andrey.grodzovsky@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2ca27049-87ba-4b3c-dc96-08d9699ac04c X-MS-TrafficTypeDiagnostic: BL0PR12MB5538: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2512; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6TxiFgiqWrhq939l+NZwXKbQXPnERdysItQmiTFAOx5K//5JnTB3XNxt1V9r3Q6ZV/vmyMzqwVkneeXDGHyRkP987GG1LUS13FtW+bSZchO422QyzzTsnND3kH3zp9Ht4GcYDUv10yMDq2nppJWe768T3m8lwcuAQiR+Xcj7lGn1yIKB8Kt6m/jL8e6P/dunVZ+YG0pBFWANaBUGlNwRheuauXtwvxFgNVncxGlNkCzi7Yk2pq4m9TNK9V+XyR39YKFYlZdMGNubd5l34brjvyOXGZ6ae+QUb8p1EsPmdCuxdfesKvWnVyCeH6DOG+SsPvrPVmxL9MvqXOqcwfYAw61sWSgdO6ym4loEKDETiqlWrSGa4bp580YCo6RU5r8FSsxgNvnOEr/ekkqhRQQ/JJq6fb1w6dw8+l1k09zuxRYepHIkEPVheQ71Khvk6jn4Jah+OlmYyr5Td8x7b2IDNkSGKqwgjnlglkjCG4ZCePl/xHgKdzmjb7oVa19647PLWhEN2ojMVhaxUIYZ2GdgVcRj51hKeJx6oT+VyXW4XZZHaiOVLebsqV5nRfKpcelPFsxKG8XdUuPJU/4h5s4/Mtc99MRbBHca671s+/keSHf3yD6vzd0O5MNNeBVKKj4xKTbjQVhx5yKFbKZsFaZm3YSesLw+3fOVlohl7e9+ePPk20GFwj4BFuSXPIzDE8w3lbKhfDjJ4xpGOZA+Cn4qn8e+ZbCiUTaAaF9OARyXdY8= 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)(396003)(136003)(376002)(346002)(46966006)(36840700001)(36860700001)(8936002)(2616005)(336012)(5660300002)(478600001)(47076005)(426003)(2906002)(26005)(36756003)(8676002)(86362001)(6666004)(70586007)(7696005)(82310400003)(54906003)(356005)(82740400003)(70206006)(81166007)(16526019)(44832011)(186003)(316002)(83380400001)(110136005)(4326008)(1076003)(66574015)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2021 20:39:22.1348 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2ca27049-87ba-4b3c-dc96-08d9699ac04c 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: BN8NAM11FT050.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB5538 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. v2: Reanme function to ttm_bo_move_to_pinned v3: Move the pinned list to ttm device Signed-off-by: Andrey Grodzovsky Suggested-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo.c | 18 ++++++++++++++---- drivers/gpu/drm/ttm/ttm_device.c | 1 + include/drm/ttm/ttm_device.h | 1 + 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 1b950b45cf4b..1fedd0eb67ba 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -69,7 +69,17 @@ 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 inline void ttm_bo_move_to_pinned(struct ttm_buffer_object *bo) +{ + struct ttm_device *bdev = bo->bdev; + + list_move_tail(&bo->lru, &bdev->pinned); + + if (bdev->funcs->del_from_lru_notify) + bdev->funcs->del_from_lru_notify(bo); +} + +static inline void ttm_bo_del_from_lru(struct ttm_buffer_object *bo) { struct ttm_device *bdev = bo->bdev; @@ -98,7 +108,7 @@ void ttm_bo_move_to_lru_tail(struct ttm_buffer_object *bo, dma_resv_assert_held(bo->base.resv); if (bo->pin_count) { - ttm_bo_del_from_lru(bo); + ttm_bo_move_to_pinned(bo); return; } @@ -339,7 +349,7 @@ static int ttm_bo_cleanup_refs(struct ttm_buffer_object *bo, return ret; } - ttm_bo_del_from_lru(bo); + ttm_bo_move_to_pinned(bo); list_del_init(&bo->ddestroy); spin_unlock(&bo->bdev->lru_lock); ttm_bo_cleanup_memtype_use(bo); @@ -1154,7 +1164,7 @@ int ttm_bo_swapout(struct ttm_buffer_object *bo, struct ttm_operation_ctx *ctx, return 0; } - ttm_bo_del_from_lru(bo); + ttm_bo_move_to_pinned(bo); /* TODO: Cleanup the locking */ spin_unlock(&bo->bdev->lru_lock); diff --git a/drivers/gpu/drm/ttm/ttm_device.c b/drivers/gpu/drm/ttm/ttm_device.c index 5f31acec3ad7..530a9c36be37 100644 --- a/drivers/gpu/drm/ttm/ttm_device.c +++ b/drivers/gpu/drm/ttm/ttm_device.c @@ -208,6 +208,7 @@ int ttm_device_init(struct ttm_device *bdev, struct ttm_device_funcs *funcs, INIT_DELAYED_WORK(&bdev->wq, ttm_device_delayed_workqueue); spin_lock_init(&bdev->lru_lock); INIT_LIST_HEAD(&bdev->ddestroy); + INIT_LIST_HEAD(&bdev->pinned); bdev->dev_mapping = mapping; mutex_lock(&ttm_global_mutex); list_add_tail(&bdev->device_list, &glob->device_list); diff --git a/include/drm/ttm/ttm_device.h b/include/drm/ttm/ttm_device.h index cd592f8e941b..03fb44d061e0 100644 --- a/include/drm/ttm/ttm_device.h +++ b/include/drm/ttm/ttm_device.h @@ -265,6 +265,7 @@ struct ttm_device { */ spinlock_t lru_lock; struct list_head ddestroy; + struct list_head pinned; /* * Protected by load / firstopen / lastclose /unload sync. From patchwork Fri Aug 27 20:39:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 12462899 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.8 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,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 C782DC432BE for ; Fri, 27 Aug 2021 20:39:34 +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 8D50D60FF2 for ; Fri, 27 Aug 2021 20:39:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8D50D60FF2 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 CBD716E9C5; Fri, 27 Aug 2021 20:39:29 +0000 (UTC) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2053.outbound.protection.outlook.com [40.107.220.53]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1BE886E9C6; Fri, 27 Aug 2021 20:39:25 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z2YIE6NIq86PSjZZgoMUjB9r6tSVjmsBRuIjqdfS/KLYXOADwkRwtoFyurQYB8ksMlzjo2VsptJc+M1pU97rhxZjpxc5IOVl1DMyOtkNj+tUKemwnHc4BJqKzHH08cRjX24ia+IEueVbxBmNVCSPKo2MaIzIy4c+M5IQGnjeh7dGfWRAxHL6ZC+JgH9RD4s9aFXywEkIRxxs+rKLFtj5wkRfF0hDy+/Vk7npQ5SItEaMOVO/8R7Q6KmHnUlHkQVAwZ/EvoDsCYdBs4kIDe3s2+TeBOKApgv9oYFHKue5R1xtJsKnxDA+ty1KHBUwRL4+71a6E0JAdRMVC66T7hsRSA== 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=LWtM4VO1lQ/H2d5FaEGOYYgYLyUwB2tjgw9djW6jUkY=; b=b+HsjbcK8IfttjxvzA16cbqglkgvhXKHGkMYvqFNhG3oNXY6g9k/Cej6CHErEixJ7jHT8MPTx0MkmJsMROj0GGmgubRreNiCtMi3uFNC3qC08uXd9FQ35eSnV+i5Gb7yiQlxRTAZxsvOBBh8y7k4/LK4EnkWmMfQYc+KvoQy6t/Eo+MlHsdQebgBeHKPhKRdYyuquqjbMlI7TGnoYD3TnHAzcndiI2hLsc64/m6VOHRKlxW23xSI4/ZYz8jbcSlKyPHMzx0GTnRxXFyHXmpcdMDi1GqwcU7fT1GZb0RcQvita3lQE/1j6JBiaIbsJ47HR7KfLZkI2TpCk1Pce9JE8w== 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=LWtM4VO1lQ/H2d5FaEGOYYgYLyUwB2tjgw9djW6jUkY=; b=kelX/GVbxzowfYy7qsm9EENfamAz82wyecY8W3Lb+DITb2yjTu9P3JBD8mOJRcdLhLuI3VcOXCR6FvPp8uto5DQ7MHAtX89qdR1HOOHSFQ/idE3OlatVuhGfS2w6CA0E6hQnZZSq8irZJiz0Q9L5zjhu5OBXh3in9JbnikBdIL8= Received: from BN9PR03CA0924.namprd03.prod.outlook.com (2603:10b6:408:107::29) by BL1PR12MB5189.namprd12.prod.outlook.com (2603:10b6:208:308::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.23; Fri, 27 Aug 2021 20:39:23 +0000 Received: from BN8NAM11FT044.eop-nam11.prod.protection.outlook.com (2603:10b6:408:107:cafe::40) by BN9PR03CA0924.outlook.office365.com (2603:10b6:408:107::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.19 via Frontend Transport; Fri, 27 Aug 2021 20:39:23 +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 BN8NAM11FT044.mail.protection.outlook.com (10.13.177.219) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4457.17 via Frontend Transport; Fri, 27 Aug 2021 20:39:23 +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; Fri, 27 Aug 2021 15:39:22 -0500 From: Andrey Grodzovsky To: , CC: , Andrey Grodzovsky Subject: [PATCH v3 2/4] drm/ttm: Clear all DMA mappings on demand Date: Fri, 27 Aug 2021 16:39:08 -0400 Message-ID: <20210827203910.5565-3-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210827203910.5565-1-andrey.grodzovsky@amd.com> References: <20210827203910.5565-1-andrey.grodzovsky@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e5542454-936e-437c-4338-08d9699ac116 X-MS-TrafficTypeDiagnostic: BL1PR12MB5189: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MzCDtmbtf+gf6mzOkFJS/RSe0vutVa8fSKeMTMJiNCNh7jE06DrQhCINTCPf23AQR3Zsgb2nr9NP1yhX+KDXb/wp/loEJ+jv2pZyRscKtjRMB6TXakzUrBCpl0IHIOw6Q99piSczrGAZPVXToGOdJkvwuTMg9orQOljJcY+CNfc/pApbCjFtT3J9CGuGlClOp5WMHvRMf1MoDYUU4ltWe7DPzO0HASjqRkyCn2Mb1sWnd0eo44191vTWERw6FGQrnc/j3qYPP2osjSDRHrIHrJDEaCTq4zmDLEV88gg2O/pkJkQ963S4EYOAfWkcqsCROb/AP0Mjv4OO70nAI0kZiC8wZGY9ukTHYO4zUCQl4MyzSV+2atEd7P4LS9suiTnAsc7HOxrlNqpq79ItcKFGFAa/bv/fCk5k9dpV9BNZ8o25u2UyvD9AUCz1kDmmJp993mnObyZ+rakmUeMg3RIIjWL8DHwrK2gjbaZwJFsBktGlCJOwYoC2CWExQk/XfINE8zufyOJGDRA/DsCqIkKLhq21usSQn/3fla74TvDCqcg/HXktM2CywgFGvodWOe+qpr+95MCcam1oJVM+tROeiXIgWZwnzzeJz0TGGfNZq934ZnCrpTNWOKLsp7utkjOfqMQ3y1Sl24NHwDoayckjhzOGRM+cWFHx38AUC9QVzijCRmg+DdFXRxRpYRql755CK39JZt3PjFrqVCbEgktKz2ueh0A2dSGClotU6gn8INM= 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)(136003)(376002)(396003)(346002)(39860400002)(36840700001)(46966006)(36860700001)(2616005)(36756003)(26005)(82310400003)(1076003)(2906002)(16526019)(86362001)(186003)(316002)(83380400001)(8936002)(478600001)(110136005)(426003)(70586007)(6666004)(81166007)(54906003)(82740400003)(5660300002)(356005)(70206006)(336012)(8676002)(7696005)(47076005)(4326008)(44832011)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2021 20:39:23.4557 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e5542454-936e-437c-4338-08d9699ac116 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: BN8NAM11FT044.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5189 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" Used by drivers supporting hot unplug to handle all DMA IOMMU group related dependencies before the group is removed during device removal and we try to access it after free when last device pointer from user space is dropped. v3: Switch to ttm_bo_get_unless_zerom Iterate bdev for pinned list Switch to ttm_tt_unpopulate Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/ttm/ttm_device.c | 47 ++++++++++++++++++++++++++++++++ include/drm/ttm/ttm_device.h | 1 + 2 files changed, 48 insertions(+) diff --git a/drivers/gpu/drm/ttm/ttm_device.c b/drivers/gpu/drm/ttm/ttm_device.c index 530a9c36be37..a691c89f5b20 100644 --- a/drivers/gpu/drm/ttm/ttm_device.c +++ b/drivers/gpu/drm/ttm/ttm_device.c @@ -246,3 +246,50 @@ void ttm_device_fini(struct ttm_device *bdev) ttm_global_release(); } EXPORT_SYMBOL(ttm_device_fini); + +void ttm_device_clear_dma_mappings(struct ttm_device *bdev) +{ + struct ttm_resource_manager *man; + struct ttm_buffer_object *bo; + unsigned int i, j; + + spin_lock(&bdev->lru_lock); + while (!list_empty(&bdev->pinned)) { + bo = list_first_entry(&bdev->pinned, struct ttm_buffer_object, lru); + /* Take ref against racing releases once lru_lock is unlocked */ + if (ttm_bo_get_unless_zero(bo)) { + list_del_init(&bo->lru); + spin_unlock(&bdev->lru_lock); + + if (bo->ttm) + ttm_tt_unpopulate(bo->bdev, bo->ttm); + + ttm_bo_put(bo); + 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; + + 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); + if (ttm_bo_get_unless_zero(bo)) { + list_del_init(&bo->lru); + spin_unlock(&bdev->lru_lock); + + if (bo->ttm) + ttm_tt_unpopulate(bo->bdev, bo->ttm); + + ttm_bo_put(bo); + spin_lock(&bdev->lru_lock); + } + } + } + } + spin_unlock(&bdev->lru_lock); +} +EXPORT_SYMBOL(ttm_device_clear_dma_mappings); diff --git a/include/drm/ttm/ttm_device.h b/include/drm/ttm/ttm_device.h index 03fb44d061e0..07d722950d5b 100644 --- a/include/drm/ttm/ttm_device.h +++ b/include/drm/ttm/ttm_device.h @@ -299,5 +299,6 @@ int ttm_device_init(struct ttm_device *bdev, struct ttm_device_funcs *funcs, struct drm_vma_offset_manager *vma_manager, bool use_dma_alloc, bool use_dma32); void ttm_device_fini(struct ttm_device *bdev); +void ttm_device_clear_dma_mappings(struct ttm_device *bdev); #endif From patchwork Fri Aug 27 20:39:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 12462903 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.8 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,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 4AE41C4320E for ; Fri, 27 Aug 2021 20:39:40 +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 1CF4B60C40 for ; Fri, 27 Aug 2021 20:39:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1CF4B60C40 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 3AE186E9C2; Fri, 27 Aug 2021 20:39:38 +0000 (UTC) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2059.outbound.protection.outlook.com [40.107.94.59]) by gabe.freedesktop.org (Postfix) with ESMTPS id A96016E9C8; Fri, 27 Aug 2021 20:39:29 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l+xrqVExNU4nmjx4Nu8xP8c3I4OdoVMNtshGjMCpPb1kMu6LlHyFOUce8YDM3vvgp/PGA7DWKR1gKLd5/ph+D2J60T/oV4GyvH6MJ+47aoK6MmNNyvH33lty8TTXtJJx9H1yoP8XJoNf5VdOP6wHoxALTuU4Hb0izVeU4z2OjC8aaJq8j/8AJBB2T+DUGTnvIAs0OtCpXtu3teYmqmiE69aywyu3JCBVFOfmKFqL8z3ajWzUYr4na1KsdBKKOhiQW1DDjkXht1d2r9Drue2f9tL6wQDCylS7TWmk2m0q6eib/WujDSRlnlo+sY43IZzMsrSCUajwxTVHXGK1KTkpTQ== 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=sEJ3bxndkHkCmfjyUevUX60/6ebTDNvZQu40KYV997U=; b=NRQJ+FPxwfhxsi9vHofkTPqQwdx2tHJnNmtT0NjUnQ9u5T0i0MYKHML44t4yvZ1dhG/6DX+vv6+YPPyCFc9dheq89qgYMfudAJClmqhrbLhOOjCYLR819jWEeF8i25H+d8vkWYVFDLUf6Sd6FICnWDQi5AzVAOZ1lMn5IdyWHjBW9RC23XN5ZPpQcrh5NIuN1+8piRce9PkZBSvwFatdXLA9ztQPW89oHTc8Lwwe/ZBmp5Y2hPrPTVTkeDfVld2BITcziHYB/ZlnY+/q/2pGqKaYvEaNwUyv/ccrywjqb8qfi1KjKUcokb0Q/1q9MTtAbxDd4aBk/eSWPqnwIVtXRg== 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=sEJ3bxndkHkCmfjyUevUX60/6ebTDNvZQu40KYV997U=; b=YRWB1OwbFLx1MBKErPGgg/ne2FF6f2JiE8odo654D9fSL4CWuteO+D1uUrExZ7BWKUgA60fPjqL/c2WJR64FBKAm4GhUMdstOV+Mv2SSt5UE/qq4FHhtQSiXUjfXWU1WVCzhgAgtkTKwNhyPYMIomjMboTiW+iemfNMCOmwLI1U= Received: from BN0PR04CA0186.namprd04.prod.outlook.com (2603:10b6:408:e9::11) by CY4PR1201MB0198.namprd12.prod.outlook.com (2603:10b6:910:17::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.23; Fri, 27 Aug 2021 20:39:25 +0000 Received: from BN8NAM11FT032.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e9:cafe::36) by BN0PR04CA0186.outlook.office365.com (2603:10b6:408:e9::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.20 via Frontend Transport; Fri, 27 Aug 2021 20:39:25 +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 BN8NAM11FT032.mail.protection.outlook.com (10.13.177.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4457.17 via Frontend Transport; Fri, 27 Aug 2021 20:39:25 +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; Fri, 27 Aug 2021 15:39:23 -0500 From: Andrey Grodzovsky To: , CC: , Andrey Grodzovsky Subject: [PATCH v3 3/4] drm/amdgpu: drm/amdgpu: Handle IOMMU enabled case Date: Fri, 27 Aug 2021 16:39:09 -0400 Message-ID: <20210827203910.5565-4-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210827203910.5565-1-andrey.grodzovsky@amd.com> References: <20210827203910.5565-1-andrey.grodzovsky@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 36a0d826-212f-42b5-c22f-08d9699ac20a X-MS-TrafficTypeDiagnostic: CY4PR1201MB0198: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1850; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZD0uX0QHXOGxKADLyk9Gab2O7Qkr9G2K9jco6jnPhdvJpw+EyFoOgA4Y+F97Fm9/rN9cHiRWwH2hRytnWRzP7pa7DGG372EZAWpKZkUsCyFoOeFx0TxiuZALaJhjCdS/oQLvlymqz35OLr+X+zgH5tyPt3kls3bWP07TMIoyh2N666X4UTqRrHMvSZ9zmE2F+lQOg5aOoIbtUtF4mi+r9oehlba5eBfpoVq+F0iYuBUy4JOrhkx3+zoEg37yA64ogXD+kaSbhsLL3AoOjI4M3hnf6fKYf0jwXeRNuTLUlHETe69G6DEajSdTfpyi8YHhUMIOyr5pKXww77GVTqiQjU5cbpp3z4Ugx/3KW1FNdhNLd0Lz4eLJ52VBFrhcBSjvHGG9LnanxcC8ARm28atNw1mX+iIfa/4H8z+/8FMb8uQXRzude8xvWzzEQ4d0T12Rei3pcOjSaTI3ArLMO5kxgEYH1/WiTcnLlFNS6ySOizcvUiTQgFH6+v+siWtoCO7gE2bAinBP8G6fYQ92fANkm8GYermTEHoUtzGJPxtfLtmRqFskBHvTOVCWZETXodmNBjPKHBVQKi7RHmGV5QiTCkiNyZrdauxqP3Qmk7X4LF+L4Sk0XRS9OhFdl38/NIrH3Xs0m5zR7VOp0cGrdZdFWQuF0Z+WhEpnQ4WsIFJvYIcUceWdS1vQG9/YC674n8gStuJOPIiTX+6cvl+RIRxwCg39I3anC8AUX0456OT+lcA= 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)(346002)(376002)(396003)(36840700001)(46966006)(478600001)(86362001)(7696005)(82310400003)(47076005)(36860700001)(8676002)(1076003)(8936002)(186003)(70206006)(4326008)(16526019)(2616005)(426003)(36756003)(82740400003)(5660300002)(4744005)(26005)(6666004)(83380400001)(2906002)(110136005)(44832011)(336012)(54906003)(81166007)(356005)(70586007)(316002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2021 20:39:25.0571 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 36a0d826-212f-42b5-c22f-08d9699ac20a 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: BN8NAM11FT032.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB0198 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. v2: Move the actul handling function to TTM Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 0b5764aa98a4..653bd8fdaa33 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); + ttm_device_clear_dma_mappings(&adev->mman.bdev); + amdgpu_gart_dummy_page_fini(adev); amdgpu_device_unmap_mmio(adev); From patchwork Fri Aug 27 20:39:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 12462901 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.8 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,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 B0ECAC432BE for ; Fri, 27 Aug 2021 20:39:38 +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 7848460C40 for ; Fri, 27 Aug 2021 20:39:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7848460C40 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 3D6446E9C8; Fri, 27 Aug 2021 20:39:37 +0000 (UTC) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam08on2047.outbound.protection.outlook.com [40.107.100.47]) by gabe.freedesktop.org (Postfix) with ESMTPS id F0AF06E9C5; Fri, 27 Aug 2021 20:39:28 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=brX6OfN6Hh/zByDJc7JO7n9d6yQolWxHMf66coSZGcfqQJcxxj2oRmDYiS8fyhRydAXRr9p8uQPDJATYyRwQtI4iVhkJJpwRKh1RQqNWCVeG8/u1GZy82/IciVwVEfyAA2Xiv43XHMi8mES7JbEfxiD8XUj+3eIUwy1vqbC8hw3Mpjt3dbt8RihFAchhFwwje8+BWjdcPIFOTdlOlNpKZi4adPMaxT6hpennbUm3O2IUc41/nL3ov02mqbCGBKBePLKjcwXSn4E65a0KfmKudvNQXpTaOqI7Ef+zT/2KlamZh0/5soodEID9rM+KLspAJXTHoyx4tbR9Oga2o6Drqw== 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=TorIALTSlMYQK+1Ey5fb2lC1aZM3BA4sUGe/wBYT1c5P2lRtiXLGH5EIrdWnD8EvyMWURq3jOM/8jD773GIFQH8cAEPNVdrI2VVgu+ek5/ZibL+Z12JRDYYfjzr4hLSPeHfSu+4GHRb+S5B6stg96lKDHYe/fC5dWR5ryMhZrhKGTdmepCZakqMGFgtZcEcqIuWWehubktZNHwDcfCcOPT73PBb3uNQEQTnuq1aIxIbZ1ntcwPw+pNJqj1GJfE/Go3GrzqDlDtYyDqdSCblu8T8O9zKFvajdykg9R7bQ3v5Nw4Ju1gHelQXZO6ufecqkHRP1EkxTXzcX+8C+dR4ytw== 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=ZK13Du2CLCULSil9Jk+8sfhpHUVHgPKi1sqmQjzHfIv6ieZ7dWH1j6YO0U2JpjUq+MbaEY9zQ5/hx8MqgXT4o7nAQ/sIvAK+rTmu7M1vGmUlV7b54qsjuoMr3/eJ9olCny/tcCCa4zIimzwQxFAZnadPDD5i+V6teT9gzijwCME= Received: from BN9PR03CA0723.namprd03.prod.outlook.com (2603:10b6:408:110::8) by DM6PR12MB3098.namprd12.prod.outlook.com (2603:10b6:5:11c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.23; Fri, 27 Aug 2021 20:39:26 +0000 Received: from BN8NAM11FT010.eop-nam11.prod.protection.outlook.com (2603:10b6:408:110:cafe::cc) by BN9PR03CA0723.outlook.office365.com (2603:10b6:408:110::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17 via Frontend Transport; Fri, 27 Aug 2021 20:39:26 +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 BN8NAM11FT010.mail.protection.outlook.com (10.13.177.53) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4457.17 via Frontend Transport; Fri, 27 Aug 2021 20:39:26 +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; Fri, 27 Aug 2021 15:39:25 -0500 From: Andrey Grodzovsky To: , CC: , Andrey Grodzovsky Subject: [PATCH v3 4/4] drm/amdgpu: Add a UAPI flag for hot plug/unplug Date: Fri, 27 Aug 2021 16:39:10 -0400 Message-ID: <20210827203910.5565-5-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210827203910.5565-1-andrey.grodzovsky@amd.com> References: <20210827203910.5565-1-andrey.grodzovsky@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6f94056d-a358-4e10-744d-08d9699ac2d8 X-MS-TrafficTypeDiagnostic: DM6PR12MB3098: 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: TCbphYuh5I7/SDp/XWonxM/FmL4dfiDbC2SmK8PjPPlKTDeqE14JHmowaZkf2iGrKoiM7IUTNWKZOmFTWxMXqu15K/HGWBPV+KPI7b6pJ+88t2Jscx3dW8qbBZbP+C9zqz0OmjeCbtLOXS+djat0JSK7Ymp4jFEnbjOH0O0t3eK/WQl6b99eRFxV+W2IIsLgkdbOx+iwz48oXBWacRbP0++t9VshyFBw3ScAykWgyQnEK2J6iCbBu9dO68CD0IkXP0NPe/ldZ9ikCUNT6jNW49veneJwHrdzunTadWW/Sdbv45QLbGdVL24JaDgIzCpgkYG+elQIvuY2l4c2cjeq+6hj5bcUYVxveo2EFGngC+yskmyKvSE8ag3qR0+eaAmnvS263n5BxstdDnOVUZZZJauYQha6Lw9m0UAgOPSMNWeocadZWaNeyv7iS3EQJ77liimtMi7pwz8HVUfkQI5cNKRrxwQDP/pW1bEmGU8gDoPXheD0vC1mGGWt5fU1mr8UQxohy0TSu1HTf7gO72OgsNnIbTly2VNEFRkW1qQUu+trBPIi8ZgK9ypXR5s9/BvQPiyqzbn1Ikli57L8vTlVJIZUQuWvIcMmmwlOCvE7qRdkKRKU1CzQXDhIoNpPRIwlE6uJqT64buQ89tmP4s1CUbnnZ4FzXS0l443OUSgLSfBTmTrwblfFphZT0jWPyEDSYUpiueIITI0eImGml+qG2u0CKGVm3J3Sc6UzGbTxj0Q= 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)(346002)(39860400002)(136003)(376002)(396003)(46966006)(36840700001)(6666004)(47076005)(316002)(44832011)(356005)(36756003)(426003)(82310400003)(83380400001)(81166007)(82740400003)(4326008)(5660300002)(2616005)(7696005)(8676002)(54906003)(336012)(110136005)(8936002)(1076003)(26005)(186003)(2906002)(16526019)(36860700001)(4744005)(86362001)(478600001)(70206006)(70586007)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2021 20:39:26.4051 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6f94056d-a358-4e10-744d-08d9699ac2d8 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: BN8NAM11FT010.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3098 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;