Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [CI i-g-t 1/5] lib/igt_gt: Fix forcewake open
@ 2024-09-26  4:16 Lucas De Marchi
  2024-09-26  4:16 ` [CI i-g-t 2/5] lib/igt_gt: Make igt_open_forcewake_handle() xe-compatible Lucas De Marchi
                   ` (10 more replies)
  0 siblings, 11 replies; 13+ messages in thread
From: Lucas De Marchi @ 2024-09-26  4:16 UTC (permalink / raw)
  To: igt-dev

File from the kernel side is read-only and should be open as such:

	debugfs_create_file("i915_forcewake_user", S_IRUSR, minor->debugfs_root,
			    to_i915(minor->dev), &i915_forcewake_fops);

Apparently it doesn't matter for just opening it:

	openat(AT_FDCWD, "/sys/kernel/debug/dri/0", O_RDONLY) = 5
	openat(5, "i915_forcewake_user", O_WRONLY) = 6

But RDONLY is sufficient. Let's stick to the file permission.

Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 lib/igt_gt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/igt_gt.c b/lib/igt_gt.c
index aa5e75b07..b043e2d41 100644
--- a/lib/igt_gt.c
+++ b/lib/igt_gt.c
@@ -503,7 +503,7 @@ int igt_open_forcewake_handle(int fd)
 {
 	if (getenv("IGT_NO_FORCEWAKE"))
 		return -1;
-	return igt_debugfs_open(fd, "i915_forcewake_user", O_WRONLY);
+	return igt_debugfs_open(fd, "i915_forcewake_user", O_RDONLY);
 }
 
 #if defined(__x86_64__) || defined(__i386__)
-- 
2.46.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-10-01  6:30 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-26  4:16 [CI i-g-t 1/5] lib/igt_gt: Fix forcewake open Lucas De Marchi
2024-09-26  4:16 ` [CI i-g-t 2/5] lib/igt_gt: Make igt_open_forcewake_handle() xe-compatible Lucas De Marchi
2024-09-26  4:16 ` [CI i-g-t 3/5] lib/igt_gt: Add igt_open_forcewake_handle_for_pcidev() Lucas De Marchi
2024-09-26  4:16 ` [CI i-g-t 4/5] treewide: Fix intel_register_access_init() Lucas De Marchi
2024-09-26  4:16 ` [CI i-g-t 5/5] lib/igt_gt: Stop passing fd == -1 in igt_open_forcewake_handle() Lucas De Marchi
2024-09-26 10:24 ` ✗ Fi.CI.BAT: failure for series starting with [CI,i-g-t,1/5] lib/igt_gt: Fix forcewake open Patchwork
2024-09-26 10:36 ` ✓ CI.xeBAT: success " Patchwork
2024-09-27  2:59 ` ✗ CI.xeFULL: failure " Patchwork
2024-09-30 19:47 ` ✓ CI.xeBAT: success for series starting with [CI,i-g-t,1/5] lib/igt_gt: Fix forcewake open (rev2) Patchwork
2024-09-30 19:54 ` ✓ Fi.CI.BAT: " Patchwork
2024-10-01  2:36 ` ✗ CI.xeFULL: failure " Patchwork
2024-10-01  6:29   ` Lucas De Marchi
2024-10-01  6:20 ` ✗ Fi.CI.IGT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox