Re: [PATCH v2] reset: Add KUnit test cases
From: Tzung-Bi Shih
Date: Wed Nov 04 2026 - 11:17:45 EST
On Tue, Nov 03, 2026 at 11:21:53AM +0100, Philipp Zabel wrote:
> On Mo, 2026-11-02 at 23:52 +0800, Tzung-Bi Shih wrote:
> > + /* supplier0 unregisters. */
> > + complete(&ctx[0].enter);
> > + ret = read_poll_timeout(reset_control_status, val, val == -ENODEV,
> > + 1000, 100000, false, rtc->rstc);
> > + if (ret) {
> > + for (i = 2; i >= 0; --i)
> > + kthread_stop_put(ctx[i].thread);
> > + KUNIT_ASSERT_EQ(test, ret, 0);
> > + }
> > + /* supplier0 can't exit. It's waiting for all consumers. */
>
> This comment looks like an untested assertion. For all we know,
> reset_controller_unregister() may have already returned by now.
>
> How about signalling a completion "ctx->exited" after
> reset_controller_unregister() returns, calling
> wait_for_completion_timeout() here, and asserting it times out?
Fixed in v3[1].
[1] https://lore.kernel.org/all/20261104160123.6784-1-tzungbi@xxxxxxxxxx