From: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: <igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH i-g-t v2 2/3] lib/igt_kmod: Make sure errno is not already set before unbinding
Date: Thu, 19 Dec 2024 15:33:24 -0800 [thread overview]
Message-ID: <a80eb8c5-1679-4cdc-90db-1c1de2f3747e@intel.com> (raw)
In-Reply-To: <44eqlwtjr5vvyjaystcoqk7zpz7bi72oezfo3glsdwiu7wlff3@5zc63q2oamu4>
On 12/19/2024 3:29 PM, Lucas De Marchi wrote:
> On Thu, Dec 19, 2024 at 03:05:16PM -0800, Daniele Ceraolo Spurio wrote:
>> We assert that errno is zero after unbinding, so we need to make sure it
>> wasn't already non-zero beforehand or we might incorrectly fail.
>>
>> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
>> Cc: Lucas De Marchi <lucas.demarchi@intel.com>
>> ---
>> The non-zero starting errno hitting the assert is reproed when using
>> unbind in the 1915 reload-with-fault-injection test:
>> https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_12349/shard-snb5/igt@i915_module_load@reload-with-fault-injection.html
>>
>
> yeah, but I think I made a mistake checking for errno. Checking it
> outside of a call to libc is odd.
>
>
> I'd rather remove both the assert and the setting to 0:
>
> if we have an empty dir we won't ever reach the `errno = 0`, making it
> the same as the `if (!dir)` in which we are already returning 0.
sounds good, I'll wait for CI to make sure no other issues pop out now
that the test is running properly and then respin with this change.
>
>
> This would be a
>
> Fixes: cb008246b0c7 ("lib/igt_kmod: Rewrite xe unload logic")
thanks, I'll add this in.
Daniele
>
> thanks
> Lucas De Marchi
>
>>
>> lib/igt_kmod.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
>> index d73cb4101..a008b3c29 100644
>> --- a/lib/igt_kmod.c
>> +++ b/lib/igt_kmod.c
>> @@ -662,6 +662,8 @@ int igt_kmod_unbind(const char *mod_name)
>> int dirlen;
>> DIR *dir;
>>
>> + errno = 0;
>> +
>> dirlen = snprintf(path, sizeof(path),
>> "/sys/module/%s/drivers/pci:%s/",
>> mod_name, mod_name);
>> igt_assert(dirlen < sizeof(path));
>> --
>> 2.43.0
>>
next prev parent reply other threads:[~2024-12-19 23:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-19 23:05 [PATCH i-g-t v2 1/3] lib/igt_kmod: fix check to confirm correct driver unload Daniele Ceraolo Spurio
2024-12-19 23:05 ` [PATCH i-g-t v2 2/3] lib/igt_kmod: Make sure errno is not already set before unbinding Daniele Ceraolo Spurio
2024-12-19 23:29 ` Lucas De Marchi
2024-12-19 23:33 ` Daniele Ceraolo Spurio [this message]
2024-12-19 23:05 ` [PATCH i-g-t v2 3/3] lib/igt_kmod: Do not explicitly unload intel mei driver Daniele Ceraolo Spurio
2024-12-19 23:21 ` [PATCH i-g-t v2 1/3] lib/igt_kmod: fix check to confirm correct driver unload Lucas De Marchi
2024-12-20 0:49 ` ✓ i915.CI.BAT: success for series starting with [i-g-t,v2,1/3] " Patchwork
2024-12-20 1:45 ` ✓ Xe.CI.BAT: " Patchwork
2024-12-20 18:02 ` [i-g-t, v2, 1/3] " Kamil Konieczny
2024-12-20 19:13 ` Daniele Ceraolo Spurio
2024-12-20 21:46 ` ✗ i915.CI.Full: failure for series starting with [i-g-t,v2,1/3] " Patchwork
2024-12-21 1:36 ` ✗ Xe.CI.Full: " Patchwork
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=a80eb8c5-1679-4cdc-90db-1c1de2f3747e@intel.com \
--to=daniele.ceraolospurio@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=lucas.demarchi@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