From patchwork Thu Aug 26 17:27:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 12460343 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,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 229B7C432BE for ; Thu, 26 Aug 2021 17:27:53 +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 E3E7B6103C for ; Thu, 26 Aug 2021 17:27:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E3E7B6103C 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 1AA386E888; Thu, 26 Aug 2021 17:27:49 +0000 (UTC) X-Greylist: delayed 137249 seconds by postgrey-1.36 at gabe; Thu, 26 Aug 2021 17:27:44 UTC Received: from NAM10-BN7-obe.outbound.protection.outlook.com (unknown [40.107.92.58]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7CC696E051; Thu, 26 Aug 2021 17:27:44 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UsZw5mjBk1TD/IYbCCgB4Yhefl1FUVNKtUKIoRfyTA0D4Yn/3TZyJNR0Zhhw0MdKM3dQlOR6Z3GMnSrcI7UjGeAoLoXnWfoeobWDHHiEIBvU54yvEr6iG6fhnUbNluz6houjycG3AUWQLwijq7OdGPp592kqowo2KKe1WXgp+VRCKvZyGRULXHPwJ7q0jDsfUueMJ/IuxomS00c8ccVhVEmmbuHZc/uQatyS8E1/cgtTgaWzMt4R4Gg5fUSijWbMMvzC1SaR1SmBfFt19ssfPNkPshXoC1BV99g6sFFyIUIhpFhHjbhgeFmpRSIat/gQKpsb/HVAdHnkymXa04JRvg== 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=H8p2OECCbMREYULrN+nWfym8HEYOFUtgXUtH7Xavsig=; b=ixXdQ0ng1jKgdMK2nu+gKnllVagljX2wvoP1v/vL/L4J6nyQeUxs/DCZ2vAqNR/TzSYbR3e9NPbHGpuEoIQfkyXP2JKTnT2UEW64WE/X9PFhTrzugzyaX1bQUCQHqYuADPoVH4SM0VCnO0WefSD5lawvw4yOMwEqS+l5C5jA/n9PS7EWjwk9TRCCPO7Rvmdth+RWIkdh/mm24yUqWLWpq0P5ZqRgD0qsgXhjsN0gtROtiYZxAdwCMVU1jqRWTUonnf/fhJ+NPr8fBtK0y7ER9QMcgeD9dj5RyU0CCFan7sKLH9OqLnmmtgl6kzcKUX++dOmk8BoL74gHhRw0rlp3Fg== 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=H8p2OECCbMREYULrN+nWfym8HEYOFUtgXUtH7Xavsig=; b=IFKrPA12HriMq51lnrU98N2y94LhcqfknzCs96BHnXQ5SC8Iw6tk/7AMXu5yrNtQlER6WBps0Wxctj+8cyCzLyZ2xP0PO/ohUxuXDX+LmtAceDtaZuQcqxnT/k/smvxTsIsxyJUU4FNIAD1/gOsrpnIjpmHiftFra+fKltTh2N8= Received: from BN9PR03CA0555.namprd03.prod.outlook.com (2603:10b6:408:138::20) by DM6PR12MB4058.namprd12.prod.outlook.com (2603:10b6:5:21d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Thu, 26 Aug 2021 17:27:42 +0000 Received: from BN8NAM11FT010.eop-nam11.prod.protection.outlook.com (2603:10b6:408:138:cafe::c8) by BN9PR03CA0555.outlook.office365.com (2603:10b6:408:138::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17 via Frontend Transport; Thu, 26 Aug 2021 17:27: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 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; Thu, 26 Aug 2021 17:27: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; Thu, 26 Aug 2021 12:27:40 -0500 From: Andrey Grodzovsky To: , CC: , Andrey Grodzovsky , =?utf-8?q?Christian_K=C3=B6n?= =?utf-8?q?ig?= Subject: [PATCH v2 1/4] drm/ttm: Create pinned list Date: Thu, 26 Aug 2021 13:27:05 -0400 Message-ID: <20210826172708.229134-2-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210826172708.229134-1-andrey.grodzovsky@amd.com> References: <20210826172708.229134-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: 8ef2969f-4946-40e2-16fe-08d968b6cf69 X-MS-TrafficTypeDiagnostic: DM6PR12MB4058: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XPwT1DYBorMppAeJzkqfnPujRNu5DWsEmMZ7oAb8cAfw5+880WJZdQVQST666RSJPRTWWfARddx27freL9Rr/wQYpmiLEB3xT5z4qny1O82yqktPy+60EXXCUcZLRkPtMGVc1kvzJnR6lPeM1JJlYfOZd2N4QF4joAM72TuTQPfLoHyHkAxqZ2xuSXNkQYJkpJPJ8adSRS2DTXimXP0XgSIIWqOc96Aqv6nkSX2WCQkNsSIbYzfXSAlEWNMJIjod7ivqKqEuVQlNZrSWFv1JX62cvIdMLGCVhjLw826VHZSE0j8QXrqKfnujMMVNxOPQv/JgdhyYy2LUUpsZIdUNEprfErKe735FPG7jFfp+L+0ZFODdc3S0Ze7LgVGGgegksb5PippJ254F2UDUSjgkexQ947TxYccoDDtHCJe2HY+pAJfL1VEXMr9ds+utC9zBt4GBqNkzZ06VPhA/YBTVgSko1YtnfJ5UufWrPN/QDHkSkEQgD9uw5qUT6J2JOFL9C3IMTIYbqirh97kc4YlRGSuKGRrtPe9WHUvxPgnrQ+lnoyMnfxQT6OcQcFpqkiQbBpvBI2sQ5T399LXTN6xZAEa9RhfNd0QAwUf+S4I15Lxk7HsHG9KD8wlY+jK5qHLQbTEDR6x36+PA+vU0zcLRT/2b6ETUtJ6zdvn/qQoP3/DRPQOM6hKXoKsVBfdeS85nrH0EQ205G8488eSTcFmZLhQM0WM5s3eER7OUa9nrWsU= 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)(376002)(136003)(396003)(39860400002)(46966006)(36840700001)(82310400003)(356005)(81166007)(7696005)(4326008)(1076003)(83380400001)(2616005)(8936002)(44832011)(478600001)(36860700001)(316002)(54906003)(82740400003)(426003)(336012)(186003)(16526019)(70206006)(8676002)(86362001)(26005)(66574015)(6666004)(70586007)(110136005)(47076005)(5660300002)(2906002)(36756003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2021 17:27:42.2313 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8ef2969f-4946-40e2-16fe-08d968b6cf69 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: DM6PR12MB4058 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 Keep deleting BOs from LRU in the new function if they have no resource struct assigned to them. Signed-off-by: Andrey Grodzovsky Suggested-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo.c | 30 ++++++++++++++++++++++++++---- drivers/gpu/drm/ttm/ttm_resource.c | 1 + include/drm/ttm/ttm_resource.h | 1 + 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 1b950b45cf4b..64594819e9e7 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -69,7 +69,29 @@ 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_or_del(struct ttm_buffer_object *bo) +{ + struct ttm_device *bdev = bo->bdev; + struct ttm_resource_manager *man = NULL; + + if (bo->resource) + man = ttm_manager_type(bdev, bo->resource->mem_type); + + /* + * Some BOs might be in transient state where they don't belong + * to any domain at the moment, simply remove them from whatever + * LRU list they are still hanged on to keep previous functionality + */ + if (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(struct ttm_buffer_object *bo) { struct ttm_device *bdev = bo->bdev; @@ -98,7 +120,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_or_del(bo); return; } @@ -339,7 +361,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_or_del(bo); list_del_init(&bo->ddestroy); spin_unlock(&bo->bdev->lru_lock); ttm_bo_cleanup_memtype_use(bo); @@ -1154,7 +1176,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_or_del(bo); /* TODO: Cleanup the locking */ 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 Thu Aug 26 17:27:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 12460383 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,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 DC9DDC432BE for ; Thu, 26 Aug 2021 17:43:02 +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 9BCF860EFE for ; Thu, 26 Aug 2021 17:43:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9BCF860EFE 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 905476E88F; Thu, 26 Aug 2021 17:43:01 +0000 (UTC) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2044.outbound.protection.outlook.com [40.107.220.44]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9EB9F6E88F; Thu, 26 Aug 2021 17:43:00 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZqsSTHkDfHaNh1BHTJetXZfxpt6Dc4OeY6nWmFtwvHLmXkYYMU0pWra21VVWav6bCQ536JYPv1X9Oza1MkVXezBOf7RPH+q6UyG4tKVXApVYqWW9ZN/nMwjR4ctTDdcRzYHNOpaHShgikUmDEmlu1Gnh+aWeRVpd3P258IgsVZ5BPwJ2NwV5M9IOwB7zXqmjoxlzIGDqTuEbBsQZBHVmh5s2M/jak/UlRS4NubtRJagoPMD1FDMW8VerVAO26XkFlAylJDb4XDfVtjwy4NlWZEa+SZt0TkqSjmxdTHc5cMmDwsEY9fOx9NrS8mRv/ooJZB4xdX4+dzX3t/zZTSsCSw== 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=501Kfl0Xxkt8nbKVGVhKaOr4QxrkqapPJ2bjvVwUmQ0=; b=IhGKrjkBpbXDQjrCLEdcT2k1T7pMGdDCY47JaqMlBMSNbGdudPavV6CbieKWUKJRuQ5WoLUo5W+4wlhkEHEMCxF5J7TDSOrC44F4qk/obpQRD9QE+WF6sxHdAO/l3LW5zoH9GMdSxEmba4KIqmzVxB9Wvb2DxHRWvABnK+26X0A2Zq0/oFjaSsTbSEN7RqPHYbleOIarIOEJQ83uB8r/z/lXxWRA6IYZlbGX1m/hQhJRkfwirf+OZk+ZU1uHFI8hp/4HK9FsUEMTHVazHRz5jIOgYLLzT/+9Dvk58jENWSmGvH6ftAzDUga8BL4GNh0u4nnYLE6Uic8+wb+6dY7lkw== 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=501Kfl0Xxkt8nbKVGVhKaOr4QxrkqapPJ2bjvVwUmQ0=; b=RJMCITUrqz9XM6MzMO7zWAHMBjlhckX7L5iMiPd/HbWxJCmUBlqAGEsGDOlyepztQscKubiUfNpQtG8xNvkoHxj3JIsppNj6uH4giNE5Qlh9D5MnUg6rMngURgKeEaXzgfHKNHFPn71zla5bZIOb5RK2oN6TXCUfVpS6161Uing= Received: from BN8PR16CA0012.namprd16.prod.outlook.com (2603:10b6:408:4c::25) by BL0PR12MB4881.namprd12.prod.outlook.com (2603:10b6:208:1c7::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.21; Thu, 26 Aug 2021 17:27:44 +0000 Received: from BN8NAM11FT028.eop-nam11.prod.protection.outlook.com (2603:10b6:408:4c:cafe::12) by BN8PR16CA0012.outlook.office365.com (2603:10b6:408:4c::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.20 via Frontend Transport; Thu, 26 Aug 2021 17:27: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 BN8NAM11FT028.mail.protection.outlook.com (10.13.176.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4457.17 via Frontend Transport; Thu, 26 Aug 2021 17:27: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; Thu, 26 Aug 2021 12:27:42 -0500 From: Andrey Grodzovsky To: , CC: , Andrey Grodzovsky Subject: [PATCH v2 2/4] drm/ttm: Clear all DMA mappings on demand Date: Thu, 26 Aug 2021 13:27:06 -0400 Message-ID: <20210826172708.229134-3-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210826172708.229134-1-andrey.grodzovsky@amd.com> References: <20210826172708.229134-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: 9391bd9a-0ee8-4817-dedd-08d968b6d028 X-MS-TrafficTypeDiagnostic: BL0PR12MB4881: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1332; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QLDCpqYnqE4QusT1pkhRbEoSRGCGkMgwx1HURH19pUrz81iereEcBPDPizDttJABIiDWlSctNq/FEO25Bdu1vXiIu6/57VgHeywtz0AQZny8v8eFdBR+SZ1EEAQMaj+e/mHylKiLZ8bTf/1KY+KL2N5zEpEiKgbH8hd3Dum6WDafQu5xrFhT2lQxYkpmzif25aXPJGt5qCMRCZPmi1FAosIvh5uqFan+zxKUB3zniknOC890+q/tiHrnRGgHddyq3F9axV0SiAkwg+KVrwh90AttnMq9hvc5PxyhuYg9laQGDpDAEQhsX+rou+miVbUbWb++723XfhS2+94FX6mCs4tBwL9U35xewNExPGuwoagZM+wwzgikSBET8lzxanAL1b+u+aCPyTPeD2SJJ4znmHjmtcSH1mj7WsZVdm5S0I4KZHJW0jq0W9Yi9adZ+okBrkXPi8/o4m2uJihMyGOc6X9yu4R8Eek4qzvKwK3D+0i4wj5R7qWt65HQMEaokdbR/qcCcWgG5UsAxCBdCDWkbKu//Pun7HgVp6z2HKo77lp8x+YKS51gY5w+Yz6sxHEsSjWfSwPGpHR/aHGVrsR1Vq2C09x2xjtkKviwH6vlMULz3LUeGDiEU1dfq30E4r/8+enWCuTnFAymLerLi8enB9WAEq1MYSO4+NlIf1FsgPCmucc61gFAAbrSvg6R7bxdFsZ2LvBIRcBWwpgF9NsLAifGi6+pU0FcyDXBg6zQkNE= 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)(46966006)(36840700001)(26005)(186003)(47076005)(70586007)(8936002)(508600001)(82310400003)(70206006)(2616005)(16526019)(36756003)(1076003)(7696005)(44832011)(83380400001)(4326008)(316002)(81166007)(36860700001)(356005)(6666004)(8676002)(336012)(110136005)(54906003)(426003)(2906002)(86362001)(5660300002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2021 17:27:43.4872 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9391bd9a-0ee8-4817-dedd-08d968b6d028 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: BN8NAM11FT028.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB4881 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. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/ttm/ttm_device.c | 45 ++++++++++++++++++++++++++++++++ include/drm/ttm/ttm_device.h | 1 + 2 files changed, 46 insertions(+) diff --git a/drivers/gpu/drm/ttm/ttm_device.c b/drivers/gpu/drm/ttm/ttm_device.c index 5f31acec3ad7..ea50aba13743 100644 --- a/drivers/gpu/drm/ttm/ttm_device.c +++ b/drivers/gpu/drm/ttm/ttm_device.c @@ -245,3 +245,48 @@ 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); + 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) + 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) + ttm_tt_destroy_common(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 cd592f8e941b..d2837decb49a 100644 --- a/include/drm/ttm/ttm_device.h +++ b/include/drm/ttm/ttm_device.h @@ -298,5 +298,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 Thu Aug 26 17:27:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 12460345 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,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 B07E7C432BE for ; Thu, 26 Aug 2021 17:27: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 7A5A06103C for ; Thu, 26 Aug 2021 17:27:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7A5A06103C 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 9DEE86E889; Thu, 26 Aug 2021 17:27:49 +0000 (UTC) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (unknown [40.107.243.80]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9AE296E888 for ; Thu, 26 Aug 2021 17:27:47 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ya4w+of25VhHG0RbAa7VKumZXGEz4cshSVH68MLIIM85b3ROcTGXeFGSYXJs67RSp/qVhyUvS6e6RrCFLqTxy5kGq77Uk3TysUJZ0FHLGBmZAFVigk9r8ZbU6bNVPlou25wT4+Shayj5ObdtNcdweIrCVa3H0SACgc78LqUo53oEdqnmkN3zIpz5Um2CKJ53yheqLaibcccz6CDQMrw+L0Ye1QkAr+Cyd//TQ3bTa8/ackbajTYZwISNYsNJSldAueQO/LZvGYDHRdWCqRY/iJRJdbILxVLwOdaWnyegtOaK4l3dydT7lMkUUy++YwExwKdg63sMD4hI4eZpal9IDw== 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=C2Q1EQ01DmtGBI3FBvsIAgsdm/y1mYkpJTwPWXQ2SW1L66q/Bpd1kVDjCNJ/Ta7tx7X/KydIljZS9tMX6wQx7yDbcvHLDjgCct1WSPUgCoqgJjE1NM+nzfV2ZnBuR/hbXL+XMw40UJteKplzuN/pYP9IB4Z87+isDHhH0fxR5AcecWhSj7vRkYHelAjD161XhdWWrKkZBH2amMPHr3t9XEnfbAqMBkvvqJ+E6eJimkq4GT6zB0xsSFpwemCGj4V35C/fK1nifncARlzua5U4XIe3dDGjKVdOjXLAv5gUBBpFfCOwelzA5Gjb1QllA0rXGwROX7jAOcnNmysU86xIdA== 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=4dD8Ni+6QzJoEQNJ9AYexSFvMzcQV1ddfwTpB2J2kQlcKGVXC99D1cZzKzhvIWAvKvr6cY287fl1O7hp3gOkawvLR1Ek1zeUp1ThxtWQo3CH76ZBHI2WzIq9QAE5cEdLDubehTxGuKETiDJnydM6hVp2Vq+hfgpt62I3kuMokKc= Received: from BN8PR16CA0027.namprd16.prod.outlook.com (2603:10b6:408:4c::40) by SJ0PR12MB5439.namprd12.prod.outlook.com (2603:10b6:a03:3ae::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17; Thu, 26 Aug 2021 17:27:44 +0000 Received: from BN8NAM11FT028.eop-nam11.prod.protection.outlook.com (2603:10b6:408:4c:cafe::e9) by BN8PR16CA0027.outlook.office365.com (2603:10b6:408:4c::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17 via Frontend Transport; Thu, 26 Aug 2021 17:27:44 +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 BN8NAM11FT028.mail.protection.outlook.com (10.13.176.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4457.17 via Frontend Transport; Thu, 26 Aug 2021 17:27:44 +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; Thu, 26 Aug 2021 12:27:43 -0500 From: Andrey Grodzovsky To: , CC: , Andrey Grodzovsky Subject: [PATCH v2 3/4] drm/amdgpu: drm/amdgpu: Handle IOMMU enabled case Date: Thu, 26 Aug 2021 13:27:07 -0400 Message-ID: <20210826172708.229134-4-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210826172708.229134-1-andrey.grodzovsky@amd.com> References: <20210826172708.229134-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: 842eb84c-7773-480a-9ee4-08d968b6d093 X-MS-TrafficTypeDiagnostic: SJ0PR12MB5439: 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: z0rPaZtlqXWKw9DyoEV4HTdKPetshSa2cmG/v/+K3e9P4wSCmmf+qcCvAbL9enxqghvVs15hmyPq+sg8abH0UjLG2cDg+h2HbuMeC/smpVXuDS+zO9InOe4SUOz2p6bAGIGNHqmXYOejugufZ3eUPe6qJLlU6cAMgjT1diG+6l3XxltnfrP0ax2XY3J3Nl9OfvwX6EHxVgtGBfNQAfyvEEbJCbuC/aPpWchWB3PW55S9ai64aWZaYCIvsiIZVXxVxZ9L+CrdbPioxzKT4SKZiqyus2qU79LxIYtSHWXdH0uQPlvonzc/ZvmCiQ99yEwk3LScLK1vmZsY+ju7Di5IV6NPdon37lDm3WakuyPgKSmySnUsZjQMGIWGTaEiFy77DfMisa1LV3uRK+tIc/bucG+8GdgxyJaZLygiIJVXXdzoUnPXy+8zyPtcWBtOQObqN0MmAYmEKwiS4lRCzg1qH4obR6Ca0bPTSP0Y/V5sMv6zszQMlfVev0aQia6/CthtjJAnA4oJB4bRRKL/QqwNRwQTaXI4Llqf81XwUnz9KOKqMGXKnfKlOGaaKO0FHJ9112Nyp/WQaEzbyvslfX4nHgsaPyKFhZTxaRPhlzf/hW484eMiNgQNJXeX9GKpoujQek3SXkpecEX8/ss5hzwxWJtQaCPIYw3Oo/YXMN4jev6ch3nOasJGr4aTCQURN4ZgfCIj9HnreS7Y+jLuF3dJL6ibJpPnviE9WGL13qHG5Hw= 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)(136003)(346002)(396003)(46966006)(36840700001)(54906003)(110136005)(2616005)(36860700001)(316002)(186003)(70206006)(8936002)(36756003)(70586007)(2906002)(82310400003)(16526019)(4326008)(82740400003)(26005)(86362001)(1076003)(5660300002)(356005)(81166007)(426003)(44832011)(478600001)(336012)(47076005)(8676002)(6666004)(4744005)(83380400001)(7696005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2021 17:27:44.1548 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 842eb84c-7773-480a-9ee4-08d968b6d093 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: BN8NAM11FT028.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB5439 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 Thu Aug 26 17:27: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: 12460379 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,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 33763C4320E for ; Thu, 26 Aug 2021 17:42:21 +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 E85FC60EFE for ; Thu, 26 Aug 2021 17:42:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E85FC60EFE 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 B34846E88D; Thu, 26 Aug 2021 17:42:19 +0000 (UTC) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2065.outbound.protection.outlook.com [40.107.220.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id B6D8E6E039; Thu, 26 Aug 2021 17:42:18 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nEzsa+WEbInvwId53NuDOM3spqESgj+3iFicCX6pNQIpYiCybDlAzeP9rFIXBPaM8Gt3zQFrmW68ICnoExwwK4IXa8+bghejHd5e3TOdZH/8fgFn+jOE/JV/cbNJ5iDS8a64fBMmCfF7fFqZpkCU0xotraH0elmP3wvQ0zgoGjDL1r8t2oP4dh7eUa7nmwm5lUbRHmLzF0dTE09aqJpHLj59I+zEuMhNsVJnQHR8voQ4HOgfiPLfO4KgqjPKFBTbvWmHe3MhjMLSTsIZAPIJGioS8NiVZkas/SDQ7+/RuuUYRxP7S91LWYTooV7XPablCcmLl5QMitkQFfR1q5bXVA== 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=Dp1x5Zc6gpEGOWv0FJXrAmLxuRKpK7BDwtUto0uj1pByyC6hl3prb+WSSogIAaARgXKam9u3+CVTsjlrAx76KazN2e0q3F2z5/2mS7m3yLr7vZPeIVbr/n6YAmAvzj/mSayvrbEQT7xCPJHhxRp7R3zISovBLz4pB8ykWfz1fKN+8rwIxTMQSg1/FwLS6A6O65f18HzQzQyCf2oSxwOHR2xNjNBA4vYm8K05dfSol/hA/q6YPhoXxYINZxLW5diCGgsfLP2oObeVgJQWoEXe7YKSFqv5uxucBJAP8oDz6nMeqlv5jxD9L8pmdkwn7ospjyrWhNnDZhzszRC14nMOrg== 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=v4pVI5xCrQYoTnxcBJshX7cfgxvR5CaxvJHhPIlezljTyTSI3qwdPiKFYHHXXi7ojrDIFBZ6Nb8Orzr/7EZU/C67MMxQ2Be6SyQASQ8hiiBMhsc4/VdnqRPLhXKS24ZqxlL4EEXhadf7b4R/d2h6HKEeLKivdmoLgUQFWF4zdZI= Received: from BN8PR16CA0026.namprd16.prod.outlook.com (2603:10b6:408:4c::39) by DM6PR12MB5552.namprd12.prod.outlook.com (2603:10b6:5:1bd::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Thu, 26 Aug 2021 17:27:46 +0000 Received: from BN8NAM11FT028.eop-nam11.prod.protection.outlook.com (2603:10b6:408:4c:cafe::89) by BN8PR16CA0026.outlook.office365.com (2603:10b6:408:4c::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17 via Frontend Transport; Thu, 26 Aug 2021 17:27:46 +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 BN8NAM11FT028.mail.protection.outlook.com (10.13.176.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4457.17 via Frontend Transport; Thu, 26 Aug 2021 17:27:45 +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; Thu, 26 Aug 2021 12:27:44 -0500 From: Andrey Grodzovsky To: , CC: , Andrey Grodzovsky Subject: [PATCH v2 4/4] drm/amdgpu: Add a UAPI flag for hot plug/unplug Date: Thu, 26 Aug 2021 13:27:08 -0400 Message-ID: <20210826172708.229134-5-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210826172708.229134-1-andrey.grodzovsky@amd.com> References: <20210826172708.229134-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: 98387323-bb4b-4776-5238-08d968b6d175 X-MS-TrafficTypeDiagnostic: DM6PR12MB5552: 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: tZbxWRowuIU8RvQLyiVyDsnal84yjRn3SanJZSx4NOsVRcrw1PxZJLVXgtF4vjGbc/949LgTk2EMarNvBuvZ1slKhxwdbyQsQH5cvOO5Dwg79anmq8P83XhF+THld/HhtMTprX7UfTDlG8g2AtafF2jw14GN1t5AKlln0c+4j7qbIH1/lNhzp3mh9e23iT1vosmBytXAaQzs/nQmNzy2whx6AlCk15z3XMoGDTx5o0PQ69i5oz3po02i+DBV9xi7zvp9lOgLQdT+Jo4NO5qAvYSf6jc1wgBK5RQ4kfg06fs69Nh3UyeqUkuQZKo/CVAJWybQ4bS3u2tB9+QcYRf7NOSHBEgSSgvCVQXzO72PgalEG6+uiXh12yeAmOg+OQzyJj46a2+nYY63+hRCkOpZif0xeS1n3vpR6B6Um7WkScJ/mAvD92OlVaCK0TH/02JtsxbCIx9kl2SHLErd/DxxnCP+lIFjXURde+YuhrFUx90xcAugG/AuF9aaunfKctQvslFv/fbgrMkuX1VnglrNP4PmTvOzOl4VZ3h2uz0C1tNV2ST61hEFGVg+FquSoQ4MvnjBfIJeeuq7lH9YWgmzCGrHUrmTUYw8uZT0h4U0f1lBAJTTOdiIz4SaGdUAf4XEp1mOYNqeLPT9bgrc1FnfMhlMvEN25DhtupUaJKb4UEB50jkuFEsJfO7S3uFglA6GpGnIMAsvXN42V/cWivHT4xfWfRFkjXhnQsZUGTg61dU= 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)(376002)(39860400002)(396003)(136003)(46966006)(36840700001)(54906003)(36756003)(8676002)(8936002)(4326008)(478600001)(47076005)(26005)(316002)(2616005)(44832011)(5660300002)(110136005)(336012)(7696005)(70206006)(356005)(81166007)(16526019)(82740400003)(6666004)(82310400003)(1076003)(4744005)(426003)(83380400001)(70586007)(86362001)(2906002)(36860700001)(186003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2021 17:27:45.6679 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 98387323-bb4b-4776-5238-08d968b6d175 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: BN8NAM11FT028.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB5552 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;