Hi Bartosz, I see the big picture of this plan!
One quick comment: On Wed, Sep 24, 2025 at 4:51 PM Bartosz Golaszewski <[email protected]> wrote: > I'm Cc'ing some people that may help with reviewing/be interested in > this: OF maintainers (because the main target are OF systems initially), > Mark Brown because most users of GPIOD_FLAGS_BIT_NONEXCLUSIVE live > in audio or regulator drivers and one of the goals of this series is > dropping the hand-crafted GPIO enable counting via struct > regulator_enable_gpio in regulator core), ...and that is what I thought as well, so: > arm64: select HAVE_SHARED_GPIOS for ARCH_QCOM why would we be selecting this per-subarch? What will happen is that CONFIG_REGULATOR will select it and since everyone and their dog is using regulator, what will happen is that every system will have this enabled, and every GPIO access on every system will be proxied and then this better be fast. Two things come to mind, and I bet you have thought of them already: 1. Footprint: all systems using regulators will now have to compile in all this code as well. 2. Performance, I didn't quite get it if every GPIO on the system will be proxied through a layer of indirection if you select HAVE_SHARED_GPIOS but that would not be good, since some users are in fastpath such as IRQ handlers, and the old way of sharing GPIOs would just affect pins that are actually shared. I don't know of a good generic solution for (2) to be honest, last resort would be something like runtime patching of calls when a GPIO becomes shared and that is really advanced but maybe necessary to get a performant and generic solution. Yours, Linus Walleij
