All of lore.kernel.org
 help / color / mirror / Atom feed
From: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
To: Sjoerd Simons <sjoerd.simons@collabora.co.uk>,
	Thierry Reding <thierry.reding@gmail.com>,
	Jingoo Han <jg1.han@samsung.com>,
	Kukjin Kim <kgene.kim@samsung.com>
Cc: linux-pwm@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
	Lukasz Majewski <l.majewski@samsung.com>
Subject: Re: [PATCH v2 Resend] pwm: samsung: Fix output race on disabling
Date: Thu, 19 Mar 2015 10:19:13 +0100	[thread overview]
Message-ID: <550A9491.8050302@collabora.co.uk> (raw)
In-Reply-To: <1425543243-6587-1-git-send-email-sjoerd.simons@collabora.co.uk>

Hello Sjoerd,

On 03/05/2015 09:14 AM, Sjoerd Simons wrote:
> When disabling the samsung PWM the output state remains at the level it
> was in the end of a pwm cycle. In other words, calling pwm_disable when
> at 100% duty will keep the output active, while at all other setting the
> output will go/stay inactive. On top of that the samsung PWM settings are
> double-buffered, which means the new settings only get applied at the
> start of a new PWM cycle.
> 
> This results in a race if the PWM is at 100% duty and a driver calls:
>   pwm_config (pwm, 0, period);
>   pwm_disable (pwm);
> 
> In this case the PWMs output will unexpectedly stay active, unless a new
> PWM cycle happened to start between the register writes in _config and
> _disable. As far as i can tell this is a regression introduced by 3bdf878,
> before that a call to pwm_config would call pwm_samsung_enable which,
> while heavy-handed, made sure the expected settings were live.
> 
> To resolve this, while not re-introducing the issues 3bdf878 (flickering
> as the PWM got reset while in a PWM cycle). Only force an update of the
> settings when at 100% duty, which shouldn't have a noticeable effect on
> the output but is enough to ensure the behaviour is as expected on
> disable.
> 
> Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
>

The patch looks good to me.

Reviewed-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>

Best regards,
Javier


  parent reply	other threads:[~2015-03-19  9:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-05  8:14 [PATCH v2 Resend] pwm: samsung: Fix output race on disabling Sjoerd Simons
2015-03-18  7:50 ` Sjoerd Simons
2015-03-18  8:08   ` Lukasz Majewski
2015-03-18  8:27     ` Sjoerd Simons
2015-03-19  9:19 ` Javier Martinez Canillas [this message]
2015-03-27  7:41 ` Lukasz Majewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=550A9491.8050302@collabora.co.uk \
    --to=javier.martinez@collabora.co.uk \
    --cc=jg1.han@samsung.com \
    --cc=kgene.kim@samsung.com \
    --cc=l.majewski@samsung.com \
    --cc=linux-pwm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=sjoerd.simons@collabora.co.uk \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.