From patchwork Fri Jan 13 05:34:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ma Jun X-Patchwork-Id: 13099812 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 9DC54C61DB3 for ; Fri, 13 Jan 2023 05:35:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A457F10E1DC; Fri, 13 Jan 2023 05:35:05 +0000 (UTC) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2080.outbound.protection.outlook.com [40.107.243.80]) by gabe.freedesktop.org (Postfix) with ESMTPS id D30A910E1DD; Fri, 13 Jan 2023 05:35:01 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fQlqF9DrOE7LPaAwYKW9lOWahnXggJbziXkLLlUGxTykiz46cqas9seeygweZX+8isBJ8J4z/V+onhhuDL4HOwHGFcqbyqRWusd/4xawf40Tlj4YKBRKhKdLyGiTcr076iwq6du03706cQQhJvIXgHBJhJMQ/Jztk9js5H5zraVDD85BTWHHzMtrQpdUbpB6hn3txBXDY8e77Rde6w6h8r6J50yD/VbUANQvlmE9ekVjC148AsN/yvW2PgMoKBa/RWEVFYY4D8sBtrEkT3m5RgG7KIFdmhKffwyrA7Bud86l1c+0pOVHqZXUQ/EbDk2TomvHFcXYpBY6gF2CyL/5wA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=choGr10mv4Jw02lHsn+igcL9vrhWG6+64bQ7e/LvknY=; b=eD//GMMnHIG8bdFsBgQ9141Dl3wx1gftj7EYGOI2xzz0dFd1s0ZJSmlp89AXSm6gqAjeHoNxWtDk/ZSyvFFhB47OUl7U5pZWZ04GnPu3B3WVoft/HTYn27Pg5cZFSXrOIdszwwlOLy7IYza4ZMrlo4NhI6xBfkrgYB4SXfqjaYAGsNZJDWQ2iMq7Gu8j05Tvt59/R/TjkDp5GSkUT+g1TR2qAqEA4IyrYQEAEDK8v398bgBTC3NrLkYFVa1WHtGfygPlZU3Lp16YvkjcPNy40PFa/tfWPHbhZaKhovLlhzXp+zXGzuSwBkxlbZAnwy6b923w1ZeKod9gflUHxXG7fA== 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=choGr10mv4Jw02lHsn+igcL9vrhWG6+64bQ7e/LvknY=; b=RyJIAfgZ20DuEHo+0Kh31ZeXe59PWxt9btksl3lq2AnghYkchBRQxKz65AW2qb4aO7donO0JX+2M1H+gt5FHTWwHy11HvwNn20lUEcmGNk87fz3S4MK9Uu2bEI1q9f+L+E/C3iZYu20pR+IbeObwBG2VyHBUaZ58Uli+nqguDqw= Received: from BN9PR03CA0696.namprd03.prod.outlook.com (2603:10b6:408:ef::11) by BN9PR12MB5097.namprd12.prod.outlook.com (2603:10b6:408:136::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13; Fri, 13 Jan 2023 05:34:59 +0000 Received: from BN8NAM11FT082.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ef:cafe::fa) by BN9PR03CA0696.outlook.office365.com (2603:10b6:408:ef::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.14 via Frontend Transport; Fri, 13 Jan 2023 05:34:59 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;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; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT082.mail.protection.outlook.com (10.13.176.94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6002.13 via Frontend Transport; Fri, 13 Jan 2023 05:34:59 +0000 Received: from majun-mlse-vm.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.2375.34; Thu, 12 Jan 2023 23:34:55 -0600 From: Ma Jun To: , Subject: [PATCH 1/2] drm/ttm: Check ttm_debugfs_root before creating files under it Date: Fri, 13 Jan 2023 13:34:15 +0800 Message-ID: <20230113053416.2175988-1-Jun.Ma2@amd.com> X-Mailer: git-send-email 2.25.1 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-TrafficTypeDiagnostic: BN8NAM11FT082:EE_|BN9PR12MB5097:EE_ X-MS-Office365-Filtering-Correlation-Id: e53fceba-495c-474c-0892-08daf527e962 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Q4rmgoAS0zFJNRlN6KRo9Mf2mcJ8Ygml28f4DTSGLizoa9wyAxRmhiqa70mINWbNGHml1uZ4vEGnSaixMnBXtmfSCnTMDtPF9iF3okf5yrcJx7iKKPmfRsg0chrHadxxKYGg5tEulJAJ9flm79fy//BjTRvq34NxyTqE6QaE0fHaTFYq+IrUXl7QfFC+0aN+KryRopw/j0Ytv2r3gajxpyK1U0CIWAVhbcwJ7aSTDqdpT+QJthpxocLGufD8GpqmIZXweEr36ajekKdCXJspqLl4F5C22Iueq9Dun7YKBcYEa6JKl7xRu6WLsiLDVRnR/MMZv7dnrX5ZliYE6ajq52ZmIYBkd+yLwiw8aZI8EigShGORgZHsYN1ke/fyFIPF5dpXnPC+MuRp4QkQ47MY8a7qTc10E1Ha9BALyvOpgBQ4rDibRHdINWqp0+3bb1+wGsopnRrbk9Ca/gNn1my7txen9QQjE+/W0qp6EaqOdTf27YF7Vs6U7PZCLlRqkR2cegiPwFhSqkir+N6zsdlHeZiMAW1iOQdvc1TNM+QJbYikrJu5nde88ND0S40N7xz07qZpvrRuqlsAqn1b/mCX9UJwm/OPblSKeT1R/kr6HxDMdfiPzPDixpFXe8O5gsL7XUpj4Wr+ySTV34ZC5UifEyoP6nvKYY9bm6Ab/wC7xXp9ua5xMytSr6Iu8KC+Zr5wk3slWBCqQGN3ixAmu8fVTh4O8pnynZ2lqQq+WE27MP8= 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:(13230022)(4636009)(396003)(136003)(346002)(39860400002)(376002)(451199015)(36840700001)(46966006)(40470700004)(36860700001)(6666004)(2906002)(70206006)(16526019)(36756003)(5660300002)(83380400001)(8936002)(4326008)(8676002)(47076005)(478600001)(82740400003)(81166007)(356005)(41300700001)(426003)(450100002)(26005)(336012)(70586007)(40480700001)(7696005)(82310400005)(186003)(1076003)(86362001)(40460700003)(2616005)(316002)(110136005)(54906003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 05:34:59.4079 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e53fceba-495c-474c-0892-08daf527e962 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: BN8NAM11FT082.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5097 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ma Jun , christian.koenig@amd.com, majun@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Check the ttm_debugfs_root before creating files under it. If the ttm_debugfs_root is NULL, all the files created for ttm/ will be placed in the /sys/kerne/debug/ but not /sys/kernel/debug/ttm/ Signed-off-by: Ma Jun --- drivers/gpu/drm/ttm/ttm_device.c | 3 ++- drivers/gpu/drm/ttm/ttm_pool.c | 10 ++++++---- drivers/gpu/drm/ttm/ttm_tt.c | 5 +++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_device.c b/drivers/gpu/drm/ttm/ttm_device.c index e7147e304637..967bc2244df3 100644 --- a/drivers/gpu/drm/ttm/ttm_device.c +++ b/drivers/gpu/drm/ttm/ttm_device.c @@ -105,7 +105,8 @@ static int ttm_global_init(void) INIT_LIST_HEAD(&glob->device_list); atomic_set(&glob->bo_count, 0); - debugfs_create_atomic_t("buffer_objects", 0444, ttm_debugfs_root, + if(ttm_debugfs_root) + debugfs_create_atomic_t("buffer_objects", 0444, ttm_debugfs_root, &glob->bo_count); out: if (ret && ttm_debugfs_root) diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c index 21b61631f73a..d95a65f759df 100644 --- a/drivers/gpu/drm/ttm/ttm_pool.c +++ b/drivers/gpu/drm/ttm/ttm_pool.c @@ -713,10 +713,12 @@ int ttm_pool_mgr_init(unsigned long num_pages) } #ifdef CONFIG_DEBUG_FS - debugfs_create_file("page_pool", 0444, ttm_debugfs_root, NULL, - &ttm_pool_debugfs_globals_fops); - debugfs_create_file("page_pool_shrink", 0400, ttm_debugfs_root, NULL, - &ttm_pool_debugfs_shrink_fops); + if(ttm_debugfs_root) { + debugfs_create_file("page_pool", 0444, ttm_debugfs_root, NULL, + &ttm_pool_debugfs_globals_fops); + debugfs_create_file("page_pool_shrink", 0400, ttm_debugfs_root, NULL, + &ttm_pool_debugfs_shrink_fops); + } #endif mm_shrinker.count_objects = ttm_pool_shrinker_count; diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index d505603930a7..fec443494ef0 100644 --- a/drivers/gpu/drm/ttm/ttm_tt.c +++ b/drivers/gpu/drm/ttm/ttm_tt.c @@ -394,8 +394,9 @@ DEFINE_SHOW_ATTRIBUTE(ttm_tt_debugfs_shrink); void ttm_tt_mgr_init(unsigned long num_pages, unsigned long num_dma32_pages) { #ifdef CONFIG_DEBUG_FS - debugfs_create_file("tt_shrink", 0400, ttm_debugfs_root, NULL, - &ttm_tt_debugfs_shrink_fops); + if(ttm_debugfs_root) + debugfs_create_file("tt_shrink", 0400, ttm_debugfs_root, NULL, + &ttm_tt_debugfs_shrink_fops); #endif if (!ttm_pages_limit) From patchwork Fri Jan 13 05:34:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ma Jun X-Patchwork-Id: 13099813 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 22D3FC54EBE for ; Fri, 13 Jan 2023 05:35:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BD72B10E1DD; Fri, 13 Jan 2023 05:35:11 +0000 (UTC) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2042.outbound.protection.outlook.com [40.107.237.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6625A10E1DD; Fri, 13 Jan 2023 05:35:09 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RrbYOlAy+YLCpJT5aIbLsNW2flo/oLQqzq2if2N+ZFHFn2id9Enq7D2XT20UuCARnPoE6iX5WfaJ6NFJnBaNHEJExvYhF2yjkOgyDOKLu/R2pxTP46HiB3U9SDxkF4bdgH8vcktm5npqnH05BbRwZZKiR29XVYoqZpoyUn9rxEVF93IX906yXcYQDVzqbWC21jjY+OTyUmZqApdlsXLY85ZC9NTp8ko3Z/EW4b264FB3Ep1es4moMh/L4tQFShVWyhRHbBKYEu1xKFtwYQp18rsFc1KoXLDJvgRVu+4jHA/VzgY+ELg6dJd/D6m358ISVk+A4q3H1hJjamawmDUptQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7c/EGS7WUjw3gsHpQjGbazaUYSu4IMksaEAy6pLsHyI=; b=hUE9tIXXdvvxllljCbRJuB/gm+YzUCpt9JqEk/xovEqMr4/kEt3Hesap6oqDjvwVbJ8QNruoI5lShM75s+kr/HVIXO+xp/XXHlZ679tFkDg13sqMYsKrf/44EamJ9ZQpCKyQQYm3xe3F87KXymGApeUPH1SGxnjl36OpcOVXxH1d43F6qm6+wHy7EkIogVs7k+lJd+vH1WcqcwcI+yHSf0v8uxcfXzLfDUM+PYEStPt17tnLRtrPQTOoM2m13vuM7slxzfe328/vMVCn18peBjKaieyQTRzex3AKmHezCUOQQgVqmdOVZFrjbWA9zToUkR8Uo9sk2+C4ZUnc1GacDw== 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=7c/EGS7WUjw3gsHpQjGbazaUYSu4IMksaEAy6pLsHyI=; b=xS971WuTEp89/9ttBbGNBK/Pd+1mYGffuE5DRwDJ5QGMlQdUsd2njD7GoJysA1LkirQpDMQd7UGnRFGMmrx2y0SSvoJn6k3eFYxOlJTqxV8kSR9O8qFEbW8/hPzHCcB4ujXDRXJ8HXgiddJxqQbOaeG1Cb9CzRuPPjiNWP7PX3A= Received: from BN0PR02CA0009.namprd02.prod.outlook.com (2603:10b6:408:e4::14) by BY5PR12MB4051.namprd12.prod.outlook.com (2603:10b6:a03:20c::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13; Fri, 13 Jan 2023 05:35:06 +0000 Received: from BN8NAM11FT091.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e4:cafe::5f) by BN0PR02CA0009.outlook.office365.com (2603:10b6:408:e4::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13 via Frontend Transport; Fri, 13 Jan 2023 05:35:05 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;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; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT091.mail.protection.outlook.com (10.13.176.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6002.13 via Frontend Transport; Fri, 13 Jan 2023 05:35:05 +0000 Received: from majun-mlse-vm.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.2375.34; Thu, 12 Jan 2023 23:35:03 -0600 From: Ma Jun To: , Subject: [PATCH 2/2] drm/ttm: Use debugfs_remove_recursive to remove ttm directory Date: Fri, 13 Jan 2023 13:34:16 +0800 Message-ID: <20230113053416.2175988-2-Jun.Ma2@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230113053416.2175988-1-Jun.Ma2@amd.com> References: <20230113053416.2175988-1-Jun.Ma2@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-TrafficTypeDiagnostic: BN8NAM11FT091:EE_|BY5PR12MB4051:EE_ X-MS-Office365-Filtering-Correlation-Id: b07b33f0-93e7-4574-5b88-08daf527ecfe X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7T55GqSfJ7HozdE4jYtgIIDKmRwnEF0HFKtXkLf0AWClx2hAMspCtWWTRBx3S8H1NOVqhLQSYBUPqxPwhwSC8EfIXUo1bbE/9ageL8iEZvyGxiZAggeMHQnq1nvWQhH9gIXyAZK43ATMD0ahvs9pT2+fyZPvXlZjyXaHBCcARedR91G+sxefpTQ4TTv1/hvU0Kb42kFXIpgkJyvOmQZVJmGRZl3AASZUznFPHouCKvCE29YUHFQjL6Ycj6DZn5IC1YXpALhoddhEeYV3v3SDT7CYuxm7ZtENfm3eYNj4UTwvOL8llSreX7KX0e4kwpnMO8TkPCI8JQqGAEkhaw2JzjZ2Oi0h9gagLF3Oeypz526merkMhhIBnhEUsNWmgklS7l0zKNNaOxyHps890SeX9fDf33it7O1Xo37NvAOTv9Y8BtDBP7ztd7SUmKxmN6Wkx+zc69+PXMmS13yURw1D6wf/ioybkc+iV8owobfF7aj8z9jc9Z/vN3NpZt5qnqw1ZOVaSh3LvkRNJovKb4tTf2ocGYG56nXYlSRcDv7GVFTGxxAw8yv7WzjghKasuXlXoXSSxnxc3yFQiFkvXQaOtFKTYOZ/1HdgsZ5Xz18npyoNXax1nxN44QKM6Ipff4fwqEKpZ1NSSkH74kTUqAlS2bhjfcParJSzKFEdt5UatVC1aRi/10tKL5XJ6DCsKdfjWYLPDDMHQBdKNdGWmhLvyDr0qnJpzzZpf65toW0Dbco= 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:(13230022)(4636009)(136003)(376002)(39860400002)(396003)(346002)(451199015)(46966006)(36840700001)(40470700004)(2906002)(5660300002)(8936002)(26005)(36860700001)(4744005)(36756003)(41300700001)(40460700003)(186003)(16526019)(70206006)(40480700001)(8676002)(70586007)(450100002)(86362001)(356005)(4326008)(82740400003)(81166007)(7696005)(83380400001)(1076003)(6666004)(2616005)(478600001)(316002)(54906003)(110136005)(336012)(47076005)(82310400005)(426003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 05:35:05.4499 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b07b33f0-93e7-4574-5b88-08daf527ecfe 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: BN8NAM11FT091.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4051 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ma Jun , christian.koenig@amd.com, majun@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Use debugfs_remove_recursive to remove the /sys/kernel/debug/ttm directory for better compatibility. Becuase debugfs_remove fails on older kernel. Signed-off-by: Ma Jun --- drivers/gpu/drm/ttm/ttm_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ttm/ttm_device.c b/drivers/gpu/drm/ttm/ttm_device.c index 967bc2244df3..590297123bb2 100644 --- a/drivers/gpu/drm/ttm/ttm_device.c +++ b/drivers/gpu/drm/ttm/ttm_device.c @@ -55,7 +55,7 @@ static void ttm_global_release(void) goto out; ttm_pool_mgr_fini(); - debugfs_remove(ttm_debugfs_root); + debugfs_remove_recursive(ttm_debugfs_root); __free_page(glob->dummy_read_page); memset(glob, 0, sizeof(*glob));