From: Hans de Goede <johannes.goede@oss.qualcomm.com>
To: Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
Javier Martinez Canillas <javierm@redhat.com>
Cc: Hans de Goede <johannes.goede@oss.qualcomm.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>, Helge Deller <deller@gmx.de>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Dmitry Baryshkov <lumag@kernel.org>,
Rob Clark <robin.clark@oss.qualcomm.com>,
linux-clk@vger.kernel.org, dri-devel@lists.freedesktop.org,
~postmarketos/upstreaming@lists.sr.ht
Subject: [PATCH 2/3] drm/sysfb: simpledrm: Use __clk_disable_unprepare_counts_only()
Date: Wed, 27 May 2026 11:48:10 +0200 [thread overview]
Message-ID: <20260527094811.116977-3-johannes.goede@oss.qualcomm.com> (raw)
In-Reply-To: <20260527094811.116977-1-johannes.goede@oss.qualcomm.com>
simpledrm_device_init_clocks() calls clk_prepare_enable() to avoid clocks
used by the framebuffer getting turned off while in use.
simpledrm_device_release_clocks() then must call clk_disable_unprepare()
to balance the enable count. clk_disable_unprepare() actually turns the
clock off, messing with the hardware state before the real display driver
loads, without any knowledge of the proper display power-off sequence.
Sometimes this leaves the hardware in an undefined state e.g. on some
Qualcomm platforms turning off the DP clocks at simpledrm remove() results
in the following error when the msm display driver tries to re-enable them:
[ 2.980181] disp_cc_mdss_dptx3_pixel0_clk_src: rcg didn't update its configuration.
[ 2.980272] WARNING: drivers/clk/qcom/clk-rcg2.c:136 at update_config+0xdc/0x100
Switch to using the new __clk_disable_unprepare_counts_only() function,
which decrements the counts without actually turning off the clocks.
Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
---
drivers/gpu/drm/sysfb/simpledrm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/sysfb/simpledrm.c b/drivers/gpu/drm/sysfb/simpledrm.c
index 7a95d2dacd9d..6927a32ed282 100644
--- a/drivers/gpu/drm/sysfb/simpledrm.c
+++ b/drivers/gpu/drm/sysfb/simpledrm.c
@@ -261,7 +261,7 @@ static void simpledrm_device_release_clocks(void *res)
for (i = 0; i < sdev->clk_count; ++i) {
if (sdev->clks[i]) {
- clk_disable_unprepare(sdev->clks[i]);
+ __clk_disable_unprepare_counts_only(sdev->clks[i]);
clk_put(sdev->clks[i]);
}
}
@@ -315,7 +315,7 @@ static int simpledrm_device_init_clocks(struct simpledrm_device *sdev)
while (i) {
--i;
if (sdev->clks[i]) {
- clk_disable_unprepare(sdev->clks[i]);
+ __clk_disable_unprepare_counts_only(sdev->clks[i]);
clk_put(sdev->clks[i]);
}
}
--
2.54.0
next prev parent reply other threads:[~2026-05-27 9:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-27 9:48 [PATCH 0/3] clk: Add __clk_disable_unprepare_counts_only() and use this in simple[fb|drm] Hans de Goede
2026-05-27 9:48 ` [PATCH 1/3] clk: Add __clk_disable_unprepare_counts_only() helper Hans de Goede
2026-05-28 2:34 ` Claude review: " Claude Code Review Bot
2026-05-27 9:48 ` Hans de Goede [this message]
2026-05-28 2:34 ` Claude review: drm/sysfb: simpledrm: Use __clk_disable_unprepare_counts_only() Claude Code Review Bot
2026-05-27 9:48 ` [PATCH 3/3] fbdev: simplefb: " Hans de Goede
2026-05-28 2:34 ` Claude review: " Claude Code Review Bot
2026-05-27 12:04 ` [PATCH 0/3] clk: Add __clk_disable_unprepare_counts_only() and use this in simple[fb|drm] Maxime Ripard
2026-05-27 12:21 ` Hans de Goede
2026-05-27 12:48 ` Maxime Ripard
2026-05-27 15:09 ` Hans de Goede
2026-05-27 23:03 ` Brian Masney
2026-05-28 2:34 ` Claude review: " Claude Code Review Bot
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=20260527094811.116977-3-johannes.goede@oss.qualcomm.com \
--to=johannes.goede@oss.qualcomm.com \
--cc=andersson@kernel.org \
--cc=deller@gmx.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=javierm@redhat.com \
--cc=konradybcio@kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=lumag@kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=mturquette@baylibre.com \
--cc=robin.clark@oss.qualcomm.com \
--cc=sboyd@kernel.org \
--cc=tzimmermann@suse.de \
--cc=~postmarketos/upstreaming@lists.sr.ht \
/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