From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: "Chen-Yu Tsai" <wenst@chromium.org>,
"Uwe Kleine-König" <ukleinek@kernel.org>,
"Matthias Brugger" <matthias.bgg@gmail.com>
Cc: linux-pwm@vger.kernel.org, linux-mediatek@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Jitao Shi <jitao.shi@mediatek.com>
Subject: Re: [PATCH] pwm: mtk-disp: Fix period readback
Date: Tue, 8 Sep 2026 09:14:54 +0200 [thread overview]
Message-ID: <30806e9c-8d37-4f99-b9d6-a2819acaeb50@collabora.com> (raw)
In-Reply-To: <20260827105738.8570-1-wenst@chromium.org>
On 8/27/26 12:57, Chen-Yu Tsai wrote:
> The period value stored in the register is the number of clock cycles - 1.
>
> Account for the offset when calculating the period in nanoseconds. This
> fixes the discrepancy reported by the pwm core when CONFIG_PWM_DEBUG=1:
>
> mediatek-disp-pwm 1100e000.pwm: .apply is not idempotent
> (ena=1 pol=0 281500/499875) -> (ena=1 pol=0 281500/499750)
>
> Calculation discrepancy in the driver was found by AI run by a colleague
> while debugging another PWM related issue. Check against SoC datasheet
> and fix done by the author.
>
> Fixes: 3f2b16734914 ("pwm: mtk-disp: Implement atomic API .get_state()")
> Cc: Jitao Shi <jitao.shi@mediatek.com>
> Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
next prev parent reply other threads:[~2026-09-08 7:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-27 10:57 [PATCH] pwm: mtk-disp: Fix period readback Chen-Yu Tsai
2026-08-27 11:03 ` Fei Shao
2026-09-08 7:14 ` AngeloGioacchino Del Regno [this message]
2026-09-08 9:52 ` Uwe Kleine-König
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=30806e9c-8d37-4f99-b9d6-a2819acaeb50@collabora.com \
--to=angelogioacchino.delregno@collabora.com \
--cc=jitao.shi@mediatek.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-pwm@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=ukleinek@kernel.org \
--cc=wenst@chromium.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