lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <54905287-855d-47b4-880f-bfb1b8b1f49d@sirena.org.uk>
Date: Fri, 22 Dec 2023 11:53:44 +0000
From: Mark Brown <broonie@...nel.org>
To: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
Cc: Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
	lgirdwood@...il.com, linux-pwm@...r.kernel.org,
	linux-amlogic@...ts.infradead.org, linux-kernel@...r.kernel.org,
	Thierry Reding <thierry.reding@...il.com>,
	Heiner Kallweit <hkallweit1@...il.com>,
	Dmitry Rokosov <ddrokosov@...rdevices.ru>
Subject: Re: [RFC PATCH v1] regulator: pwm-regulator: Fix continuous
 get_voltage for disabled PWM

On Thu, Dec 21, 2023 at 11:07:41PM +0100, Uwe Kleine-König wrote:
> On Thu, Dec 21, 2023 at 09:45:49PM +0000, Mark Brown wrote:

> > > -       voltage = pwm_get_relative_duty_cycle(&pstate, duty_unit);
> > > +       if (pstate.enabled)
> > > +               voltage = pwm_get_relative_duty_cycle(&pstate, duty_unit);
> > > +       else if (max_uV_duty < min_uV_duty)
> > > +               voltage = max_uV_duty;
> > > +       else
> > > +               voltage = min_uV_duty;

> > AFAICT this means that enabling the PWM changes the voltage read back
> > which isn't what we expect (other than a change from 0 to target) and is
> > likely to cause issues.  get_voltage() should not change after an
> > enable(), and indeed I'm unclear how this change works?  I'd expect a
> > change in the init_state() function, possibly one that programs the PWM
> > to reflect the actual hardware state but I'm not 100% confident on that
> > without digging into the PWM API more.

> What is your question here? Looking at pwm_regulator_set_voltage() I
> think this lacks a

> 	pstate.enabled = true;

> which might also fix Martin's problem?

That's not really a question, it's a statement - I don't see how the
change works at all and as it stands it introduces a problem with the
behaviour when the regulator is enabled.

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ