Re: fault injection: query if a fault has been injected?

From: Akinobu Mita

Date: Sun Nov 30 2025 - 07:07:33 EST


2025年11月27日(木) 21:49 Jani Nikula <jani.nikula@xxxxxxxxx>:
>
>
> Hi Akinobu -
>
> The i915 driver has its own fault injection mechanism that we're in the
> process of migrating to the kernel generic fault injection.
>
> One feature we have is being able to check if a fault has been injected
> in the driver. We could then tone down certain error/warning messages to
> debug messages. The point being, CI could more trivially ignore the
> expected failures, while still failing on errors and warnings that are
> unrelated to the injected fault.
>
> Is there anything like that in the generic fault injection mechanism? Or
> do we have to figure all of this out in user space?

I took a quick look at the i915 driver's fault injection.

The fail-nth function may be useful for implementing inject_probe_failure.
The section "Systematic faults using fail-nth" in
Documentation/fault-injection/fault-injection.rst explains this.