On Tue, Sep 15, 2020 at 09:55:08AM +0200, Vincent Whitchurch wrote:
On Mon, Sep 14, 2020 at 03:05:16PM +0200, Sasha Levin wrote:
From: Vincent Whitchurch vincent.whitchurch@axis.com
[ Upstream commit 59ae97a7a9e1499c2070e29841d1c4be4ae2994a ]
If the zero duty cycle doesn't correspond to any voltage in the voltage table, the PWM regulator returns an -EINVAL from get_voltage_sel() which results in the core erroring out with a "failed to get the current voltage" and ending up not applying the machine constraints.
Instead, return -ENOTRECOVERABLE which makes the core set the voltage since it's at an unknown value.
For this patch to work it needs 84b3a7c9c6befe5ab4d49070fe7 ("regulator: core: Allow for regulators that can't be read at bootup") which was merged in v4.18. Without that this patch is not going to have any effect so it probably shouldn't be backported to older kernels.
Dropped for those older kernels, thanks!