mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Woody Suwalski <terraluna977@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>, amd-gfx@lists.freedesktop.org
Cc: "Deucher, Alexander" <alexander.deucher@amd.com>,
	"<christian.koenig@amd.com>" <christian.koenig@amd.com>,
	Woody Suwalski <terraluna977@gmail.com>
Subject: [PATCH v2] drm/radeon: Prevent multiple debug error lines on suspend
Date: Tue, 12 Dec 2023 18:31:34 -0500	[thread overview]
Message-ID: <90172f4c-7cf7-b4ac-d630-42198bb80d62@gmail.com> (raw)

Fix to avoid multiple debug 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:

[   92.378726] debugfs: File 'radeon_ring_gfx' in directory 
'0000:00:01.0' already present!
[   92.378732] debugfs: File 'radeon_ring_cp1' in directory 
'0000:00:01.0' already present!
[   92.378734] debugfs: File 'radeon_ring_cp2' in directory 
'0000:00:01.0' already present!
[   92.378737] debugfs: File 'radeon_ring_dma1' in directory 
'0000:00:01.0' already present!
[   92.378739] debugfs: File 'radeon_ring_dma2' in directory 
'0000:00:01.0' already present!
[   92.380775] debugfs: File 'radeon_ring_uvd' in directory 
'0000:00:01.0' already present!
[   92.406620] debugfs: File 'radeon_ring_vce1' in directory 
'0000:00:01.0' already present!
[   92.406624] debugfs: File 'radeon_ring_vce2' in directory 
'0000:00:01.0' already present!


Patch v1: The fix was to run lookup() for the file before trying to 
(re)create that debug file.
Patch v2: Call the radeon_debugfs_init() only once when radeon ring is 
initialized (as suggested  by Christian K. - thanks)

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

diff --git a/drivers/gpu/drm/radeon/radeon_ring.c 
b/drivers/gpu/drm/radeon/radeon_ring.c
index e6534fa9f1fb..38048593bb4a 100644
--- a/drivers/gpu/drm/radeon/radeon_ring.c
+++ b/drivers/gpu/drm/radeon/radeon_ring.c
@@ -413,6 +413,7 @@ int radeon_ring_init(struct radeon_device *rdev, 
struct radeon_ring *ring, unsig
              dev_err(rdev->dev, "(%d) ring map failed\n", r);
              return r;
          }
+        radeon_debugfs_ring_init(rdev, ring);
      }
      ring->ptr_mask = (ring->ring_size / 4) - 1;
      ring->ring_free_dw = ring->ring_size / 4;
@@ -421,7 +422,6 @@ int radeon_ring_init(struct radeon_device *rdev, 
struct radeon_ring *ring, unsig
          ring->next_rptr_gpu_addr = rdev->wb.gpu_addr + index;
          ring->next_rptr_cpu_addr = &rdev->wb.wb[index/4];
      }
-    radeon_debugfs_ring_init(rdev, ring);
      radeon_ring_lockup_update(rdev, ring);
      return 0;
  }


             reply	other threads:[~2023-12-12 23:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-12 23:31 Woody Suwalski [this message]
2023-12-13  6:38 ` Christian König
2023-12-13 18:28   ` Alex Deucher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=90172f4c-7cf7-b4ac-d630-42198bb80d62@gmail.com \
    --to=terraluna977@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®