From patchwork Tue Nov 29 20:19:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jyri Sarha X-Patchwork-Id: 9453087 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 253F46071C for ; Tue, 29 Nov 2016 20:19:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 19742283D3 for ; Tue, 29 Nov 2016 20:19:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0DB83283F1; Tue, 29 Nov 2016 20:19:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A05DB283D3 for ; Tue, 29 Nov 2016 20:19:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5E2A96E69D; Tue, 29 Nov 2016 20:19:22 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lelnx194.ext.ti.com (lelnx194.ext.ti.com [198.47.27.80]) by gabe.freedesktop.org (Postfix) with ESMTPS id F37266E69D for ; Tue, 29 Nov 2016 20:19:20 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id uATKJGOS028954; Tue, 29 Nov 2016 14:19:16 -0600 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id uATKJG5S023983; Tue, 29 Nov 2016 14:19:16 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.294.0; Tue, 29 Nov 2016 14:19:16 -0600 Received: from jadmar.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id uATKJE2M020034; Tue, 29 Nov 2016 14:19:14 -0600 From: Jyri Sarha To: Subject: [PATCH] drm/atomic: debugfs atomic state should be removed too Date: Tue, 29 Nov 2016 22:19:10 +0200 Message-ID: <1480450750-13398-1-git-send-email-jsarha@ti.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Cc: Jyri Sarha , tomi.valkeinen@ti.com, laurent.pinchart@ideasonboard.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 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" X-Virus-Scanned: ClamAV using ClamSMTP If atomic state file is not removed from debugfs it will prevent atomic driver modules from reloading after unload when debugfs is enabled. Fixes commit 6559c901cb484 ("drm/atomic: add debugfs file to dump out atomic state") Signed-off-by: Jyri Sarha --- drivers/gpu/drm/drm_atomic.c | 6 ++++++ drivers/gpu/drm/drm_debugfs.c | 2 ++ include/drm/drm_atomic.h | 1 + 3 files changed, 9 insertions(+) diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index b476ec5..0db642a 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -1686,6 +1686,12 @@ int drm_atomic_debugfs_init(struct drm_minor *minor) ARRAY_SIZE(drm_atomic_debugfs_list), minor->debugfs_root, minor); } + +void drm_atomic_debugfs_fini(struct drm_minor *minor) +{ + drm_debugfs_remove_files(drm_atomic_debugfs_list, + ARRAY_SIZE(drm_atomic_debugfs_list), minor); +} #endif /* diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c index 206a4fe..68be42c 100644 --- a/drivers/gpu/drm/drm_debugfs.c +++ b/drivers/gpu/drm/drm_debugfs.c @@ -237,6 +237,8 @@ int drm_debugfs_cleanup(struct drm_minor *minor) drm_debugfs_remove_files(drm_debugfs_list, DRM_DEBUGFS_ENTRIES, minor); + drm_atomic_debugfs_fini(minor); + debugfs_remove(minor->debugfs_root); minor->debugfs_root = NULL; diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h index c0eaec7..c8cec34 100644 --- a/include/drm/drm_atomic.h +++ b/include/drm/drm_atomic.h @@ -372,6 +372,7 @@ void drm_atomic_set_fence_for_plane(struct drm_plane_state *plane_state, #ifdef CONFIG_DEBUG_FS struct drm_minor; int drm_atomic_debugfs_init(struct drm_minor *minor); +void drm_atomic_debugfs_fini(struct drm_minor *minor); #endif #define for_each_connector_in_state(__state, connector, connector_state, __i) \