From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Leif Middelschulte <leif.middelschulte@gmail.com>
Cc: Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
NXP Linux Team <linux-imx@nxp.com>,
Leif Middelschulte <Leif.Middelschulte@klsmartin.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-pwm@vger.kernel.org
Subject: Re: [PATCH v4 1/2] pwm: imx27: fix race condition .apply,.get_state
Date: Mon, 26 Feb 2024 09:44:16 +0100 [thread overview]
Message-ID: <qucbpwau55tuaf5m5fqpsbub2bbtxcye4djxwrwkabssd2vc4j@weuiawrzbbnn> (raw)
In-Reply-To: <20240224112902.55539-1-Leif.Middelschulte@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1835 bytes --]
Hello,
On Sat, Feb 24, 2024 at 12:29:00PM +0100, Leif Middelschulte wrote:
> From: Leif Middelschulte <Leif.Middelschulte@klsmartin.com>
>
> With CONFIG_PWM_DEBUG=y after writing a value to the PWMSAR
> register in .apply(), the register is read in .get_state().
> Unless a period completed in the meantime, this read yields the
> previously used duty cycle configuration. As the PWM_DEBUG code
> applies the read out configuration for testing purposes this
> effectively undoes the intended effect by rewriting the previous
> hardware state.
>
> Note that this change merely implements a sensible heuristic.
> The i.MX has a 4 slot FIFO to configure the duty cycle. This FIFO
> cannot be read back in its entirety. The "write x then read back
> x from hw" semantics are therefore not easily applicable.
> With this change, the .get_state() function tries to wait for some
> stabilization in the FIFO (empty state). In this state it keeps
> applying the last value written to the sample register.
>
> Signed-off-by: Leif Middelschulte <Leif.Middelschulte@klsmartin.com>
Another few things I noticed only after replying to this patch and
trying to apply #2:
- Please make sure you have a S-o-b line for the sender (i.e. you with
your gmail identity).
- My reply to your klsmartin.com address couldn't be delivered, The MS
mailserver told: "leif.middelschulte wasn't found at klsmartin.com."
- Please start a new thread if you send a v5, as applying patches from
a thread containing many patches is a bit less trivial.
- Consider using git format-patch's --base parameter to document your
patch base.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2024-02-26 8:44 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-26 15:03 [PATCH v2] pwm: imx27: fix race condition .apply,.get_state Leif Middelschulte
2023-03-10 17:45 ` Uwe Kleine-König
2023-08-15 10:43 ` [PATCH v3 1/4] " Leif Middelschulte
2023-08-15 10:43 ` [PATCH v3 2/4] pwm: imx27: avoid PWM consumer API Leif Middelschulte
2023-09-06 15:36 ` Uwe Kleine-König
2023-08-15 10:43 ` [PATCH v3 3/4] pwm: imx27: verify decreasing PWM FIFO av value Leif Middelschulte
2023-08-15 10:43 ` [PATCH v3 4/4] pwm: imx27: return error, if clean PWM setup fails Leif Middelschulte
2023-09-06 15:44 ` Uwe Kleine-König
2023-09-06 15:42 ` [PATCH v3 1/4] pwm: imx27: fix race condition .apply,.get_state Uwe Kleine-König
2024-02-24 11:00 ` Leif Middelschulte
2024-02-24 11:29 ` [PATCH v4 1/2] " Leif Middelschulte
2024-02-24 11:29 ` [PATCH v4 2/2] pwm: imx27: avoid PWM consumer API Leif Middelschulte
2024-02-26 8:37 ` Uwe Kleine-König
2024-02-26 8:24 ` [PATCH v4 1/2] pwm: imx27: fix race condition .apply,.get_state Uwe Kleine-König
2024-02-26 8:44 ` Uwe Kleine-König [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=qucbpwau55tuaf5m5fqpsbub2bbtxcye4djxwrwkabssd2vc4j@weuiawrzbbnn \
--to=u.kleine-koenig@pengutronix.de \
--cc=Leif.Middelschulte@klsmartin.com \
--cc=festevam@gmail.com \
--cc=kernel@pengutronix.de \
--cc=leif.middelschulte@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.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).