lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <78cc3067-b458-5cf2-d9f4-908aa5a4c5d5@gmail.com>
Date:   Wed, 22 Nov 2023 23:25:56 -0500
From:   Woody Suwalski <terraluna977@...il.com>
To:     LKML <linux-kernel@...r.kernel.org>, amd-gfx@...ts.freedesktop.org
Cc:     "Deucher, Alexander" <alexander.deucher@....com>,
        Christian König <christian.koenig@....com>
Subject: [PATCH] drm/radeon: Prevent multiple error lines on suspend

# Fix to avoid multiple error lines printed on every suspend by Radeon 
driver's debugfs.
#
# radeon_debugfs_init() calls debugfs_create_file() for every ring.
#
# This results in printing multiple error lines to the screen and dmesg 
similar to this:
# debugfs: File 'radeon_ring_vce2' in directory '0000:00:01.0' already 
present!
#
# The fix is to run lookup for the file before trying to (re)create that 
debug file.

# Signed-off-by: Woody Suwalski <terraluna977@...il.com>

diff --git a/drivers/gpu/drm/radeon/radeon_ring.c 
b/drivers/gpu/drm/radeon/radeon_ring.c
index e6534fa9f1fb..72b1d2d31295 100644
--- a/drivers/gpu/drm/radeon/radeon_ring.c
+++ b/drivers/gpu/drm/radeon/radeon_ring.c
@@ -549,10 +549,15 @@ static void radeon_debugfs_ring_init(struct 
radeon_device *rdev, struct radeon_r
  #if defined(CONFIG_DEBUG_FS)
      const char *ring_name = radeon_debugfs_ring_idx_to_name(ring->idx);
      struct dentry *root = rdev->ddev->primary->debugfs_root;
-
-    if (ring_name)
-        debugfs_create_file(ring_name, 0444, root, ring,
-                    &radeon_debugfs_ring_info_fops);
+    struct dentry *lookup;
+
+    if (ring_name) {
+        if ((lookup = debugfs_lookup(ring_name, root)) == NULL)
+            debugfs_create_file(ring_name, 0444, root, ring,
+                        &radeon_debugfs_ring_info_fops);
+        else
+            dput(lookup);
+    }

  #endif
  }


View attachment "dmesg_radeon.txt" of type "text/plain" (100095 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ