From patchwork Fri Oct 8 09:17:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Das, Nirmoy" X-Patchwork-Id: 12544677 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C1A8C433EF for ; Fri, 8 Oct 2021 09:17:31 +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 6727B60E53 for ; Fri, 8 Oct 2021 09:17:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6727B60E53 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 466036E870; Fri, 8 Oct 2021 09:17:25 +0000 (UTC) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2051.outbound.protection.outlook.com [40.107.220.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id 70E286E86C; Fri, 8 Oct 2021 09:17:23 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AU0hQ5ikC4K9A8OPy1W/9SNkySK+PGasVsS1vweD3Wp9IVBKEPgMGfc7vUEYUhTPeY8+Ln9tbD19B5GI3ePktk1O8M4VKW4E5a8XJXtGKMvkFPKhTg7rJ3ev8Xu2F93t4LSCENvS8BKroYKo+2iQnZb3DnwrmVlCmdHjKO5EQu2EfW475nIYmZHbAjdzVaXzf7n91NiC2YauPfE/4wdrmp5CjU2K5Zq++gwn2s05NXvwD3AinVYMW8meebk2veSnUBZBHQNV0GPEZIelTz1E7Q3EtQXX7QKOQP9yR04zGKZJCM76L1Y1MYmMwZGvnWJ4LdxSrXxxM1UlrcLDe32CAg== 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=u06rmKXrZin+JAh2cAfs6lh4BIK6+k5nBomjiPUfDEk=; b=bxGczdEKaOV7Vxda5AlWb1HoMOSUJltQtgDddhRnuaf6yUhrhYIWo8VLarsbjZO6ZuhK2ys0lSJ1OsSjaU0zZh+tX+B9HMP9ZSVCWj5Rkls3NimBgGBqLASz3hlSH0FLHP62KwjRebcULHy1pmeEofGOmStbUocRH5d98uXvDpjOV9SrRrdOSnrGWANVpeVen8cAuqGLMh83WDKye3rrGakGOv4O6wCWWA2Ve9HT00hT7TmRPlDhGSFKFsBUw7ZAEtXNeES32BTyZnadUMZGtEjpF5cHSWAApXwY4XeNrKBvKcGLQc2aRNBVkIBhs+5R/bnuixHO5by0PGyoyRXznA== 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=u06rmKXrZin+JAh2cAfs6lh4BIK6+k5nBomjiPUfDEk=; b=OKqaGSyDYJxzJ7B14CcaL8N6aIyCpenTxQHPs8tIv91M45ZjEaafVMQUdVItdPKxuRk79HUmjKty6Bq1CD5yriTOPMrIIlhpY4U9Hr7q2g5c3xtkfKgUBawtTzssouToAnYv9+WHAKdmP2WpGShDBWx/W775wN3qsAFUaiXOPx0= Received: from DM5PR17CA0067.namprd17.prod.outlook.com (2603:10b6:3:13f::29) by CY4PR12MB1448.namprd12.prod.outlook.com (2603:10b6:910:f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18; Fri, 8 Oct 2021 09:17:21 +0000 Received: from DM6NAM11FT053.eop-nam11.prod.protection.outlook.com (2603:10b6:3:13f:cafe::5d) by DM5PR17CA0067.outlook.office365.com (2603:10b6:3:13f::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.19 via Frontend Transport; Fri, 8 Oct 2021 09:17:21 +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 DM6NAM11FT053.mail.protection.outlook.com (10.13.173.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4587.18 via Frontend Transport; Fri, 8 Oct 2021 09:17:20 +0000 Received: from brihaspati.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.2308.8; Fri, 8 Oct 2021 04:17:18 -0500 From: Nirmoy Das To: CC: , Nirmoy Das , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Subject: [PATCH 1/5] dri: cleanup debugfs error handling Date: Fri, 8 Oct 2021 11:17:00 +0200 Message-ID: <20211008091704.27094-1-nirmoy.das@amd.com> X-Mailer: git-send-email 2.32.0 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: 519ceada-296c-4f90-efe9-08d98a3c6e70 X-MS-TrafficTypeDiagnostic: CY4PR12MB1448: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:383; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CxpKOnyzv24j+6yoURAM1qMmntunUAntYgWwKWHQvu2jKuPS/OXjtV1ub6umBnm3AQPaIus91VIMUpSnNMvJ7XBrh2ZvZNXPwtHeXK5aGQhCt2RsEc4K39HtgXB51LMfbvBiRW09YI6fTPvwaWR3pzIw61d24vd7WQ9FBsZOMJLj4QhZ8CHnpXfhx3NDL7NG12pTQbAr3LX9KYjcaK0PYjwDlJb7PkAAh2fKXBjnUQ8FJwndkauP5ceNdhkvrELSnHgCVPgCrVIfgl0K4DfkR9GyTda2/rCZ/Z2omNsX0NZK/LqDPwnO10QHBVUPCd/5DVEtyhTn3D78tMRBnDTEH0AK8We/htk73qQC1X5rwSzkwX7Nb6vgx+NV+Hc3AfZxLnrsEVKtxtCakx0OIMht6zNsW52pXWMgnywQqQJ1VRlZmuKWiztW6fa4ps/0fBg4m+QSgUMYFU14gVZ194pTkUTD5Y1XULGrUNjTs0mGUm3DBUv+Do3AyyTA8n+GdolW11iVD6aimHshiVB0wD1MtiQPZChZf2yIATP2D86QjWaEcrAY11Ovm+Dc1wSbmwJO0coMvQpWi15W488g0/rcIACkNSVYi2dYkCI4D9m5TQ98oXYo9yTAf6cDwuE5QjbdEe9YbWLJS/inbWVPKYhXUpzGaGcnr9SO7etHXyRYkl3qfDJ9lwIF6xdwDbqwFV06uAwqXXb3i2gHGYD4vvgq/FKpMZagHYMilxZpRtJwzFQ= 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)(44832011)(2906002)(5660300002)(70206006)(83380400001)(70586007)(4326008)(7696005)(336012)(6666004)(426003)(2616005)(86362001)(82310400003)(8676002)(16526019)(508600001)(186003)(6916009)(26005)(36756003)(54906003)(356005)(81166007)(1076003)(47076005)(316002)(8936002)(36860700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2021 09:17:20.4392 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 519ceada-296c-4f90-efe9-08d98a3c6e70 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: DM6NAM11FT053.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1448 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" Debugfs API returns encoded error instead of NULL. This patch cleanups drm debugfs error handling to properly set dri and its minor's root dentry to NULL. Also do not error out if dri/minor debugfs directory creation fails as a debugfs error is not a fatal error. CC: Maarten Lankhorst CC: Maxime Ripard CC: Thomas Zimmermann CC: David Airlie CC: Daniel Vetter Signed-off-by: Nirmoy Das --- drivers/gpu/drm/drm_debugfs.c | 25 +++++++++++++++++++++++-- drivers/gpu/drm/drm_drv.c | 16 ++++++++++------ drivers/gpu/drm/drm_internal.h | 7 +++---- 3 files changed, 36 insertions(+), 12 deletions(-) -- 2.32.0 diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c index b0a826489488..af275a0c09b4 100644 --- a/drivers/gpu/drm/drm_debugfs.c +++ b/drivers/gpu/drm/drm_debugfs.c @@ -180,6 +180,9 @@ void drm_debugfs_create_files(const struct drm_info_list *files, int count, struct drm_info_node *tmp; int i; + if (!minor->debugfs_root) + return; + for (i = 0; i < count; i++) { u32 features = files[i].driver_features; @@ -203,7 +206,7 @@ void drm_debugfs_create_files(const struct drm_info_list *files, int count, } EXPORT_SYMBOL(drm_debugfs_create_files); -int drm_debugfs_init(struct drm_minor *minor, int minor_id, +void drm_debugfs_init(struct drm_minor *minor, int minor_id, struct dentry *root) { struct drm_device *dev = minor->dev; @@ -212,8 +215,16 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id, INIT_LIST_HEAD(&minor->debugfs_list); mutex_init(&minor->debugfs_lock); sprintf(name, "%d", minor_id); + + if (!root) + goto error; + minor->debugfs_root = debugfs_create_dir(name, root); + if (IS_ERR(minor->debugfs_root)) + goto error; + + drm_debugfs_create_files(drm_debugfs_list, DRM_DEBUGFS_ENTRIES, minor->debugfs_root, minor); @@ -230,7 +241,11 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id, if (dev->driver->debugfs_init) dev->driver->debugfs_init(minor); - return 0; + return; + +error: + minor->debugfs_root = NULL; + return; } @@ -241,6 +256,9 @@ int drm_debugfs_remove_files(const struct drm_info_list *files, int count, struct drm_info_node *tmp; int i; + if (!minor->debugfs_root) + return 0; + mutex_lock(&minor->debugfs_lock); for (i = 0; i < count; i++) { list_for_each_safe(pos, q, &minor->debugfs_list) { @@ -261,6 +279,9 @@ static void drm_debugfs_remove_all_files(struct drm_minor *minor) { struct drm_info_node *node, *tmp; + if (!minor->debugfs_root) + return; + mutex_lock(&minor->debugfs_lock); list_for_each_entry_safe(node, tmp, &minor->debugfs_list, list) { debugfs_remove(node->dent); diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 7a5097467ba5..fa57ec2d49bf 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -160,11 +160,7 @@ static int drm_minor_register(struct drm_device *dev, unsigned int type) if (!minor) return 0; - ret = drm_debugfs_init(minor, minor->index, drm_debugfs_root); - if (ret) { - DRM_ERROR("DRM: Failed to initialize /sys/kernel/debug/dri.\n"); - goto err_debugfs; - } + drm_debugfs_init(minor, minor->index, drm_debugfs_root); ret = device_add(minor->kdev); if (ret) @@ -1050,7 +1046,15 @@ static int __init drm_core_init(void) goto error; } - drm_debugfs_root = debugfs_create_dir("dri", NULL); + if (!debugfs_initialized()) { + drm_debugfs_root = NULL; + } else { + drm_debugfs_root = debugfs_create_dir("dri", NULL); + if (IS_ERR(drm_debugfs_root)) { + DRM_WARN("DRM: Failed to initialize /sys/kernel/debug/dri.\n"); + drm_debugfs_root = NULL; + } + } ret = register_chrdev(DRM_MAJOR, "drm", &drm_stub_fops); if (ret < 0) diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h index 17f3548c8ed2..e27a40166178 100644 --- a/drivers/gpu/drm/drm_internal.h +++ b/drivers/gpu/drm/drm_internal.h @@ -182,8 +182,8 @@ int drm_gem_dumb_destroy(struct drm_file *file, struct drm_device *dev, /* drm_debugfs.c drm_debugfs_crc.c */ #if defined(CONFIG_DEBUG_FS) -int drm_debugfs_init(struct drm_minor *minor, int minor_id, - struct dentry *root); +void drm_debugfs_init(struct drm_minor *minor, int minor_id, + struct dentry *root); void drm_debugfs_cleanup(struct drm_minor *minor); void drm_debugfs_connector_add(struct drm_connector *connector); void drm_debugfs_connector_remove(struct drm_connector *connector); @@ -191,10 +191,9 @@ void drm_debugfs_crtc_add(struct drm_crtc *crtc); void drm_debugfs_crtc_remove(struct drm_crtc *crtc); void drm_debugfs_crtc_crc_add(struct drm_crtc *crtc); #else -static inline int drm_debugfs_init(struct drm_minor *minor, int minor_id, +static inline void drm_debugfs_init(struct drm_minor *minor, int minor_id, struct dentry *root) { - return 0; } static inline void drm_debugfs_cleanup(struct drm_minor *minor) From patchwork Fri Oct 8 09:17:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Das, Nirmoy" X-Patchwork-Id: 12544683 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20153C433F5 for ; Fri, 8 Oct 2021 09:17:45 +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 D92AA60E53 for ; Fri, 8 Oct 2021 09:17:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D92AA60E53 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 7D6C76E873; Fri, 8 Oct 2021 09:17:30 +0000 (UTC) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2083.outbound.protection.outlook.com [40.107.237.83]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9A1F26E873; Fri, 8 Oct 2021 09:17:28 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WRa1yzKur9z3ly4H/jAQWXt2Zva4PNTDOr+x5i0ALBAkQcMkEb/dHuhL4Pk+W5Dbpuerp5EMjQ35uIftcSNS/gLYf9MOPH7BZQN7xS9s+u/Ic8zCBNEZMEaeMwi89urHSav7GiMNZdI4uSg3CotJ67ChSG3P8C+nAZgRIO485dFZnq6ZSwyiPYWDkKSlmFC91LYbMxnefzuZmoufINoLqhUatp6LNcfs7buzjdcvqqk+tBb8OtrMV6YXHPkNx6m+bK/81IexrfKodMsLdpL9+sV+E2wspBveSLRnZ+0diMNQw6ZLE/2HQxv9rwMHioX1nIazckOZJcYH7xEz8DkfdA== 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=sd/T76vZnTuvHrynw3dFGrkCvmJtdjAmRC8HKfTlv98=; b=CYrGen0+XOWzBr0PEC+1znEwZ6MdwRJaBxJ4phM8TPj1HPiOs7+MJybjhp6tOA5cVd395TXt5EnqAT6NbqpbK8Y9Tn+YYFb+0efaUz4FpBp09TOCArhfOLgQr3rqd+KVdKbMwgVkuXq2XomsD01Vh049veydCzl+BfL3HkPIMBM5YsGRPsDs6Zhdp8z1g0cgkhQdANOnojm/eiieIrUJUk6Qao5oC/qE7lRWcB/hNhQBoRmjjNVEDf3QQlZ5RfxTem3yxWZTm5QOAaPVf9arb1lomUs1iuLHm7iAIawKvRPiKWl7K/s7ZfRDNAYIFv5sFNB4dsBaoEFj3wpKw7BcfA== 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=sd/T76vZnTuvHrynw3dFGrkCvmJtdjAmRC8HKfTlv98=; b=yMHdc5cf8IKe2fOf1vXTKMsoTs6/41MZnwO5WzfcRH+TqiVM3kVNnikqmZDbvRMgjvtQ2LUFikYvEHej0YShPQRtVF31hnZhVfzet25zCM4ukUH6Isr7miWG1t8Sq0DNsfMymD/1/qL0pYiO0/haYkAACIoZlqipiLBf3ecaVUc= Received: from DM5PR17CA0062.namprd17.prod.outlook.com (2603:10b6:3:13f::24) by BY5PR12MB3844.namprd12.prod.outlook.com (2603:10b6:a03:1ad::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.19; Fri, 8 Oct 2021 09:17:23 +0000 Received: from DM6NAM11FT053.eop-nam11.prod.protection.outlook.com (2603:10b6:3:13f:cafe::19) by DM5PR17CA0062.outlook.office365.com (2603:10b6:3:13f::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Fri, 8 Oct 2021 09:17: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 DM6NAM11FT053.mail.protection.outlook.com (10.13.173.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4587.18 via Frontend Transport; Fri, 8 Oct 2021 09:17:22 +0000 Received: from brihaspati.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.2308.8; Fri, 8 Oct 2021 04:17:19 -0500 From: Nirmoy Das To: CC: , Nirmoy Das , "Zhenyu Wang" , Zhi Wang , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter Subject: [PATCH 2/5] drm/i915: check dri root before debugfs init Date: Fri, 8 Oct 2021 11:17:01 +0200 Message-ID: <20211008091704.27094-2-nirmoy.das@amd.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211008091704.27094-1-nirmoy.das@amd.com> References: <20211008091704.27094-1-nirmoy.das@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: 41b5a868-c28c-4c3f-d26b-08d98a3c6fd1 X-MS-TrafficTypeDiagnostic: BY5PR12MB3844: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:288; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GWdDVnvK0rZe5B3ifUYCjln6KtB4FhsJnrTfmVBONLU6dE8F1q7Vc2+ZydxFJnUn8iV5ij8RsB+g4I4ECI+HakR7hUdGjT0QQAGeFlO5GKBP1XNqb75xvNZLW+F7Kx1qYL0FKKadP1ZT5mlD0XlB90h035RzEzXtTD7TkyazJ7psZunA3cMBl0HhgQGRzmX7CZBxaPD/VDR/TMPLNETq6yeOuEXP5vRGmKikUYB2jrHf4H2bYdJe6w72qFVV0VeCuCj2EbLrFDefAckchqs+HnsDCYUZoMeVX82jDSSEh62jV3gP1Knab2Yfod2TlFFdpRWVQV109nwQD0JDa9TjIhKIz+We6w2ZYmio6gSrfpFHJb8fHMQ9qpjS5c07K2Sl8vFXmu/3M+whiPJptftbJPzVYRXe8+X8Bhco1+jfosGMUN1758bQjuKuWZggafTZzXbOUhGsqF6TjhAmuxoNc+Nj1VYuyFjXAOdM+iYmNSYQ/60UG1aGb6DVqzKixE0HlZXwaLRDRRNeI64E/RC2mthC7SISwPB8BwWXMBuCiuFdYeInbobELj7RjRaVNCafq0lThiK8LJUJsKTaOEtvZz7dQsLaiphRePeMoP8ypE0N10Yv3UtTIpY04dMo3fSDplS7PBlQzhpZOLP4dAWkAYOjVYiPEVqrcq3w0RYsHy77ftn6oowuhozZQd8qgy/0n5x/OXEaQRfX5VZNXtcYEF8MokPxutZRs344Zuj+LuM= 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)(1076003)(6916009)(70206006)(7696005)(508600001)(54906003)(6666004)(4326008)(16526019)(186003)(44832011)(26005)(82310400003)(47076005)(36756003)(8936002)(70586007)(36860700001)(5660300002)(336012)(356005)(86362001)(426003)(316002)(81166007)(8676002)(2616005)(2906002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2021 09:17:22.7049 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 41b5a868-c28c-4c3f-d26b-08d98a3c6fd1 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: DM6NAM11FT053.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB3844 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" Return early if dri minor root dentry is NULL. CC: Zhenyu Wang CC: Zhi Wang CC: Jani Nikula CC: Joonas Lahtinen CC: Rodrigo Vivi CC: David Airlie CC: Daniel Vetter Signed-off-by: Nirmoy Das Reviewed-by: Zhi Wang --- drivers/gpu/drm/i915/gvt/debugfs.c | 3 +++ drivers/gpu/drm/i915/i915_debugfs.c | 3 +++ 2 files changed, 6 insertions(+) -- 2.32.0 diff --git a/drivers/gpu/drm/i915/gvt/debugfs.c b/drivers/gpu/drm/i915/gvt/debugfs.c index 9f1c209d9251..2d47acaa03ee 100644 --- a/drivers/gpu/drm/i915/gvt/debugfs.c +++ b/drivers/gpu/drm/i915/gvt/debugfs.c @@ -187,6 +187,9 @@ void intel_gvt_debugfs_init(struct intel_gvt *gvt) { struct drm_minor *minor = gvt->gt->i915->drm.primary; + if (!minor->debugfs_root) + return; + gvt->debugfs_root = debugfs_create_dir("gvt", minor->debugfs_root); debugfs_create_ulong("num_tracked_mmio", 0444, gvt->debugfs_root, diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 44969f5dde50..d572b686edeb 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -1012,6 +1012,9 @@ void i915_debugfs_register(struct drm_i915_private *dev_priv) struct drm_minor *minor = dev_priv->drm.primary; int i; + if (!minor->debugfs_root) + return; + i915_debugfs_params(dev_priv); debugfs_create_file("i915_forcewake_user", S_IRUSR, minor->debugfs_root, From patchwork Fri Oct 8 09:17:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Das, Nirmoy" X-Patchwork-Id: 12544679 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59FDCC433FE for ; Fri, 8 Oct 2021 09:17: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 2833D60E53 for ; Fri, 8 Oct 2021 09:17:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2833D60E53 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 E5AA66F412; Fri, 8 Oct 2021 09:17:28 +0000 (UTC) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2049.outbound.protection.outlook.com [40.107.220.49]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4AC306E871; Fri, 8 Oct 2021 09:17:27 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZqrIzzFeyX20tdLwBZ86tb4zR6H129gkiVn7Le+j1L+dm4MhmNZOBjfHllHsmX2xcTCxNgdC6dNBMV676cbX3lzZSBea1bzNDdVmsHuFM7eU0KjKOxPCLf4S6NWIg+/biw6PM6d79QmFTdOSXD4xTsuoUSQIoPY3Hmrcka82zMLsDEu3IWyLmGKyC8KfrKsHexKXVk6RcHJoCJjzBOm9TkWji1/lroGVR1e6cAtCLBfv2JFeE8lirKOR/ofbTMno/D49YmW4/79IX9je6gAtcrEfvoV+dyRe3zm5g2At9DhCIKAbNP+md9KUk/FZB3AuXAp+MKKrN4BwwyXYAh6TIQ== 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=xbMJ4JmsFYHaAvFNj9rfg9N8g/IyI3zux5OH0cXhHyw=; b=B/q2/783u+r2G215HfTtleV3rGZGilIYaq/+ulv6G5GKQ0NIKU+T9ZnY/zMKLoDA12IaiSir3ijVnRz9IWOCqsdfVckZnpk8LFNxZGn3+7P//O06jLN4PGuyJu8CvP3M16DsQ4H0Ck8HoBqHRwwMGh7z+oej5n6bRd/vDojULmFpfcxjtST0dsyVOC7hKQfJxetv1T9YU5aPAOpHEWw+5rq4VbnvamSNeerrrwiFC7Rq3Y+rAsoDmtPd6UErAJZihSZnQfRAJldNeTdCKJ2hQ1fG5b1pqruklg1yi0+i58v/1NAu6hqF2lV2Di0dNaitvid0rGHf2w7VDkCLCBY0rA== 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=xbMJ4JmsFYHaAvFNj9rfg9N8g/IyI3zux5OH0cXhHyw=; b=tO8AjV3sJxYfV4DR0vPVhr7PIMg3TaB5LHdLNGFpb/sXqa4YxUTwTni08Kc6ly2H0Uk85VuryxGyRxnxpv4ow6AHqfozkrukyKkAnP7gfZsJXH3CNu+UamT2rTrfooUPcpm0DXFK0sk70cNchgwhip10xJ3LeygttSfoWDi/ww8= Received: from DM5PR17CA0072.namprd17.prod.outlook.com (2603:10b6:3:13f::34) by CO6PR12MB5459.namprd12.prod.outlook.com (2603:10b6:303:13b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18; Fri, 8 Oct 2021 09:17:25 +0000 Received: from DM6NAM11FT053.eop-nam11.prod.protection.outlook.com (2603:10b6:3:13f:cafe::c7) by DM5PR17CA0072.outlook.office365.com (2603:10b6:3:13f::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.19 via Frontend Transport; Fri, 8 Oct 2021 09:17: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 DM6NAM11FT053.mail.protection.outlook.com (10.13.173.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4587.18 via Frontend Transport; Fri, 8 Oct 2021 09:17:25 +0000 Received: from brihaspati.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.2308.8; Fri, 8 Oct 2021 04:17:21 -0500 From: Nirmoy Das To: CC: , Nirmoy Das , "Alex Deucher" , =?utf-8?q?Christian_K=C3=B6nig?= , "Pan, Xinhui" Subject: [PATCH 3/5] drm/radeon: check dri root before debugfs init Date: Fri, 8 Oct 2021 11:17:02 +0200 Message-ID: <20211008091704.27094-3-nirmoy.das@amd.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211008091704.27094-1-nirmoy.das@amd.com> References: <20211008091704.27094-1-nirmoy.das@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: cb37df61-8a9a-4c8b-c777-08d98a3c715e X-MS-TrafficTypeDiagnostic: CO6PR12MB5459: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:72; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ens6D4J9t0FardCKM4cVqO/hglsOBG0b532CLipqaO+EON2eEUROt5npGY+HTVtbR6UgqLzyAT9pL92GeoOu9cv5Sc4MejE1sxZsDEXXGfaTduMkCGWfeLMH6msfvEsQNCwbUiKQyf7Kf8SGHv21ZhKbbdk3NF0AaaKa6KfMkdNZwUTwd1D8JBYkKODXd0esbzzw2NIwgH7iOp7mDbtqfrf4phxU1nKgh3MvjwBs6LXzwpW2xHtils8OTKHIhDBxHDy0LNVxznXy3VlxsxrWj7JHvQuAe4g4+cCpl4qRozikfdr9DUfw7gj8OZsbHwKWKuFfUvR86/pyDYsH6bHnm1ZG5XUyVjpHZZfydAkp8LnjjmsJF/YqHINa4ArNLkFWE7K4E1W2HbhJJ9l5zi0BuIfzP0mn82UkdatXPLq+qzocN6arr4eUnlNv8KlN3HeOkPC5jWj380KpGAsalkipCbKL0LXpiufWtAhA9M4vH6LTDTszMGnAC3JcEJazX5+D12er1y9qkdKSiA7Xbgib/YRvwLcbubEuxVG2UA3iiBR0TbFzwQCKuk4dZTE8mck4HkJsGYUQJmeEuHBvOicc6eHnsVlfFrHtiVzusMWrJKzMjncpjlieMiqNtGfIE9BAO0toDIOI1fh4BLdU2ijYp/QI7dIYm7+RFAz5/zDoQ0+iybs5Ky4aXWOUiSPXqIicI066Ersp+eBKKdSlXmeDT9Qm9x5jOk9ivehpsGP3hqk= 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)(36840700001)(46966006)(356005)(81166007)(44832011)(47076005)(86362001)(82310400003)(26005)(336012)(8936002)(2616005)(426003)(316002)(54906003)(70206006)(70586007)(36860700001)(508600001)(6666004)(66574015)(1076003)(7696005)(8676002)(16526019)(36756003)(83380400001)(186003)(6916009)(5660300002)(450100002)(2906002)(4326008)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2021 09:17:25.3184 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cb37df61-8a9a-4c8b-c777-08d98a3c715e 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: DM6NAM11FT053.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR12MB5459 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" Return early if dri minor root dentry is NULL. CC: Alex Deucher CC: "Christian König" CC: "Pan, Xinhui" Signed-off-by: Nirmoy Das Acked-by: Christian König --- drivers/gpu/drm/radeon/r100.c | 9 +++++++++ drivers/gpu/drm/radeon/r300.c | 3 +++ drivers/gpu/drm/radeon/r420.c | 3 +++ drivers/gpu/drm/radeon/r600.c | 3 +++ drivers/gpu/drm/radeon/radeon_dp_mst.c | 3 +++ drivers/gpu/drm/radeon/radeon_fence.c | 3 +++ drivers/gpu/drm/radeon/radeon_gem.c | 3 +++ drivers/gpu/drm/radeon/radeon_ib.c | 3 +++ drivers/gpu/drm/radeon/radeon_pm.c | 5 ++++- drivers/gpu/drm/radeon/radeon_ring.c | 3 +++ drivers/gpu/drm/radeon/radeon_ttm.c | 3 +++ drivers/gpu/drm/radeon/rs400.c | 3 +++ drivers/gpu/drm/radeon/rv515.c | 3 +++ 13 files changed, 46 insertions(+), 1 deletion(-) -- 2.32.0 diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index 2dd85ba1faa2..ae6c95b34013 100644 --- a/drivers/gpu/drm/radeon/r100.c +++ b/drivers/gpu/drm/radeon/r100.c @@ -3059,6 +3059,9 @@ void r100_debugfs_rbbm_init(struct radeon_device *rdev) #if defined(CONFIG_DEBUG_FS) struct dentry *root = rdev->ddev->primary->debugfs_root; + if (!root) + return; + debugfs_create_file("r100_rbbm_info", 0444, root, rdev, &r100_debugfs_rbbm_info_fops); #endif @@ -3069,6 +3072,9 @@ void r100_debugfs_cp_init(struct radeon_device *rdev) #if defined(CONFIG_DEBUG_FS) struct dentry *root = rdev->ddev->primary->debugfs_root; + if (!root) + return; + debugfs_create_file("r100_cp_ring_info", 0444, root, rdev, &r100_debugfs_cp_ring_info_fops); debugfs_create_file("r100_cp_csq_fifo", 0444, root, rdev, @@ -3081,6 +3087,9 @@ void r100_debugfs_mc_info_init(struct radeon_device *rdev) #if defined(CONFIG_DEBUG_FS) struct dentry *root = rdev->ddev->primary->debugfs_root; + if (!root) + return; + debugfs_create_file("r100_mc_info", 0444, root, rdev, &r100_debugfs_mc_info_fops); #endif diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c index 621ff174dff3..b22969e2394f 100644 --- a/drivers/gpu/drm/radeon/r300.c +++ b/drivers/gpu/drm/radeon/r300.c @@ -618,6 +618,9 @@ static void rv370_debugfs_pcie_gart_info_init(struct radeon_device *rdev) #if defined(CONFIG_DEBUG_FS) struct dentry *root = rdev->ddev->primary->debugfs_root; + if (!root) + return; + debugfs_create_file("rv370_pcie_gart_info", 0444, root, rdev, &rv370_debugfs_pcie_gart_info_fops); #endif diff --git a/drivers/gpu/drm/radeon/r420.c b/drivers/gpu/drm/radeon/r420.c index 7e6320e8c6a0..cdb4ac3e346b 100644 --- a/drivers/gpu/drm/radeon/r420.c +++ b/drivers/gpu/drm/radeon/r420.c @@ -494,6 +494,9 @@ void r420_debugfs_pipes_info_init(struct radeon_device *rdev) #if defined(CONFIG_DEBUG_FS) struct dentry *root = rdev->ddev->primary->debugfs_root; + if (!root) + return; + debugfs_create_file("r420_pipes_info", 0444, root, rdev, &r420_debugfs_pipes_info_fops); #endif diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index ca3fcae2adb5..d8f525cf0c3b 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c @@ -4360,6 +4360,9 @@ static void r600_debugfs_mc_info_init(struct radeon_device *rdev) #if defined(CONFIG_DEBUG_FS) struct dentry *root = rdev->ddev->primary->debugfs_root; + if (!root) + return; + debugfs_create_file("r600_mc_info", 0444, root, rdev, &r600_debugfs_mc_info_fops); diff --git a/drivers/gpu/drm/radeon/radeon_dp_mst.c b/drivers/gpu/drm/radeon/radeon_dp_mst.c index ec867fa880a4..cf06da89bb7c 100644 --- a/drivers/gpu/drm/radeon/radeon_dp_mst.c +++ b/drivers/gpu/drm/radeon/radeon_dp_mst.c @@ -771,6 +771,9 @@ void radeon_mst_debugfs_init(struct radeon_device *rdev) #if defined(CONFIG_DEBUG_FS) struct dentry *root = rdev->ddev->primary->debugfs_root; + if (!root) + return; + debugfs_create_file("radeon_mst_info", 0444, root, rdev, &radeon_debugfs_mst_info_fops); diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c index 73e3117420bf..11f30349de46 100644 --- a/drivers/gpu/drm/radeon/radeon_fence.c +++ b/drivers/gpu/drm/radeon/radeon_fence.c @@ -1006,6 +1006,9 @@ void radeon_debugfs_fence_init(struct radeon_device *rdev) #if defined(CONFIG_DEBUG_FS) struct dentry *root = rdev->ddev->primary->debugfs_root; + if (!root) + return; + debugfs_create_file("radeon_gpu_reset", 0444, root, rdev, &radeon_debugfs_gpu_reset_fops); debugfs_create_file("radeon_fence_info", 0444, root, rdev, diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c index 458f92a70887..e6df1451af37 100644 --- a/drivers/gpu/drm/radeon/radeon_gem.c +++ b/drivers/gpu/drm/radeon/radeon_gem.c @@ -890,6 +890,9 @@ void radeon_gem_debugfs_init(struct radeon_device *rdev) #if defined(CONFIG_DEBUG_FS) struct dentry *root = rdev->ddev->primary->debugfs_root; + if (!root) + return; + debugfs_create_file("radeon_gem_info", 0444, root, rdev, &radeon_debugfs_gem_info_fops); diff --git a/drivers/gpu/drm/radeon/radeon_ib.c b/drivers/gpu/drm/radeon/radeon_ib.c index 62b116727b4f..28316eb4fd49 100644 --- a/drivers/gpu/drm/radeon/radeon_ib.c +++ b/drivers/gpu/drm/radeon/radeon_ib.c @@ -311,6 +311,9 @@ static void radeon_debugfs_sa_init(struct radeon_device *rdev) #if defined(CONFIG_DEBUG_FS) struct dentry *root = rdev->ddev->primary->debugfs_root; + if (!root) + return; + debugfs_create_file("radeon_sa_info", 0444, root, rdev, &radeon_debugfs_sa_info_fops); #endif diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c index c67b6ddb29a4..c09e574d04f0 100644 --- a/drivers/gpu/drm/radeon/radeon_pm.c +++ b/drivers/gpu/drm/radeon/radeon_pm.c @@ -1958,6 +1958,9 @@ static void radeon_debugfs_pm_init(struct radeon_device *rdev) #if defined(CONFIG_DEBUG_FS) struct dentry *root = rdev->ddev->primary->debugfs_root; + if (!root) + return; + debugfs_create_file("radeon_pm_info", 0444, root, rdev, &radeon_debugfs_pm_info_fops); diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeon/radeon_ring.c index 7e207276df37..31a5b1ebf7c9 100644 --- a/drivers/gpu/drm/radeon/radeon_ring.c +++ b/drivers/gpu/drm/radeon/radeon_ring.c @@ -550,6 +550,9 @@ static void radeon_debugfs_ring_init(struct radeon_device *rdev, struct radeon_r const char *ring_name = radeon_debugfs_ring_idx_to_name(ring->idx); struct dentry *root = rdev->ddev->primary->debugfs_root; + if (!root) + return; + if (ring_name) debugfs_create_file(ring_name, 0444, root, ring, &radeon_debugfs_ring_info_fops); diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c index 11b21d605584..2e18ec93768d 100644 --- a/drivers/gpu/drm/radeon/radeon_ttm.c +++ b/drivers/gpu/drm/radeon/radeon_ttm.c @@ -942,6 +942,9 @@ static void radeon_ttm_debugfs_init(struct radeon_device *rdev) struct drm_minor *minor = rdev->ddev->primary; struct dentry *root = minor->debugfs_root; + if (!root) + return; + debugfs_create_file("radeon_vram", 0444, root, rdev, &radeon_ttm_vram_fops); diff --git a/drivers/gpu/drm/radeon/rs400.c b/drivers/gpu/drm/radeon/rs400.c index 6383f7a34bd8..b41a903a29c3 100644 --- a/drivers/gpu/drm/radeon/rs400.c +++ b/drivers/gpu/drm/radeon/rs400.c @@ -380,6 +380,9 @@ static void rs400_debugfs_pcie_gart_info_init(struct radeon_device *rdev) #if defined(CONFIG_DEBUG_FS) struct dentry *root = rdev->ddev->primary->debugfs_root; + if (!root) + return; + debugfs_create_file("rs400_gart_info", 0444, root, rdev, &rs400_debugfs_gart_info_fops); #endif diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c index 63fb06e8e2d7..f39b6ab554f2 100644 --- a/drivers/gpu/drm/radeon/rv515.c +++ b/drivers/gpu/drm/radeon/rv515.c @@ -257,6 +257,9 @@ void rv515_debugfs(struct radeon_device *rdev) #if defined(CONFIG_DEBUG_FS) struct dentry *root = rdev->ddev->primary->debugfs_root; + if (!root) + return; + debugfs_create_file("rv515_pipes_info", 0444, root, rdev, &rv515_debugfs_pipes_info_fops); debugfs_create_file("rv515_ga_info", 0444, root, rdev, From patchwork Fri Oct 8 09:17:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Das, Nirmoy" X-Patchwork-Id: 12544681 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD6B4C433FE for ; Fri, 8 Oct 2021 09:17:42 +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 8743E60E53 for ; Fri, 8 Oct 2021 09:17:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8743E60E53 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 421A86F418; Fri, 8 Oct 2021 09:17:29 +0000 (UTC) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2059.outbound.protection.outlook.com [40.107.93.59]) by gabe.freedesktop.org (Postfix) with ESMTPS id 581EA6E873; Fri, 8 Oct 2021 09:17:27 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cHS0ceIwuK30z/NkHPDXxDIy4U1Jazjh1Cjv/fJRg1OroG7ttydZ4NNsaqrimCG9iAWTVrAnOcQWLpNqro+bcmlsPe9leVKotnB/AiEgSOS1PrfFS/e3KjSIWKSohgDtK16ebm21APStSlvlkwzsir3heZOaCeY7SwjT6LifVPNBCkI0PisAWXg7P24K1j7CZ7GiZew86UmCymnr3q9ZelCD/eWFROim+8FYtSUvn3ZpytCOCYCsGXGIC12ASAUpaZZ+1+K2b/uQ8LhQPyvusY129qInc4c0QXwtjd/prGouZalizl/AS3XVabl8lS19a8FivfOtQnJKrTpe8Y9XpA== 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=EfG/NPxi6Wh05rcXeWGXm+cz6aZCVpJa59jM7gRhPx8=; b=jNsJjMNxs2WZ9R67fU2cjkR50mJdedaOHUwBleczx8x5PdJ8rFtjt2adPnFyrwhMBn8S9yi0qITyKILy3pKt55cygKY7UZNUh2x36SUPDyvaRPex3MY+PJuwGTEckEJV+tz0fHwY5V4j+bqr2rkfK2wg0Wy4lwzGZG9x9VoX5bHZsLByy6OnnTm1HuERm0f3y/E3vltzO3yywIHYsbIAfLZhP24TMd3cf8CsjRh3AAeIL/h/a61pTB1WlHHpN2rc4/fLFfwoQjuKgzNcJx1noGu0+0qUeRrtVKAPB6/XYMPJ/VtcpzctAeJh3HFoEuSsK6euIHj6SseO4Fl10CS0yg== 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=EfG/NPxi6Wh05rcXeWGXm+cz6aZCVpJa59jM7gRhPx8=; b=zoEVrkSfRRfY5yQNRqE0RqRKlxFkE44dYy++YsJvgroiTYNjEI7b7ZYy47uLwLmB6bC9Wf09Ki0MwtIWiLBQJaAH88zd+h7sP7GUXtbvU8KGVOGQb+egBwu91fIHIS4L1344kMaKR9C1ldkv+I0N5cumr6z7EWy46DFl0RiuQrY= Received: from DM5PR17CA0061.namprd17.prod.outlook.com (2603:10b6:3:13f::23) by DM8PR12MB5461.namprd12.prod.outlook.com (2603:10b6:8:3a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18; Fri, 8 Oct 2021 09:17:26 +0000 Received: from DM6NAM11FT053.eop-nam11.prod.protection.outlook.com (2603:10b6:3:13f:cafe::62) by DM5PR17CA0061.outlook.office365.com (2603:10b6:3:13f::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.20 via Frontend Transport; Fri, 8 Oct 2021 09:17: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 DM6NAM11FT053.mail.protection.outlook.com (10.13.173.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4587.18 via Frontend Transport; Fri, 8 Oct 2021 09:17:25 +0000 Received: from brihaspati.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.2308.8; Fri, 8 Oct 2021 04:17:22 -0500 From: Nirmoy Das To: CC: , Nirmoy Das , Russell King , David Airlie , Daniel Vetter Subject: [PATCH 4/5] drm/armada: check dri/crtc root before debugfs init Date: Fri, 8 Oct 2021 11:17:03 +0200 Message-ID: <20211008091704.27094-4-nirmoy.das@amd.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211008091704.27094-1-nirmoy.das@amd.com> References: <20211008091704.27094-1-nirmoy.das@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: 04d4aad9-fca0-44e3-5588-08d98a3c71ab X-MS-TrafficTypeDiagnostic: DM8PR12MB5461: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:346; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Yowf4qtJSr7PWIoHopRllXwVyLWFO2QWqhYlW6lURPCTBVcPkHWALLnR73eVPxJ8CCZL0Q4yXh5jSMHQZzk+57usCIvawL+GxkSActSodX7OyPkq33yEE6sz8eXYhDDosao9MPOw7y2uidT0aWwGpuUDxCFMtRSlxnACD6tBfBjCtnC2uFBLTxlO4q9EmdByUrDMqa3YMxsjPw4PeVy14zRBsE3x1y4XgPA8RwfnDcJse43y//jGa6hG9JnrFcic71l/wQk6Drxezj4aE+rdJDA7BABd842NjfWesKnFLHQ+///7FH68u9POyyTKbXxGUmpjZcEC6nbi0n2EDRu/wE/L+ViIVBHoKp99sH3IQ6Vdyyt3rxGyjNU+i9RUXYs8UTGTN7lnmlN6FG608I5f9LCh4ZO7SIR69s+3NJ4yYLD+uptON+hKFyo/fBP96YEjiOGS4/vJ2V8Hojnokb8/ejGOVjLeGYU3Z0OdujDWrHH7KNE/HNdbRbwsQsaKevUSePAO010DRcUzusnXU0zdeRXib8vnu59Gq07qBMTNg4ql3aNpEnvzlaISMQEBrUQhptQi1KKTMXAEi62Ec8U7XvDq0LXaakqdIlV0ONUYCgg4mxUVywP8AGA0YlwsUhb2ZI1M1NxqaN4L5cvmpjdnP0/o30VDUTdFktswpyxUL/JwUjwa6Rts60r5QvkS0vHLoBKgyIPW9LoX2YUJXrs538W/Seauw9uXWvysvxO+c2s= 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)(70206006)(26005)(8676002)(186003)(2906002)(36756003)(36860700001)(54906003)(70586007)(82310400003)(6666004)(508600001)(7696005)(1076003)(16526019)(8936002)(81166007)(356005)(2616005)(44832011)(6916009)(426003)(4326008)(5660300002)(47076005)(86362001)(336012)(316002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2021 09:17:25.8411 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 04d4aad9-fca0-44e3-5588-08d98a3c71ab 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: DM6NAM11FT053.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR12MB5461 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" Return early if dri minor root dentry is NULL. CC: Russell King CC: David Airlie CC: Daniel Vetter Signed-off-by: Nirmoy Das Reported-by: kernel test robot --- drivers/gpu/drm/armada/armada_debugfs.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.32.0 diff --git a/drivers/gpu/drm/armada/armada_debugfs.c b/drivers/gpu/drm/armada/armada_debugfs.c index 29f4b52e3c8d..b40003fe4a89 100644 --- a/drivers/gpu/drm/armada/armada_debugfs.c +++ b/drivers/gpu/drm/armada/armada_debugfs.c @@ -93,6 +93,9 @@ static const struct file_operations armada_debugfs_crtc_reg_fops = { void armada_drm_crtc_debugfs_init(struct armada_crtc *dcrtc) { + if (!dcrtc->crtc.debugfs_entry) + return; + debugfs_create_file("armada-regs", 0600, dcrtc->crtc.debugfs_entry, dcrtc, &armada_debugfs_crtc_reg_fops); } @@ -104,6 +107,9 @@ static struct drm_info_list armada_debugfs_list[] = { int armada_drm_debugfs_init(struct drm_minor *minor) { + if (!minor->debugfs_root) + return; + drm_debugfs_create_files(armada_debugfs_list, ARMADA_DEBUGFS_ENTRIES, minor->debugfs_root, minor); From patchwork Fri Oct 8 09:17:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Das, Nirmoy" X-Patchwork-Id: 12544685 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82930C4332F for ; Fri, 8 Oct 2021 09:17:48 +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 54D2560E53 for ; Fri, 8 Oct 2021 09:17:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 54D2560E53 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 E01916F463; Fri, 8 Oct 2021 09:17:36 +0000 (UTC) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2054.outbound.protection.outlook.com [40.107.220.54]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7284D6F41C; Fri, 8 Oct 2021 09:17:29 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eH31UFubL3zwSwctdiPuXfC3ZMKRoLtM/V1zbVrwazd+JuV9+DzDZvg9eGHyKsMVq1ac382/WpFEo2bQoF3hZonxJoqh5Cs9cf8ASwUvXFvu+uY2F4KCDAEkSt+O2b4gKr7US6uw6KLrp4CqysOBtRYabEYUVdEE+sxpXQlYXrIXf25eWAQ0pTblefBbtHRPfkbWin84fu5spF4zEPHv91b/2i0gSMUp9cxN9tkKlBC4ACIMFoEZSvk9f+hU93iNIlBIOgTH7pXsOjLKWPmnFTa2RMvPFL4M8Cm3iR22/PBvNAD2YrS6IC9GsAk0WEuiLyHBAN4Q6DYJcWntvsPkeg== 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=9ELd+NLVY+PiXPNN8OXyDZYbp5CdVhjzfdlUUHK0QlM=; b=U6PmzHyAI+o+HinHGJmiW6bQWgiDugIFpqyUqL9ltDXus9UM1hFlNbDuDzRDIrxw22OszM2XC/heku/58/uNvihR0fox0yn6bMu5PbhndpyFCzhECxYtTV47/ZzE/7pSTgDzuooCJMaQ36J2XKM+uILOUahX55YNAhueHvJY2zkde/Q1ohDyqGFOhV5DZxGg5ZysQbvkraL2eUur55HGFqCNfSUJ+vKf8KGuRcFbbt3MuSxXLAjkVexWpFAAGYlQuXaJC2hv5u4y5gJp8f+jM4KL04JlwdlnC8WxIlzTjcpfK675Emv0A6Y3iaAduoGFFo4/fby+CrhXAWKRCCVh3Q== 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=9ELd+NLVY+PiXPNN8OXyDZYbp5CdVhjzfdlUUHK0QlM=; b=MzokpLt1ADenGoW0CDOO/ljOOB1LCzuk+pSghZbAM+ixy973IO2x4xy8c7f71pSHliykq9WHyiHvbK57ebLGE7GR3/P7jXNYrGQJZ3m9G++ole4c+GEFCkru5ch2yT854kVbrby6MO8awm+yeMExEQ3UT97lrbYaEHbwRIkMtQU= Received: from DM5PR17CA0065.namprd17.prod.outlook.com (2603:10b6:3:13f::27) by MW3PR12MB4474.namprd12.prod.outlook.com (2603:10b6:303:2e::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.22; Fri, 8 Oct 2021 09:17:26 +0000 Received: from DM6NAM11FT053.eop-nam11.prod.protection.outlook.com (2603:10b6:3:13f:cafe::33) by DM5PR17CA0065.outlook.office365.com (2603:10b6:3:13f::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Fri, 8 Oct 2021 09:17: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 DM6NAM11FT053.mail.protection.outlook.com (10.13.173.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4587.18 via Frontend Transport; Fri, 8 Oct 2021 09:17:26 +0000 Received: from brihaspati.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.2308.8; Fri, 8 Oct 2021 04:17:24 -0500 From: Nirmoy Das To: CC: , Nirmoy Das , Thierry Reding , David Airlie , Daniel Vetter , Jonathan Hunter Subject: [PATCH 5/5] drm/tegra: check root dentry before debugfs init Date: Fri, 8 Oct 2021 11:17:04 +0200 Message-ID: <20211008091704.27094-5-nirmoy.das@amd.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211008091704.27094-1-nirmoy.das@amd.com> References: <20211008091704.27094-1-nirmoy.das@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: 43f9dc84-4ad9-4ae7-2e7b-08d98a3c71e8 X-MS-TrafficTypeDiagnostic: MW3PR12MB4474: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:366; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: m1trmWtWYd01qWzrMuiO7hUkiy0EKXXKM0PXzjWI3fswGfulWAQLvJcUhcEGkAONHKkTP3gkbxGMrRd69M6ePE5lpVG3n9/tOhOAWWt2bLvnlfri97/qT4m3t/9iNsI3BQaA1jY0dA4hjWfsMGCDECTZoUOQhA9CF4ho8tXjedNo886kDvIS4VUTrf9AHkQ5VhCVy3wwhg+fOLJarB4jF/dd+hJuKP7SitEsyXKHv7CcUXgDtqoIU+ytmMUeX/S0op/DAkc1GfRnUoYPr0RA8nUHj+ue+NvnUfiBNQHhrxyOyzBadwW2ehmz6ztuutz0VC8JEDgwzclWzs9k0W1wyOJRklXu1+Dt5dvNwboAcn8SDuyRJd0gbHKQ7Bb8XMPJq3xhiA7cMbxq6azecp3IWYlUh4FWwHfxx9+uhLLEZbSrcd23PJkuU1/VObhpJDqfvjH5OKyRE5T+oFytkzA64yYjWjYpt0elINZ6BH2mK2bSpMmu0cWhy7f1ZtgB7ooQrzNa1H1OUYWoDSUh8fACSmenm1EsQJYqI0Uq4FAZdZuzxfdZySa50L5wdS95/e5aHlPW+xs4wjHYCzbb8OGvb4keH6DB9c73m6tunlKfX82CvR9ivqecYuJbFEtYInpPAIdliWl2xbJkrqfhGV6alL0XBjmulEKV/fsWmHmbcMMcQXzVn+rEgtfv/MZTBbPr82emGDfWPU+j1lQPkz8bImKxCZC6qnmV9dvFdfCQc44= 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)(36840700001)(46966006)(7696005)(54906003)(316002)(44832011)(36860700001)(508600001)(8676002)(6666004)(26005)(70206006)(86362001)(36756003)(186003)(16526019)(1076003)(70586007)(82310400003)(2906002)(4326008)(5660300002)(8936002)(47076005)(426003)(336012)(6916009)(2616005)(356005)(81166007)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2021 09:17:26.1889 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 43f9dc84-4ad9-4ae7-2e7b-08d98a3c71e8 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: DM6NAM11FT053.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4474 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" Return early if crtc or connector's debugfs root dentries are NULL. CC: Thierry Reding CC: David Airlie CC: Daniel Vetter CC: Jonathan Hunter Signed-off-by: Nirmoy Das Reported-by: kernel test robot --- drivers/gpu/drm/tegra/dc.c | 5 +++++ drivers/gpu/drm/tegra/dsi.c | 4 ++++ drivers/gpu/drm/tegra/hdmi.c | 5 +++++ drivers/gpu/drm/tegra/sor.c | 4 ++++ 4 files changed, 18 insertions(+) -- 2.32.0 diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index 16c7aabb94d3..87eeda68d231 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -1623,6 +1623,11 @@ static int tegra_dc_late_register(struct drm_crtc *crtc) struct dentry *root; struct tegra_dc *dc = to_tegra_dc(crtc); + if (!crtc->debugfs_entry) { + dc->debugfs_files = NULL; + return 0; + } + #ifdef CONFIG_DEBUG_FS root = crtc->debugfs_entry; #else diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c index f46d377f0c30..f0263165e261 100644 --- a/drivers/gpu/drm/tegra/dsi.c +++ b/drivers/gpu/drm/tegra/dsi.c @@ -236,6 +236,10 @@ static int tegra_dsi_late_register(struct drm_connector *connector) struct dentry *root = connector->debugfs_entry; struct tegra_dsi *dsi = to_dsi(output); + if (!root) { + dsi->debugfs_files = NULL; + return 0; + } dsi->debugfs_files = kmemdup(debugfs_files, sizeof(debugfs_files), GFP_KERNEL); if (!dsi->debugfs_files) diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c index e5d2a4026028..400319db0afc 100644 --- a/drivers/gpu/drm/tegra/hdmi.c +++ b/drivers/gpu/drm/tegra/hdmi.c @@ -1065,6 +1065,11 @@ static int tegra_hdmi_late_register(struct drm_connector *connector) struct dentry *root = connector->debugfs_entry; struct tegra_hdmi *hdmi = to_hdmi(output); + if (!root) { + hdmi->debugfs_files = NULL; + return 0; + } + hdmi->debugfs_files = kmemdup(debugfs_files, sizeof(debugfs_files), GFP_KERNEL); if (!hdmi->debugfs_files) diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c index 0ea320c1092b..a8a3b0a587d9 100644 --- a/drivers/gpu/drm/tegra/sor.c +++ b/drivers/gpu/drm/tegra/sor.c @@ -1687,6 +1687,10 @@ static int tegra_sor_late_register(struct drm_connector *connector) struct dentry *root = connector->debugfs_entry; struct tegra_sor *sor = to_sor(output); + if (!root) { + sor->debugfs_files = NULL; + return 0; + } sor->debugfs_files = kmemdup(debugfs_files, sizeof(debugfs_files), GFP_KERNEL); if (!sor->debugfs_files)