voltage/current regulator consumer interface
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 9 lines · Mike Rapoport
Hi,
Recently there was a brief discussion on linux-arm-kernel list [1] about controlling voltage regulator state in cases when there is no consumer device for a particular regulator.
I have some thoughts but I'd like to know people opinion before I start implementation.
Quoted 11 lines
Problem
-------
The regulator framework API provides ability to control the state of voltage/current regulators from within the kernel. Usually the regulator supplies power to a device and device driver or some hooks to the platform code from the device driver manipulate the regulator state. However, the regulator framework does not have userspace ABI that allows regulator state modifications. Lack of this ABI prevents fine-grained control for power consumption of devices such as GPS trancievers and GSM modems. Moreover, in SoC based systems it is possible to switch on/off power to entire subsystem when it is not used.
I'd also ask the question, Why?
If exposing to user space it leaves the possibility of damaging hardware or completely frying a board.
James
Quoted 23 lines · James Kosin
Quoted 9 lines · Mike Rapoport
Hi,
Recently there was a brief discussion on linux-arm-kernel list [1] about controlling voltage regulator state in cases when there is no consumer device for a particular regulator.
I have some thoughts but I'd like to know people opinion before I start implementation.
Quoted 11 lines
Problem
-------
The regulator framework API provides ability to control the state of voltage/current regulators from within the kernel. Usually the regulator supplies power to a device and device driver or some hooks to the platform code from the device driver manipulate the regulator state. However, the regulator framework does not have userspace ABI that allows regulator state modifications. Lack of this ABI prevents fine-grained control for power consumption of devices such as GPS trancievers and GSM modems. Moreover, in SoC based systems it is possible to switch on/off power to entire subsystem when it is not used.
Quoted 3 lines
I'd also ask the question, Why?
If exposing to user space it leaves the possibility of damaging hardware or completely frying a board.
Suppose you have a handheld device with GPS transceiver. You would like to give user the ability to switch the transceiver on and off.
Quoted 8 lines
James
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Signature · 2 lines
Sincerely yours, Mike.
Quoted 24 lines · Mike Rapoport
Quoted 22 lines · James Kosin
Quoted 20 lines · Mike Rapoport
Hi,
Recently there was a brief discussion on linux-arm-kernel list [1] about controlling voltage regulator state in cases when there is no consumer device for a particular regulator.
I have some thoughts but I'd like to know people opinion before I start implementation.
Problem
-------
The regulator framework API provides ability to control the state of voltage/current regulators from within the kernel. Usually the regulator supplies power to a device and device driver or some hooks to the platform code from the device driver manipulate the regulator state. However, the regulator framework does not have userspace ABI that allows regulator state modifications. Lack of this ABI prevents fine-grained control for power consumption of devices such as GPS trancievers and GSM modems. Moreover, in SoC based systems it is possible to switch on/off power to entire subsystem when it is not used.
Quoted 7 lines
Quoted 3 lines
I'd also ask the question, Why?
If exposing to user space it leaves the possibility of damaging hardware or completely frying a board.Suppose you have a handheld device with GPS transceiver. You would like to give user the ability to switch the transceiver on and off.
Then the GPS drivers should be made aware and let the drivers handle the on/off interface. If a user is allowed to turn interfaces on/off at will with this then drivers could suffer from (shock)... ie: you could turn off your hard-drive in a middle of a write by the driver corrupting data, if handled in the driver it could finish the write before turning off the drive. I know this is a far stretch from a GPS were the device is only READ only.
I do agree it could be useful, but we need to be careful on how much control the user has over the drivers and system. To an extreme, a user could be able to turn off CPU cores outside of the drivers control causing serious pipeline hazards that would need to be handled at the driver level. This would not be an issue for GPS were the data is read only and the missing data is really not that important to the system operation and continued use.
James
Quoted 30 lines · James Kosin
Quoted 22 lines · Mike Rapoport
Quoted 21 lines · James Kosin
Quoted 20 lines · Mike Rapoport
Hi,
Recently there was a brief discussion on linux-arm-kernel list [1] about controlling voltage regulator state in cases when there is no consumer device for a particular regulator.
I have some thoughts but I'd like to know people opinion before I start implementation.
Problem
-------
The regulator framework API provides ability to control the state of voltage/current regulators from within the kernel. Usually the regulator supplies power to a device and device driver or some hooks to the platform code from the device driver manipulate the regulator state. However, the regulator framework does not have userspace ABI that allows regulator state modifications. Lack of this ABI prevents fine-grained control for power consumption of devices such as GPS trancievers and GSM modems. Moreover, in SoC based systems it is possible to switch on/off power to entire subsystem when it is not used.Quoted 6 lines
Quoted 3 lines
I'd also ask the question, Why?
If exposing to user space it leaves the possibility of damaging hardware or completely frying a board.Suppose you have a handheld device with GPS transceiver. You would like to give user the ability to switch the transceiver on and off.
Quoted 7 lines
Then the GPS drivers should be made aware and let the drivers handle the on/off interface. If a user is allowed to turn interfaces on/off at will with this then drivers could suffer from (shock)... ie: you could turn off your hard-drive in a middle of a write by the driver corrupting data, if handled in the driver it could finish the write before turning off the drive. I know this is a far stretch from a GPS were the device is only READ only.
The point is there's no GPS driver... GPS transceivers are usually connected to a serial line and the applications access the GPS data through ttySX. The case when there is a kernel driver for device connected to a regulator is completely different. It is then the driver responsibility to decide when to power on/off the device.
Quoted 10 lines
I do agree it could be useful, but we need to be careful on how much control the user has over the drivers and system. To an extreme, a user could be able to turn off CPU cores outside of the drivers control causing serious pipeline hazards that would need to be handled at the driver level. This would not be an issue for GPS were the data is read only and the missing data is really not that important to the system operation and continued use.
James
Signature · 2 lines
Sincerely yours, Mike.
Quoted 38 lines · Mike Rapoport
Quoted 29 lines · James Kosin
Quoted 22 lines · Mike Rapoport
Quoted 21 lines · James Kosin
Quoted 20 lines · Mike Rapoport
Hi,
Recently there was a brief discussion on linux-arm-kernel list [1] about controlling voltage regulator state in cases when there is no consumer device for a particular regulator.
I have some thoughts but I'd like to know people opinion before I start implementation.
Problem
-------
The regulator framework API provides ability to control the state of voltage/current regulators from within the kernel. Usually the regulator supplies power to a device and device driver or some hooks to the platform code from the device driver manipulate the regulator state. However, the regulator framework does not have userspace ABI that allows regulator state modifications. Lack of this ABI prevents fine-grained control for power consumption of devices such as GPS trancievers and GSM modems. Moreover, in SoC based systems it is possible to switch on/off power to entire subsystem when it is not used.Quoted 6 lines
Quoted 3 lines
I'd also ask the question, Why?
If exposing to user space it leaves the possibility of damaging hardware or completely frying a board.Suppose you have a handheld device with GPS transceiver. You would like to give user the ability to switch the transceiver on and off.
Quoted 7 lines
Then the GPS drivers should be made aware and let the drivers handle the on/off interface. If a user is allowed to turn interfaces on/off at will with this then drivers could suffer from (shock)... ie: you could turn off your hard-drive in a middle of a write by the driver corrupting data, if handled in the driver it could finish the write before turning off the drive. I know this is a far stretch from a GPS were the device is only READ only.
Quoted 17 lines
The point is there's no GPS driver... GPS transceivers are usually connected to a serial line and the applications access the GPS data through ttySX. The case when there is a kernel driver for device connected to a regulator is completely different. It is then the driver responsibility to decide when to power on/off the device.
Quoted 10 lines
I do agree it could be useful, but we need to be careful on how much control the user has over the drivers and system. To an extreme, a user could be able to turn off CPU cores outside of the drivers control causing serious pipeline hazards that would need to be handled at the driver level. This would not be an issue for GPS were the data is read only and the missing data is really not that important to the system operation and continued use.
James
Ok. You have a valid point.
What about a GPS driver that can use the RS232 interface as the transport. Much like the IDE over Parallel Port in older kernels did. This way the driver would still be responsible and not have to completely expose the regulator control.
James
Hi!
Quoted 8 lines
Quoted 7 lines
Then the GPS drivers should be made aware and let the drivers handle the on/off interface. If a user is allowed to turn interfaces on/off at will with this then drivers could suffer from (shock)... ie: you could turn off your hard-drive in a middle of a write by the driver corrupting data, if handled in the driver it could finish the write before turning off the drive. I know this is a far stretch from a GPS were the device is only READ only.
Quoted 5 lines
The point is there's no GPS driver... GPS transceivers are usually connected to a serial line and the applications access the GPS data through ttySX. The case when there is a kernel driver for device connected to a regulator is completely different. It is then the driver responsibility to decide when to power on/off the device.
Well, then you should teach serial driver to power the (GPS) device up on open() and power it off on close()...
Giving it better name then ttyS2 would help, too. ttyGPS?
IOW write a trivial driver even through you could get away w/o that...
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 2 lines · Pavel Machek
Well, then you should teach serial driver to power the (GPS) device up on
open()and power it off onclose()...
This all started because this approach was nacked for serial drivers. In any case, I'm not sure that'll scale - it may not be desirable or reasonable to do something like that for all devices. For example, the devices may be connected via a technology that's not suitable (I've worked on systems which used ethernet here).
Quoted 11 lines · Mark Brown
Quoted 2 lines · Pavel Machek
Well, then you should teach serial driver to power the (GPS) device up on
open()and power it off onclose()...This all started because this approach was nacked for serial drivers. In any case, I'm not sure that'll scale - it may not be desirable or reasonable to do something like that for all devices. For example, the devices may be connected via a technology that's not suitable (I've worked on systems which used ethernet here).
Ethernet can be treated as a serial interface as well down to the simplest level. I'm leaving out a lot is making this assumption; but, it is true to a fault.
Scalability has more to do with the generic interface you use... If you tie things to ttySxx and don't allow configuration parameters you are also restricting the usage and scalability as well.
The GPS should be configurable so the interface is generic and allows getting from Ethernet/PCI/IDE/serial/parallel/etc. The transport layer should not matter to the GPS driver. The trick will be to allow the user to ultimately choose, if that is what you want.
The same applies to disk devices, now we have IDE/SATA/etc. the disk device itself doesn't depend on the interface physically, the kernel treats all these as suitable interfaces for disk/CDROM/tape devices and the world is not turned on its ear just because there is a different physical interface.
James
Quoted 11 lines · James Kosin
Quoted 5 lines · Mark Brown
This all started because this approach was nacked for serial drivers. In any case, I'm not sure that'll scale - it may not be desirable or reasonable to do something like that for all devices. For example, the devices may be connected via a technology that's not suitable (I've worked on systems which used ethernet here).
Ethernet can be treated as a serial interface as well down to the simplest level. I'm leaving out a lot is making this assumption; but, it is true to a fault.
The big difference with ethernet is that it's multi-drop - you can't turn on the power based on the ethernet interface being in use since there can be more than one device connected.
Quoted 5 lines
The same applies to disk devices, now we have IDE/SATA/etc. the disk device itself doesn't depend on the interface physically, the kernel treats all these as suitable interfaces for disk/CDROM/tape devices and the world is not turned on its ear just because there is a different physical interface.
You're suggesting modifying the link layer to do different things based on which device is connnected to it; in any case the issue here is that this class of hardware has no in-kernel driver to provide an abstaction
- it's all done by a user space daemon or similar.
Quoted 7 lines · James Kosin
Then the GPS drivers should be made aware and let the drivers handle the on/off interface. If a user is allowed to turn interfaces on/off at will with this then drivers could suffer from (shock)... ie: you could turn off your hard-drive in a middle of a write by the driver corrupting data, if handled in the driver it could finish the write before turning off the drive. I know this is a far stretch from a GPS were the device is only READ only.
The proposed driver is a platform device. This means that in order for user space to have anything to access the kernel will have to explicitly register a platform device and provide it with configuration. Further, since the driver is a standard regulator consumer the kernel will also have to have provided explicit constraints which grant permission to the driver to modify the state of the regulator.
Quoted 5 lines
I do agree it could be useful, but we need to be careful on how much control the user has over the drivers and system. To an extreme, a user could be able to turn off CPU cores outside of the drivers control causing serious pipeline hazards that would need to be handled at the driver level. This would not be an issue for GPS were the data is read
This is why the regulator core requires that explicit configuration be done by the machine in order to allow any changes to the regulator state.
Quoted 6 lines · James Kosin
Quoted 2 lines
such as GPS trancievers and GSM modems. Moreover, in SoC based systems it is possible to switch on/off power to entire subsystem when it is not used.
I'd also ask the question, Why?
If exposing to user space it leaves the possibility of damaging hardware or completely frying a board.
There are some classes of device found in embedded systems which do things like provide an essentially separate system which interacts with the host system via something like a serial port. These devices are normally controlled entirely from user space which is fine with static power configuration but if you want to provide regulator control for these devices you need to either move the control of the device into the kernel or expose the regulators the device uses to userspace.
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 7 lines · Mark Brown
Quoted 1 line · Mike Rapoport
What about "line-supply"?
In power management line normally refers to the core, unregulated power bus for the system and a line supply would normally be something like a wall wart that supplies this directly when it's connected.
Can I suggest:
"supply-switch" or "regulator-switch" may make more sense for the moment.
James
Quoted 6 lines
Quoted 3 lines
In power management line normally refers to the core, unregulated power bus for the system and a line supply would normally be something like a wall wart that supplies this directly when it's connected.
Can I suggest:
"supply-switch" or "regulator-switch" may make more sense for the moment.
Can I suggest they don't. The naming should reflect the naming actually used in the field by people working on the technology otherwise arbitary renaming just creates confusion
The supply switch is the big switch on the back
Alan
Quoted 6 lines · Alan Cox
Quoted 5 lines
Quoted 3 lines
In power management line normally refers to the core, unregulated power bus for the system and a line supply would normally be something like a wall wart that supplies this directly when it's connected.
Can I suggest:
"supply-switch" or "regulator-switch" may make more sense for the moment.
Quoted 8 lines
Can I suggest they don't. The naming should reflect the naming actually used in the field by people working on the technology otherwise arbitary renaming just creates confusion
The supply switch is the big switch on the back
Alan
Ok, "supply-switch" may have been a bad idea, I wasn't thinking yet. The coffee hasn't kicked in yet and I'm feeling a bit down.
James