Re: [PATCH v4 0/4] gpio: shared-proxy: Fix line accounting

From: Bartosz Golaszewski

Date: Tue Oct 20 2026 - 09:22:20 EST


On Sat, 17 Oct 2026 06:36:01 +0200, Shawn Guo
<shengchao.guo@xxxxxxxxxxxxxxxx> said:
> Four fixes for how the shared GPIO proxy accounts for users and
> votes.
>
> Patch 1 fixes a race between consumers that request a shared line
> concurrently. Each of them sees usecnt > 1, assumes another user has
> already configured the line, and fails with -EPERM. On Nord RRD this
> intermittently leaves both DAC supply regulators without their enable
> GPIO.
>
> Patch 2 fixes a stale vote left behind when a proxy releases the line
> and restoring the default value fails. The line stays at the
> non-default value for the remaining users, and votecnt can underflow
> when the line is requested again.
>
> Patch 3 fixes gpiod_set_value() to the default value doing nothing on
> a line that was requested with GPIOD_ASIS and left at the opposite
> value, e.g. by the bootloader.
>
> Patch 4 drops a proxy's vote when it switches the line to input, so
> releasing the line no longer fails trying to write the default value
> to an input
>

Thanks! Looks good but I have a comment on one patch and a question on
another.

Bart