public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Philipp Zabel <p.zabel@pengutronix.de>
To: "Janusz Użycki" <j.uzycki@elproma.com.pl>
Cc: Mike Turquette <mturquette@linaro.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pwm@vger.kernel.org
Subject: Re: [PATCH v3] clk: Add PWM clock driver
Date: Fri, 12 Dec 2014 10:53:56 +0100	[thread overview]
Message-ID: <1418378036.3172.3.camel@pengutronix.de> (raw)
In-Reply-To: <548AAE51.7060507@elproma.com.pl>

Hi Janusz,

Am Freitag, den 12.12.2014, 09:58 +0100 schrieb Janusz Użycki:
> Hi Philipp,
> 
> It moved .enable to .prepare which can sleep and it works
> without any bug.
> The dirty fix:
>   const struct clk_ops clk_pwm_ops = {
> -       .enable = clk_pwm_enable,
> -       .disable = clk_pwm_disable,
> +       .prepare = clk_pwm_enable,
> +       .unprepare = clk_pwm_disable,
>          .recalc_rate = clk_pwm_recalc_rate,
>   };
> 
> What do you think about?

Thanks! Since the pwm API does not give any guarantees that
pwm_enable/disable may be called from atomic context, I think this
change is correct. The PWM documentation says:

   "Currently the PWM core does not enforce any locking to pwm_enable(),
    pwm_disable() and pwm_config(), so the calling context is currently
    driver specific. This is an issue derived from the former barebone
    API and should be fixed soon."

clk_enable should support reentrancy, but calling clk_prepare_enable
inside a clk_enable callback is not going to work.

regards
Philipp


      reply	other threads:[~2014-12-12  9:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-09 15:19 [PATCH v3] clk: Add PWM clock driver Philipp Zabel
2014-12-09 16:49 ` Janusz Użycki
2014-12-10 14:59   ` Philipp Zabel
2014-12-11 16:17     ` Janusz Użycki
2014-12-11 17:02       ` Janusz Użycki
2014-12-12  8:58         ` Janusz Użycki
2014-12-12  9:53           ` Philipp Zabel [this message]

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=1418378036.3172.3.camel@pengutronix.de \
    --to=p.zabel@pengutronix.de \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=j.uzycki@elproma.com.pl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mturquette@linaro.org \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox