From: Frank Li <Frank.li@nxp.com>
To: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
Cc: Marek Vasut <marex@denx.de>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
Philipp Zabel <p.zabel@pengutronix.de>,
linux-pwm@vger.kernel.org, devicetree@vger.kernel.org,
imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, pratikmanvar09@gmail.com,
francesco@dolcini.it
Subject: Re: [PATCH v3 2/3] pwm: imx27: Use clk_bulk_*() API to simplify clock handling
Date: Tue, 22 Oct 2024 12:01:42 -0400 [thread overview]
Message-ID: <ZxfMZobFdBA7ffhU@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <7kplk52i7e2nha5ym4loza5oc3lwghifjfk3aut24w3hjagfk3@zusb2naeaevw>
On Tue, Oct 22, 2024 at 08:53:40AM +0200, Uwe Kleine-König wrote:
> Hello,
>
> On Tue, Sep 10, 2024 at 03:07:19PM -0400, Frank Li wrote:
> > @@ -229,7 +209,7 @@ static int pwm_imx27_apply(struct pwm_chip *chip, struct pwm_device *pwm,
> > int ret;
> > u32 cr;
> >
> > - clkrate = clk_get_rate(imx->clk_per);
> > + clkrate = clk_get_rate(imx->clks[PWM_IMX27_PER].clk);
> > c = clkrate * state->period;
>
> Unrelated to this patch: clk_get_rate() should only be called on enabled
> clocks. Given that further down in that function (see next hunk)
> pwm_imx27_clk_prepare_enable() (or clk_bulk_prepare_enable()
> respectively) is called, that clk might be off?!
>
> > do_div(c, NSEC_PER_SEC);
> > @@ -259,7 +239,7 @@ static int pwm_imx27_apply(struct pwm_chip *chip, struct pwm_device *pwm,
> > if (pwm->state.enabled) {
> > pwm_imx27_wait_fifo_slot(chip, pwm);
> > } else {
> > - ret = pwm_imx27_clk_prepare_enable(imx);
> > + ret = clk_bulk_prepare_enable(imx->clks_cnt, imx->clks);
> > if (ret)
> > return ret;
> >
>
> I applied just this patch to
> https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git pwm/for-next
> . The others are still under discussion, right?
Yes, thanks. I think 32k is not necessary and need more research.
>
> I see you signed your patch (which is fine!), but I couldn't find your
> key, neither on hkps://keys.openpgp.org/ nor on
Thanks. Fixed.
> hkps://keyserver.ubuntu.com nor in the kernel keyring. At least the
> first two should be easy to fix.
>
> Best regards
> Uwe
next prev parent reply other threads:[~2024-10-22 16:01 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-10 19:07 [PATCH v3 0/3] pwm: imx: add 32k clock for 8qm/qxp Frank Li
2024-09-10 19:07 ` [PATCH v3 1/3] dt-bindings: pwm: imx: Add optional clock '32k' Frank Li
2024-09-11 20:28 ` Marek Vasut
2024-09-11 21:10 ` Frank Li
2024-09-11 21:14 ` Marek Vasut
2024-09-11 22:19 ` Frank Li
2024-09-12 0:15 ` Marek Vasut
2024-09-10 19:07 ` [PATCH v3 2/3] pwm: imx27: Use clk_bulk_*() API to simplify clock handling Frank Li
2024-10-22 6:53 ` Uwe Kleine-König
2024-10-22 16:01 ` Frank Li [this message]
2024-10-29 8:07 ` Uwe Kleine-König
2024-09-10 19:07 ` [PATCH v3 3/3] pwm: imx27: Add optional 32k clock for pwm in i.MX8QXP MIPI subsystem Frank Li
2024-09-11 20:31 ` Marek Vasut
2024-09-11 21:28 ` Frank Li
2024-09-11 21:33 ` Marek Vasut
2024-09-11 20:27 ` [PATCH v3 0/3] pwm: imx: add 32k clock for 8qm/qxp Marek Vasut
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=ZxfMZobFdBA7ffhU@lizhi-Precision-Tower-5810 \
--to=frank.li@nxp.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=festevam@gmail.com \
--cc=francesco@dolcini.it \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=marex@denx.de \
--cc=p.zabel@pengutronix.de \
--cc=pratikmanvar09@gmail.com \
--cc=robh@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=u.kleine-koenig@baylibre.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