From: Maxime Ripard <maxime@cerno.tech>
To: Stefan Wahren <stefan.wahren@i2se.com>
Cc: David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
Thomas Zimmermann <tzimmermann@suse.de>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Emma Anholt <emma@anholt.net>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Marc Kleine-Budde <mkl@pengutronix.de>
Subject: Re: [PATCH 1/2] drm/vc4: hdmi: Enforce the minimum rate at runtime_resume
Date: Mon, 14 Nov 2022 14:06:08 +0100 [thread overview]
Message-ID: <20221114130608.kqxhorlee25rvrc7@houat> (raw)
In-Reply-To: <b49a242f-dc85-171d-1f0c-93b9099712a3@i2se.com>
[-- Attachment #1: Type: text/plain, Size: 2822 bytes --]
Hi Stefan,
On Mon, Nov 14, 2022 at 01:48:14AM +0100, Stefan Wahren wrote:
> Am 11.11.22 um 22:08 schrieb Stefan Wahren:
> > Hi Maxime,
> >
> > Am 29.09.22 um 11:21 schrieb Maxime Ripard:
> > > This is a revert of commit fd5894fa2413 ("drm/vc4: hdmi: Remove clock
> > > rate initialization"), with the code slightly moved around.
> > >
> > > It turns out that we can't downright remove that code from the driver,
> > > since the Pi0-3 and Pi4 are in different cases, and it only works for
> > > the Pi4.
> > >
> > > Indeed, the commit mentioned above was relying on the RaspberryPi
> > > firmware clocks driver to initialize the rate if it wasn't done by the
> > > firmware. However, the Pi0-3 are using the clk-bcm2835 clock driver that
> > > wasn't doing this initialization. We therefore end up with the clock not
> > > being assigned a rate, and the CPU stalling when trying to access a
> > > register.
> > >
> > > We can't move that initialization in the clk-bcm2835 driver, since the
> > > HSM clock we depend on is actually part of the HDMI power domain, so any
> > > rate setup is only valid when the power domain is enabled. Thus, we
> > > reinstated the minimum rate setup at runtime_suspend, which should
> > > address both issues.
> > >
> > > Link: https://lore.kernel.org/dri-devel/20220922145448.w3xfywkn5ecak2et@pengutronix.de/
> > > Fixes: fd5894fa2413 ("drm/vc4: hdmi: Remove clock rate initialization")
> > > Reported-by: Marc Kleine-Budde <mkl@pengutronix.de>
> > > Signed-off-by: Maxime Ripard <maxime@cerno.tech>
> > > ---
> > > drivers/gpu/drm/vc4/vc4_hdmi.c | 9 +++++++++
> > > 1 file changed, 9 insertions(+)
> > >
> > > diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c
> > > b/drivers/gpu/drm/vc4/vc4_hdmi.c
> > > index 199bc398817f..2e28fe16ed5e 100644
> > > --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
> > > +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
> > > @@ -2891,6 +2891,15 @@ static int vc4_hdmi_runtime_resume(struct
> > > device *dev)
> > > u32 __maybe_unused value;
> > > int ret;
> > > + /*
> > > + * The HSM clock is in the HDMI power domain, so we need to set
> > > + * its frequency while the power domain is active so that it
> > > + * keeps its rate.
> > > + */
> > > + ret = clk_set_min_rate(vc4_hdmi->hsm_clock, HSM_MIN_CLOCK_FREQ);
> > > + if (ret)
> > > + return ret;
> > > +
> >
> > unfortunately this breaks X on Raspberry Pi 4 in Linux 6.0.5
> > (multi_v7_defconfig + LPAE). Today i saw this report [1] and bisected
> > the issue down to this patch. Shame on me that i only tested this patch
> > with Rpi 3B+ :-(
>
> Looks like "drm/vc4: hdmi: Fix HSM clock too low on Pi4" addresses this
> issue ...
Yes, indeed. The fix should be on its way to -stable already
Maxime
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2022-11-14 13:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-29 9:21 [PATCH 0/2] drm/vc4: hdmi: Fixes for the RaspberryPi 0-3 stalls Maxime Ripard
2022-09-29 9:21 ` [PATCH 1/2] drm/vc4: hdmi: Enforce the minimum rate at runtime_resume Maxime Ripard
2022-10-13 9:37 ` Javier Martinez Canillas
2022-10-13 12:11 ` (subset) " Maxime Ripard
2022-11-11 21:08 ` Stefan Wahren
2022-11-14 0:48 ` Stefan Wahren
2022-11-14 13:06 ` Maxime Ripard [this message]
2022-09-29 9:21 ` [PATCH 2/2] drm/vc4: hdmi: Check the HSM " Maxime Ripard
2022-10-13 9:43 ` Javier Martinez Canillas
2022-10-13 12:11 ` (subset) " Maxime Ripard
2022-10-10 8:50 ` [PATCH 0/2] drm/vc4: hdmi: Fixes for the RaspberryPi 0-3 stalls Maxime Ripard
2022-10-10 16:38 ` Stefan Wahren
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=20221114130608.kqxhorlee25rvrc7@houat \
--to=maxime@cerno.tech \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=emma@anholt.net \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mkl@pengutronix.de \
--cc=stefan.wahren@i2se.com \
--cc=tzimmermann@suse.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).