From: Gustavo Sousa <gustavo.sousa@intel.com>
To: Ashutosh Dixit <ashutosh.dixit@intel.com>,
<igt-dev@lists.freedesktop.org>
Cc: <ngai-mint.kwan@intel.com>
Subject: Re: [PATCH i-g-t] lib/intel_wa: Return false for non-root users
Date: Wed, 27 May 2026 08:50:54 -0300 [thread overview]
Message-ID: <87fr3d6pgh.fsf@intel.com> (raw)
In-Reply-To: <20260527034342.1952153-1-ashutosh.dixit@intel.com>
Ashutosh Dixit <ashutosh.dixit@intel.com> writes:
> Under some circurmstancs debugfs reads are initiated by non-root users. In
> these cases, just return false rather than asserting that debugfs could not
> be read.
>
> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
> ---
> lib/intel_wa.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/lib/intel_wa.c b/lib/intel_wa.c
> index a16ea62a4c..2d0d664f3c 100644
> --- a/lib/intel_wa.c
> +++ b/lib/intel_wa.c
> @@ -47,6 +47,10 @@ bool igt_has_intel_wa(int drm_fd, const char *check_wa)
> unsigned int xe;
> char name[256];
>
> + /* If we are not root, we can't read debugfs, just return false */
> + if (getuid() != 0)
> + return false;
This doesn't sound right to me. The function will be lying by returning
false here and will probably make it harder to debug issues on code that
rely on having the correct result for a workaround check.
My personal take is that we probably should start avoiding having
asserts in lib/ code and defer any assertion to real test code.
--
Gustavo Sousa
> +
> debugfs_fd = igt_debugfs_dir(drm_fd);
> igt_assert(debugfs_fd >= 0);
>
> --
> 2.54.0
next prev parent reply other threads:[~2026-05-27 11:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-27 3:43 [PATCH i-g-t] lib/intel_wa: Return false for non-root users Ashutosh Dixit
2026-05-27 4:41 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-05-27 4:49 ` ✓ i915.CI.BAT: " Patchwork
2026-05-27 6:35 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-05-27 10:01 ` ✓ i915.CI.Full: success " Patchwork
2026-05-27 11:50 ` Gustavo Sousa [this message]
2026-05-27 17:10 ` [PATCH i-g-t] " Dixit, Ashutosh
2026-05-27 12:34 ` Jani Nikula
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=87fr3d6pgh.fsf@intel.com \
--to=gustavo.sousa@intel.com \
--cc=ashutosh.dixit@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=ngai-mint.kwan@intel.com \
/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