Re: Permissions for GPIOs [Was: [PATCH] gpio: document how to order GPIO controllers]
From: Linus Walleij <hidden>
Date: 2016-07-08 11:25:40
Also in:
linux-arm-kernel, linux-gpio
On Wed, Jul 6, 2016 at 4:12 PM, Jan Lübbe [off-list ref] wrote:
This discussion caused me remember a concern regarding the chardev interface: Is it still be possible to give specific users/groups access to individual GPIOs? This is currently possible in the sysfs interface with chown/chmod. I don't see how per-GPIO permissions would translate to a per-gpiochip device.
It is not possible because it is a different model. The /dev/gpiochipN is similar to /dev/sda for example, either you access the whole device file not parts of it. I think the old sysfs wrongly gives people the impression that this is needed just because it happens to have one value per file, I can't think of a usecase for it. It's a bit like if we had a sysfs or similar that could give you write permissions to just certain blocks of a disk or something using chmod. I don't see anyone needing that other than in theory.
Am I overlooking some better way to give non-root users granular access to GPIOs? Or is that intentionally out of scope for the chardev interface?
Intentionally out of scope I don't know, nobody raised it during review, and I have never seen a real-world usecase. Are there any distributions out there that ship with something like udev files that actually go to the trouble of setting up different permissions on GPIO sysfs files, or are we talking about hacks in a lab or even just theoretical issues? Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html