Re: [PATCH] gpio: kunit: test mixed-polarity multi-line hogs

From: Bartosz Golaszewski

Date: Wed Nov 04 2026 - 09:41:12 EST


On Wed, Nov 04, 2026 at 09:00:55PM +0900, Jinseob Kim wrote:
> A single software-node GPIO hog can describe several lines with different
> polarities. Add a case with alternating active-low and active-high lines
> to verify that lookup flags do not carry over between GPIO specifiers.
> Check both descriptor polarity and the raw output level for a logical
> output-high value.
>
> Register the additional provider and hog nodes in the existing hog node
> group and add the case to gpio_swnode_hog_tests. Reuse the existing suite
> lifecycle and test-managed GPIO device reference cleanup.
>
> Codex assisted with the regression test and commit message.

Don't put that in commit message, that can go under the '---' or in the
cover letter.

>
> Signed-off-by: Jinseob Kim <kimjinseob88@xxxxxxxxx>
> ---
> Test split from the combined v1 patch, for v7.5:
> - Add the case to the existing gpio-swnode-hog suite and node group.
> - Drop the duplicate suite lifecycle and keep managed reference cleanup.
> - Adapt to gpio/for-next's provider label and existing test helpers.
>

Maybe I didn't make myself clear enough: this should have been part of
the same series as the fix, just a separate commit in that series. No
worries, don't resend unless there's another reason, I'll keep track of
it.

> Target: brgl/linux gpio/for-next at d66b6b86d5a6278ca930112c634d03725beb7d9a.
> Dependency: apply the fix-only v2, "gpiolib: reset lookup flags for each
> hogged line", before this test. Without that prerequisite the new test
> is expected to fail. The test itself changes no GPIO implementation.
> The maintainer requested this test for v7.5, separately from the fix.
>
> Testing on this target: actual UML/KUnit, before 10 pass / 1 fail;
> after 11 pass / 0 fail, with the same config and test source.
> GCC W=1 and Clang W=1/private Sparse C=2 builds completed.
> The mixed-polarity case also passes alone and within the hog suite.
> No physical GPIO or runtime OF hardware validation was performed.
>
> Previous version: https://lore.kernel.org/linux-gpio/20261103224339.1180-1-kimjinseob88@xxxxxxxxx/
> Review: https://lore.kernel.org/linux-gpio/qboynvhfmvltsuopwotpf3sqdwho3qobxmw5qldooedjqodfgy@x4l6hscj5unx/

Ideally this should have been v2 of the series with its proper
Changelog.

Thanks,
Bartosz