Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5480625rwb; Mon, 14 Nov 2022 05:25:08 -0800 (PST) X-Google-Smtp-Source: AA0mqf6+PzgMfXhb8c0dRXkR32p1C/QSn1Ugx2erPNdRRtoLbtF+lvkPhMmKtTRHj5Rnu+OT3QMY X-Received: by 2002:a63:4859:0:b0:457:4863:2e85 with SMTP id x25-20020a634859000000b0045748632e85mr11660029pgk.6.1668432307674; Mon, 14 Nov 2022 05:25:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668432307; cv=none; d=google.com; s=arc-20160816; b=s+mNQ3owyz+T3mPotzKsPTOtDQeOQ9oyh/e3YuEe/34E59Ha5XzYTSn9qzZI0yDqCT SvMx2LPW1RyBUnHTP9wROpt6AfLSgX6WsGGchv4TxCyr9xSLtUzRgtz/EHk4uhW3apLZ LfQvtH9exKXZU2PEceiIdtkvIJlASoiREO5q3+Yi7NS/O5Z0W4gvd+BKSln6SFjIkujH QVAh9C4+/u4oLWtndP7ahOyqAl4uSPBh2aMg2kEk27T6lzHsVjTSRzzTjdfYLjIM7+iR X8lwjf4v/CMUrRzBvirIorVd7Ifz9CGNQOpaf86+nBG5mnxicG88RToDuofzgtWybpTo i1BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:feedback-id :dkim-signature:dkim-signature; bh=hTwfEL8WhY8IR4P7vKxZDyu4A7kRyCha3szkP5Ui2Og=; b=rIxgWVfdIZ8IYfeBCiuoX0fXoapSunI6f+Mq6PdOdA5kfldOd8TZzrd8oSvWPIJ7VP pkMsrHDrsfqXM4sLboVXrPk4F733a4lNht7MAhs0UX6euRAv1+VRt8iPojWcXl5zJ//Q OZPcS3So8HVzjeQJeIrlpTUUP3hKy9fMC3gz2/2UpOuAfREaktWeuKe05jFn+yasADS8 UIPO5bKOWVUgV2KaRoexSbNJenJgost0I9e0O1DPSLwVHGqMF7ZaMWspoqDV1+QLM2DN k3m89rZ3Hya/tjrwrgqG4W5axeONofjLaEH7yoQWN9CF4KOesGYqkt92QmPFI1IcJzSA Csdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm2 header.b=XFdwPJCq; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=JuZeLjuR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z20-20020a631914000000b004473c654f95si10037520pgl.653.2022.11.14.05.24.55; Mon, 14 Nov 2022 05:25:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm2 header.b=XFdwPJCq; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=JuZeLjuR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237812AbiKNNGN (ORCPT + 87 others); Mon, 14 Nov 2022 08:06:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237808AbiKNNGM (ORCPT ); Mon, 14 Nov 2022 08:06:12 -0500 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CDD02A944 for ; Mon, 14 Nov 2022 05:06:11 -0800 (PST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id CD4325C0118; Mon, 14 Nov 2022 08:06:10 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 14 Nov 2022 08:06:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm2; t=1668431170; x=1668517570; bh=hTwfEL8WhY 8IR4P7vKxZDyu4A7kRyCha3szkP5Ui2Og=; b=XFdwPJCq6MfipI6W6CxCjWujM8 qKW6zvR1ZYsCyx1+cyr+9dTvnTFdKJeITINg8GhcyYFH+1se7R+lIW8Gd+sasxD0 ZfYKHqQ6Pf9RpD/fWYkuNKD/zp0S2XYwAmrbrkuf5PMuR5Z3N1GvdtZ7PobEpwF0 uqWybooDrC+1g7pGlO0DgALC/38dzu+zuJkxDljXmM0qAHNl51/209zYxq6HXNer ZIj8z+z3ERT2tmEu5FcuRAAtfvGISvOipkJalfF9jrrp9W6axuPukAgk9FK6C84M 21m3GtwN+YqGK8mqIwyWgTEFjBlkCmUZPB+p+XUZze/eVQEdDW3kvb+lusvw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1668431170; x=1668517570; bh=hTwfEL8WhY8IR4P7vKxZDyu4A7kR yCha3szkP5Ui2Og=; b=JuZeLjuR+w22RCnq0vwKBm6Xad6BN6Fubtp5SqLmo688 qWoban8NACaUVRV91919czkb3Lv/5e4t2yUYxwQBV82XvRZQsUoqCEyys+n62F32 YmN8uIXGkusTXYYrnzPoFEukN0G3XGHkYmZMfTXRKFYz3m5c6AZAoUhzYGGa+mKW BiDs/jjFTY14j1C33siqSK6SVzFrMnf4FvrrPPGxoSmNOoiBRML1ypO1HpzmK3u9 16//z3TVW8s2Scj/XUcupuBESaiQNROuwGDSZ4Bxwlm5tCGlB5QDrQ2G7m0j2JeR LIUosup1G476E8dfTf3bU7LVlYIKuUbIhgIoTYHUeA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrgedvgddvudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehgtderredttddunecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepleejuefggeevteelveekteffgeduveeiteeiueegueegiedvtdejjedvfeef tefgnecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 14 Nov 2022 08:06:09 -0500 (EST) Date: Mon, 14 Nov 2022 14:06:08 +0100 From: Maxime Ripard To: Stefan Wahren Cc: David Airlie , Daniel Vetter , Thomas Zimmermann , Maarten Lankhorst , Emma Anholt , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Marc Kleine-Budde Subject: Re: [PATCH 1/2] drm/vc4: hdmi: Enforce the minimum rate at runtime_resume Message-ID: <20221114130608.kqxhorlee25rvrc7@houat> References: <20220929-rpi-pi3-unplugged-fixes-v1-0-cd22e962296c@cerno.tech> <20220929-rpi-pi3-unplugged-fixes-v1-1-cd22e962296c@cerno.tech> <737e7e23-1bc5-eaf3-2d15-5498fc5b0415@i2se.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="zvzqn4wjbzjl3o27" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --zvzqn4wjbzjl3o27 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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, > >=20 > > 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. > > >=20 > > > 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. > > >=20 > > > 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 t= hat > > > 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. > > >=20 > > > 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. > > >=20 > > > Link: https://lore.kernel.org/dri-devel/20220922145448.w3xfywkn5ecak2= et@pengutronix.de/ > > > Fixes: fd5894fa2413 ("drm/vc4: hdmi: Remove clock rate initialization= ") > > > Reported-by: Marc Kleine-Budde > > > Signed-off-by: Maxime Ripard > > > --- > > > =A0 drivers/gpu/drm/vc4/vc4_hdmi.c | 9 +++++++++ > > > =A0 1 file changed, 9 insertions(+) > > >=20 > > > 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) > > > =A0=A0=A0=A0=A0 u32 __maybe_unused value; > > > =A0=A0=A0=A0=A0 int ret; > > > =A0 +=A0=A0=A0 /* > > > +=A0=A0=A0=A0 * The HSM clock is in the HDMI power domain, so we need= to set > > > +=A0=A0=A0=A0 * its frequency while the power domain is active so tha= t it > > > +=A0=A0=A0=A0 * keeps its rate. > > > +=A0=A0=A0=A0 */ > > > +=A0=A0=A0 ret =3D clk_set_min_rate(vc4_hdmi->hsm_clock, HSM_MIN_CLOC= K_FREQ); > > > +=A0=A0=A0 if (ret) > > > +=A0=A0=A0=A0=A0=A0=A0 return ret; > > > + > >=20 > > 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 --zvzqn4wjbzjl3o27 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCY3I9QAAKCRDj7w1vZxhR xQKtAP4+zlNIn7+r6XxtuDBvv0Eo4QlHEDhlHIQWW069FlLORAD+LiRnVQRFYCRX sJL1ElqKtlXEsrhB6Q2bUqMfY9W+Lww= =9ceS -----END PGP SIGNATURE----- --zvzqn4wjbzjl3o27--