Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2704656rwb; Fri, 11 Nov 2022 13:28:09 -0800 (PST) X-Google-Smtp-Source: AA0mqf518BoGi2j43C2K9lwclJiOlvLaeJlNn9FjgiYEx8sbD4BF3v05ZKghj+o7zeEJxXXE9W8w X-Received: by 2002:a05:6a00:4ac9:b0:56d:6450:9e49 with SMTP id ds9-20020a056a004ac900b0056d64509e49mr4422782pfb.54.1668202089099; Fri, 11 Nov 2022 13:28:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668202089; cv=none; d=google.com; s=arc-20160816; b=RJ0KJijQjSapBXpjV13fKgAuB1JY4WQ1ncJKI/5QwfOJm/OMqWU46DSV2D0nk56O2r Cplpw2VdQo0sWtETacBANN9O9kJzEBTZWQPx9Vac+OIkogiCRagbrbsogKL8V6tWRW9/ 4z80JqiPxtmUys5yInMjv9F3ybiPkjvtYK6zB+POmTehfxC1kjQWeS3Ju9expQeMlkiM 1IbtQ4E4NqrdJ+cDfBkhqUfrfk1BnZYNXF2352Kh2vkhEQs0FBF/CJFZWt7KtXuUer7t giD7oboa2JKd6+v3Res97LqV0Am+Zi0Cs1IEYVaD8S7Sy/+ebYcLwYVVFjpc1cFRidSZ Tn9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=iGPf268N3fxinh2NeNWaoPAY4vCopOFYiNO85RUPjpw=; b=GCNAVXchTCC0QbFoJjkGt5c/lA9rwCk5V0+xZdfhUN/s+AQJGt+L21AD13oJqpVHbh YQ2j/2oRq2ABrNYKMh9BF96FVHmBAH276iO4qa3muMWs1i42gYMKxYwbENRn5JKXmgys YzuCjSMUrXGO4xWGmXKtcSLuHKMY8Y6+IjWcn1E8A0hYydHPPROPFIP7bSfCX1WCGs+g inVZaxZUKsV1YejY5kmOL7hC7/2TQvzsv4nMDnK0WTfRSVPDAadMd9puy817k4on/Klw H+FT3YMWuA7Yv6+BruvYYZdkzHLoJm084uVMEwrP9y9Llq7GiMLeehxXjrMvN48LuIQD hTsg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q67-20020a17090a1b4900b0020de216d0c4si3407550pjq.61.2022.11.11.13.27.57; Fri, 11 Nov 2022 13:28:09 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234311AbiKKVJF (ORCPT + 90 others); Fri, 11 Nov 2022 16:09:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233804AbiKKVJC (ORCPT ); Fri, 11 Nov 2022 16:09:02 -0500 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FD70E018 for ; Fri, 11 Nov 2022 13:09:00 -0800 (PST) Received: from [192.168.1.139] ([37.4.248.83]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MXXZf-1oU2ZK1IHX-00Z1to; Fri, 11 Nov 2022 22:08:41 +0100 Message-ID: <737e7e23-1bc5-eaf3-2d15-5498fc5b0415@i2se.com> Date: Fri, 11 Nov 2022 22:08:39 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH 1/2] drm/vc4: hdmi: Enforce the minimum rate at runtime_resume Content-Language: en-US To: Maxime Ripard , David Airlie , Daniel Vetter , Thomas Zimmermann , Maxime Ripard , Maarten Lankhorst , Emma Anholt Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Marc Kleine-Budde References: <20220929-rpi-pi3-unplugged-fixes-v1-0-cd22e962296c@cerno.tech> <20220929-rpi-pi3-unplugged-fixes-v1-1-cd22e962296c@cerno.tech> From: Stefan Wahren In-Reply-To: <20220929-rpi-pi3-unplugged-fixes-v1-1-cd22e962296c@cerno.tech> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:p1P9ebm+F+zvfBkVXdlQhDM4wdPDfMtQZFdKRBA4EtF/oQ2vqFl 67GVvwHEHSTyJVq9hAnxdu1TbIgpEFbARDD1Xr6giCmH3SeC1WphljI/YrgImgT50QSGlVy xI4b1fdJaqEHwbweyC837c58JBHpqo4CaRlRo90//fLEGmi5QX7N4cA86jJs6j1yqKbJg51 +ie/aUV76gGV/yb5mfdxQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:WDb+IGX8DmU=:HFU8yHplq3TceO8E3Fv7KA sz+k8Qh4XEVEv3f9h2OEFgstLgGPcXHTlsrui0MpijsuuXRgEIbMy7YTIf68JHG7Tf8jmEqfW BW7gdN9kBXzMh+UnlR2yhdXAbmIzTpv7o03Ae80pFLNwUk2h8Eaqot3L8D5rFBuQ1mlfQ0IOD I/NX5zYjVi1f76HsheLxWKW5RaeeAahAa5Pcvpf+whdfVxvJsjfjzA7DYO7eiqnUrH5iaLNHr vpoCnZQoV3aKT1AAV/1nSMav8Wd7ml7pzHVk2atRNL7/JgP+Uv4JK6T5C9b9yN81cs8UGcJG+ vijcIqn1UdMrySKuzRSndJAsSZ8WoSjri05KcwMIbkpdYgH8iyf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IN_MSPIKE_H2,SPF_HELO_NONE,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 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 > Signed-off-by: Maxime Ripard > --- > 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+ :-( Best regards [1] - https://bugzilla.suse.com/show_bug.cgi?id=1205259 > ret = clk_prepare_enable(vc4_hdmi->hsm_clock); > if (ret) > return ret; >