Re: [RFD] voltage/current regulator consumer interface

From: Mark Brown
Date: Tue Apr 21 2009 - 10:30:50 EST


On Tue, Apr 21, 2009 at 09:25:09AM -0400, James Kosin wrote:

> 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.

> 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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/