[PATCH] pwm: sun4i: Round delay time up to a nearest jiffy

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Fri Apr 30 10:51:01 BST 2021


Hello Roman,

On Fri, Apr 30, 2021 at 09:17:49AM +0200, Roman Beranek wrote:
> On Fri Apr 30, 2021 at 8:41 AM CEST, Uwe Kleine-König wrote:
> > Consider the PWM is running with a period of 4s and the period just
> > started. Then you call
> >
> > pwm_apply_state(mypwm, &(struct pwm_state){
> > .period = 20,
> > .enabled = 1,
> > ...
> > })
> >
> > This doesn't result into the waiting code being run, because
> > .enabled = 1. Then immidiately after that call:
> >
> > pwm_apply_state(mypwm, &(struct pwm_state){
> > .period = 20,
> > .enabled = 0,
> > ...
> > })
> >
> > which triggers the waiting but only based on a period of 20 ns while the
> > 4s period is still active.
> 
> OK, now I see what you mean. To remedy this, the delay shall occur
> regardless of state->enabled.
> 
> In my view, this lies beneath the scope of the patch though and would be
> better served as a follow-up.

If you agree that dropping both delay and clk_disable completely is the
right thing, you address both problems and going forward with your patch
isn't sensible.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20210430/34e4bb9a/attachment-0001.sig>


More information about the linux-arm-kernel mailing list