From: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: <linux-pwm@vger.kernel.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
<linux-stm32@st-md-mailman.stormreply.com>,
Thierry Reding <thierry.reding@gmail.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
<kernel@pengutronix.de>, <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 5/5] pwm: stm32: Fix enable count for clk in .probe()
Date: Thu, 16 Nov 2023 16:05:04 +0100 [thread overview]
Message-ID: <363a8b67-1b6d-49e3-a2e0-3a0c97759ada@foss.st.com> (raw)
In-Reply-To: <20231115210155.p6m5rbahpzusy6bc@pengutronix.de>
On 11/15/23 22:01, Uwe Kleine-König wrote:
> Hello Fabrice,
>
> On Wed, Nov 15, 2023 at 10:02:20AM +0100, Fabrice Gasnier wrote:
>> (with or without a Fixes tag) Could you add a check on global counter
>> enable bit (TIM_CR1_CEN) both in the .get_state(), and in the
>> stm32_pwm_detect_channels(), that counts the num_enabled channels ?
>
> I'd address that separately, mostly because the patches forwarded here
> are not mine.
Ok, let's go this way.
>
>> In case the TIM_CR1_CEN isn't set (but some of the TIM_CCER_CCXE are),
>> the driver will report enabled channels. But physically, the pwm output
>> will be inactive.
>
> Huuu, that means if channel #0 is running and I start a capture on
> channel #1 which results in unconditionally calling
> regmap_clear_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN); (in
> stm32_pwm_raw_capture()) channel #0 stops to toggle!
Basically no, please find my answers sent separately on "[PATCH] pwm:
stm32: Mark capture support as broken"
>
>> That's more a robustness case... depending on what's been done possibly
>> by bootloader. What to you think ?
>
> I would assume that a bootloader that sets the CCXE bits also enables
> TIM_CR1_CEN and so in practise Philipp's patch is fine. But I agree that
> doing things properly would be better.
ok, thanks,
Best Regards,
Fabrice
>
> Best regards
> Uwe
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-11-16 15:06 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-19 20:06 [PATCH 0/5] pwm: stm32: Cleanups, get_state() and proper hw take over Uwe Kleine-König
2023-10-19 20:07 ` [PATCH 1/5] pwm: stm32: Replace write_ccrx with regmap_write Uwe Kleine-König
2023-11-14 13:26 ` Fabrice Gasnier
2023-10-19 20:07 ` [PATCH 2/5] pwm: stm32: Make ch parameter unsigned Uwe Kleine-König
2023-11-14 13:26 ` Fabrice Gasnier
2023-10-19 20:07 ` [PATCH 3/5] pwm: stm32: Use hweight32 in stm32_pwm_detect_channels Uwe Kleine-König
2023-11-14 13:26 ` Fabrice Gasnier
2023-10-19 20:07 ` [PATCH 4/5] pwm: stm32: Implement .get_state() Uwe Kleine-König
2023-11-14 13:26 ` Fabrice Gasnier
2023-10-19 20:07 ` [PATCH 5/5] pwm: stm32: Fix enable count for clk in .probe() Uwe Kleine-König
2023-11-14 13:35 ` Fabrice Gasnier
2023-11-14 21:20 ` Uwe Kleine-König
2023-11-15 9:02 ` Fabrice Gasnier
2023-11-15 21:01 ` Uwe Kleine-König
2023-11-16 15:05 ` Fabrice Gasnier [this message]
2023-11-28 17:49 ` [PATCH 0/5] pwm: stm32: Cleanups, get_state() and proper hw take over Thierry Reding
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=363a8b67-1b6d-49e3-a2e0-3a0c97759ada@foss.st.com \
--to=fabrice.gasnier@foss.st.com \
--cc=alexandre.torgue@foss.st.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pwm@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=p.zabel@pengutronix.de \
--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).