linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Sean Anderson <sean.anderson@seco.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: linux-pwm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, michal.simek@xilinx.com,
	Lee Jones <lee.jones@linaro.org>,
	Thierry Reding <thierry.reding@gmail.com>
Subject: Re: [PATCH 2/2] pwm: Add support for Xilinx AXI Timer
Date: Tue, 4 May 2021 11:03:34 -0400	[thread overview]
Message-ID: <70fa97ba-ea32-e734-acd5-5f5de3c03348@seco.com> (raw)
In-Reply-To: <2ef7de6f-4d17-e81a-11bc-27eb382577a7@seco.com>

On 5/4/21 10:46 AM, Sean Anderson wrote:
 > On 5/4/21 4:51 AM, Uwe Kleine-König wrote:
 >  >> +static int xilinx_pwm_remove(struct platform_device *pdev)
 >  >> +{
 >  >> +    struct xilinx_pwm_device *pwm = platform_get_drvdata(pdev);
 >  >> +    bool enabled = xilinx_pwm_is_enabled(readl(pwm->regs + TCSR0),
 >  >> +                         readl(pwm->regs + TCSR1));
 >  >> +
 >  >> +    if (enabled)
 >  >> +        clk_rate_exclusive_put(pwm->clk);
 >  >
 >  > This looks wrong. You should rely on the consumer that they disable the
 >  > PWM.
 >
 > What about a PWM regulator with always-on?
 >
 > This is mostly to match the exclusive_get in probe, in case there are
 > misbehaving consumers.

Since we always get the rate exclusively, we must always put the rate
exclusively here. So if the PWM is probed, but no one ever does anything
with it (and therefore no one turns it off), we must release the
exclusive rate in remove.

--Sean

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-05-04 15:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-03 21:44 [PATCH 1/2] dt-bindings: pwm: Add Xilinx AXI Timer Sean Anderson
2021-05-03 21:44 ` [PATCH 2/2] pwm: Add support for " Sean Anderson
2021-05-04  2:24   ` kernel test robot
2021-05-04  9:03     ` Alvaro Gamez
2021-05-04 17:16     ` Sean Anderson
2021-05-04  8:51   ` Uwe Kleine-König
2021-05-04 12:32     ` Michal Simek
2021-05-04 15:57       ` Sean Anderson
2021-05-04 16:13         ` Uwe Kleine-König
2021-05-05  6:31           ` Michal Simek
2021-05-04 14:46     ` Sean Anderson
2021-05-04 15:03       ` Sean Anderson [this message]
2021-05-04 17:15       ` Uwe Kleine-König
2021-05-04 18:01         ` Sean Anderson
2021-05-04  0:21 ` [PATCH 1/2] dt-bindings: pwm: Add " Rob Herring
2021-05-04 14:51   ` Sean Anderson

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=70fa97ba-ea32-e734-acd5-5f5de3c03348@seco.com \
    --to=sean.anderson@seco.com \
    --cc=devicetree@vger.kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=thierry.reding@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /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).