[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <70fa97ba-ea32-e734-acd5-5f5de3c03348@seco.com>
Date: Tue, 4 May 2021 11:03:34 -0400
From: Sean Anderson <sean.anderson@...o.com>
To: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
Cc: linux-pwm@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
michal.simek@...inx.com, Lee Jones <lee.jones@...aro.org>,
Thierry Reding <thierry.reding@...il.com>
Subject: Re: [PATCH 2/2] pwm: Add support for Xilinx AXI Timer
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
Powered by blists - more mailing lists