[PATCH 2/4] reset: Add sandbox tests for reset_reset() and reset_reset_bulk()
Michal Simek
michal.simek at amd.com
Mon May 4 14:40:40 CEST 2026
On 5/4/26 14:17, Simon Glass wrote:
> Hi Michal,
>
> On 2026-04-30T12:20:00, Michal Simek <michal.simek at amd.com> wrote:
>> reset: Add sandbox tests for reset_reset() and reset_reset_bulk()
>>
>> Add DM test coverage for the new reset_reset() and reset_reset_bulk()
>> API functions. The tests exercise the assert + deassert fallback path
>> since the sandbox reset driver does not implement the rst_reset op.
>>
>> Signed-off-by: Michal Simek <michal.simek at amd.com>
>>
>> arch/sandbox/include/asm/reset.h | 2 ++
>> drivers/reset/sandbox-reset-test.c | 14 ++++++++++
>> test/dm/reset.c | 53 ++++++++++++++++++++++++++++++++++++++
>> 3 files changed, 69 insertions(+)
>
>> diff --git a/test/dm/reset.c b/test/dm/reset.c
>> @@ -120,6 +120,59 @@ static int dm_test_reset_devm(struct unit_test_state *uts)
>> + ut_assertok(sandbox_reset_test_assert(dev_test));
>> + ut_asserteq(1, sandbox_reset_query(dev_reset, TEST_RESET_ID));
>> +
>> + ut_assertok(sandbox_reset_test_reset(dev_test));
>> + ut_asserteq(0, sandbox_reset_query(dev_reset, TEST_RESET_ID));
>
> This only checks the final state, i.e. a broken reset_reset() that
> skips the assert step would still pass, since the line was already
> asserted manually before the call. Please can you extend the sandbox
> driver to track the assert phase (a sticky 'was_asserted' flag or a
> transition counter) so the test confirms both halves of the pulse
> actually happen? Same for dm_test_reset_reset_bulk()
>
>> diff --git a/drivers/reset/sandbox-reset-test.c b/drivers/reset/sandbox-reset-test.c
>> @@ -96,6 +96,20 @@ int sandbox_reset_test_deassert_bulk(struct udevice *dev)
>> +int sandbox_reset_test_reset(struct udevice *dev)
>> +{
>> + struct sandbox_reset_test *sbrt = dev_get_priv(dev);
>> +
>> + return reset_reset(sbrt->ctlp);
>> +}
>
> Re your commit message, better to implement rst_reset for sandbox, so
> that we keep the coverage up.
Will look.
M
More information about the U-Boot
mailing list