On Fri, 12 Jan 2018 15:46:47 +0100 Johan Hovold <johan@xxxxxxxxxx> wrote: > On Tue, Jan 09, 2018 at 06:43:47PM +0100, Andreas Kemnade wrote: > > On Fri, 22 Dec 2017 13:44:27 +0100 > > Johan Hovold <johan@xxxxxxxxxx> wrote: > > > > [...] > > > I'd suggest reiterating the problem you're trying to solve and > > > enumerating the previously discussed potential solutions in order to > > > find a proper abstraction level for this (before getting lost in > > > implementation details). > > > > > The main point here is in short words: Having a device powered on or off > > when the uart it is attached to, is used or not used anymore, > > so the already available userspace applications do not need to be changed. > > So we'd end up with something in-between a kernel driver and a > user-space solution. What about devices that need to be (partially) > powered also when the port isn't open? A pure user-space solution would > be able to handle all variants. > Well partly powered devices are at many places, And they hide that problem from userspace, just get the open()/get() and close()/put() from there and power the device accordingly. So the question still remains why should the kernel hide some things and some it should not. If it all is in userspace, then there is still something needed in the devicetree (if I understand correctly, every information about hardware which cannot be auto-probed belongs into device tree) so that the userspace knows what kind of device is at that port. So there can be a daemon powering on and off devices. But that would break existing applications which just expect that they just need to open/close the device. Or you need to have some inotify handler in userspace and attach it there to react on close() and open() of that device. But this thing needs to have two kind of information: 1. the type of chip available to do the right powerup sequence. 2. how the chip is wired up to the cpu. So to avoid having hardware information spread all over the table at least these information would need to be in devicetree. But that also all feels like a hack and hard to maintain. Regards, Andreas
Attachment:
pgpeXF4xlbrFl.pgp
Description: OpenPGP digital signature