On 2026-07-30T09:48:14, Pranav Sanwal <[email protected]> wrote: > test: dm: add sandbox coverage for gpio-delay > > gpio-delay had no sandbox coverage, which is how two bugs in it went > unnoticed: gpio_delay_xlate() never propagated the requested index > into the descriptor offset, so every consumer past the first silently > collided with the first consumer's already-claimed offset 0; and the > claimed/name tracking arrays were sized and bounds-checked against a > hardcoded 32 instead of the driver's actual GPIO count. Both are fixed > by a companion series that is a dependency of this patch: applied > without it, this test fails outright, since it directly exercises > both fixes. > > Add a test requesting both consumers wired up by gpio-delay-test in > test.dts (gpio_a 9 and 18): a third consumer colliding with an > already-claimed offset must fail with -EBUSY, each consumer's write > must land on its own wrapped GPIO line, and a request past the > wrapped GPIO count must fail with -EINVAL rather than succeed against > a hardcoded bound of 32. > > Gated on CONFIG_GPIO_DELAY, since not every sandbox variant that > builds test/dm/gpio.c enables it (sandbox_vpl, sandbox_spl, > sandbox_noinst, sandbox_flattree). > > Signed-off-by: Pranav Sanwal <[email protected]> > > test/dm/gpio.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 69 insertions(+)
Reviewed-by: Simon Glass <[email protected]>
