devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Philipp Zabel <p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
To: "Janusz Użycki" <j.uzycki-9tnw74Q4ehaHKKo6LODCOg@public.gmane.org>
Cc: Mike Turquette
	<mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Thierry Reding
	<thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Ian Campbell
	<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
	Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-pwm-u79uwXL29TY76Z2rM5mHXA@public.gmane.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-9tnw74Q4ehaHKKo6LODCOg@public.gmane.org>

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

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2014-12-12  9:53 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
     [not found]         ` <5489CE19.8080108-9tnw74Q4ehaHKKo6LODCOg@public.gmane.org>
2014-12-12  8:58           ` Janusz Użycki
     [not found]             ` <548AAE51.7060507-9tnw74Q4ehaHKKo6LODCOg@public.gmane.org>
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-bicnvbalz9megne8c9+irq@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
    --cc=j.uzycki-9tnw74Q4ehaHKKo6LODCOg@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-pwm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /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;
as well as URLs for NNTP newsgroup(s).