Re: [PATCH 4/4] dmaengine: dmatest: Optionally make test errors fatal

From: Tycho Andersen

Date: Wed Jul 22 2026 - 16:02:07 EST


On Wed, Jul 22, 2026 at 10:47:49AM -0500, Nathan Lynch via B4 Relay wrote:
> From: Nathan Lynch <nathan.lynch@xxxxxxx>
>
> For automated testing it is useful to have dmatest halt the machine when
> errors occur rather than logging them and continuing, so that the system
> state at the point of failure can be captured instead of allowing the run
> to carry on.
>
> Add a 'fatal_errors' module parameter, defaulting to 0. When set to a
> non-zero value N, panic the kernel once N test errors have accumulated in
> a run; the count is reset at the start of each run. The panic is triggered
> after the existing result() line is logged, so the specific error (data
> mismatch, mapping/prep/submit error, timeout, or bad completion status) is
> recorded before the crash.
>
> Assisted-by: Claude:claude-opus-4-8 [Claude-Code]
> Signed-off-by: Nathan Lynch <nathan.lynch@xxxxxxx>

Reviewed-by: Tycho Andersen (AMD) <tycho@xxxxxxxxxx>

but,

> @@ -583,7 +611,7 @@ static int dmatest_func(void *data)
> struct dma_device *dev;
> struct device *dma_dev;
> unsigned int error_count;
> - unsigned int failed_tests = 0;
> + unsigned int failed_tests = 0; /* for this thread */
> unsigned int total_tests = 0;
> dma_cookie_t cookie;
> enum dma_status status;

I would probably drop this hunk if you re-spin. It's on the thread's
stack, so it seems like an "obvious" comment.

Tycho