Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp657643pxv; Thu, 15 Jul 2021 12:40:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2OIokh9kPZjPPQQ4viZnmm7p46w+eFYoQSxsmF8pMi2raC6yRPncYxm+DD2ULBf7sbFXp X-Received: by 2002:a17:906:33d0:: with SMTP id w16mr7265862eja.376.1626378045295; Thu, 15 Jul 2021 12:40:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626378045; cv=none; d=google.com; s=arc-20160816; b=srCEgTQ8ZqT22bzsOfmpRMdO9eue4GHEmWhhJ4nf+9bQZ/VFOy5Ca00JhVPqSmw+E/ CbiWi+P4UvQBTJDv+hAWL6Mf4Ckm9qLV1Y26/YvBOeLjh6IeLXHlJpQf8hSdD+OU/a6f W/ow4yyrQqOFKrCV2yUBnd0CaGG/NKa5shwYWAl5qKcIpZMozAfFuEs/K2lLL81k4uIF Cvgvj9SGy3lyF9Qe5AEcsEMMk4Cj1WhKNpMM5MMb9K0XMOq+0D+Mlx99c007TAqmWewK 0ZLP4DiVD+UQBigdG8eqEH/XCZAZzI8ccDiYFqUNPsGIbk2WcgtCEzPYskN6w7nDuG7h 83FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KXettIkdD8EirF7iAAY35skHlpcVY4Kpak2dtki++2w=; b=aAczLiTcpKhNRL9vYBOFH80HyPEDmYU66d2Xv+dPwpZlmDgAJbSigTNIc7v+ZVnYG1 H/ycERMyL3QRdyIe+W03OhlI/lDupaFTq0kamGBuv5EjKTMmhU+LBHXUYdeM3rDk/gGV v0YE190CC42slRRD3gnTCtvKIbAevqY3lINka51fRK8cPYr6Bd1MAWrSurQ83K0G7cbA 1QwG56bcP8KbJXE7HEbDozy9S3E5drUDjx6ezzxGTUxsCWDY8afpRxDrfZvadLyKtSNG RkyRflbUK62rwsBByDoDHdECbyOaX7vy2lFdFdjn36NVFv8M3EILBZjVrk/hVqwJ9e/O m0XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NOflgjVR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v7si7988802edj.541.2021.07.15.12.40.22; Thu, 15 Jul 2021 12:40:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NOflgjVR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235691AbhGOTlM (ORCPT + 99 others); Thu, 15 Jul 2021 15:41:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:51154 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244636AbhGOTO7 (ORCPT ); Thu, 15 Jul 2021 15:14:59 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 846F36140F; Thu, 15 Jul 2021 19:10:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626376260; bh=AykE/DNX1ohxHWrctLld96qWYnNgwrQLNEkWEleFwec=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NOflgjVRKMTmf4piaSkPI+dqKjQ8SsWgsUE9+EzJvEpp9KgUdmJCmLPaC8fNlKNsE mjd2mvDsUYlNmc+K4OdyKMoE9Rx5EI/6NTncoxWXjsMs8lyClA620JVZw37u+01ym5 wJgbW6FSLiNun8pK0trHChgRG2WYnoibKrnVdUFg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maxime Ripard , Dave Stevenson Subject: [PATCH 5.13 194/266] drm/vc4: hdmi: Prevent clock unbalance Date: Thu, 15 Jul 2021 20:39:09 +0200 Message-Id: <20210715182644.976995978@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182613.933608881@linuxfoundation.org> References: <20210715182613.933608881@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Maxime Ripard commit 5b006000423667ef0f55721fc93e477b31f22d28 upstream. Since we fixed the hooks to disable the encoder at boot, we now have an unbalanced clk_disable call at boot since we never enabled them in the first place. Let's mimic the state of the hardware and enable the clocks at boot if the controller is enabled to get the use-count right. Cc: # v5.10+ Fixes: 09c438139b8f ("drm/vc4: hdmi: Implement finer-grained hooks") Signed-off-by: Maxime Ripard Reviewed-by: Dave Stevenson Link: https://patchwork.freedesktop.org/patch/msgid/20210507150515.257424-7-maxime@cerno.tech Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/vc4/vc4_hdmi.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -2012,6 +2012,14 @@ static int vc4_hdmi_bind(struct device * if (vc4_hdmi->variant->reset) vc4_hdmi->variant->reset(vc4_hdmi); + if ((of_device_is_compatible(dev->of_node, "brcm,bcm2711-hdmi0") || + of_device_is_compatible(dev->of_node, "brcm,bcm2711-hdmi1")) && + HDMI_READ(HDMI_VID_CTL) & VC4_HD_VID_CTL_ENABLE) { + clk_prepare_enable(vc4_hdmi->pixel_clock); + clk_prepare_enable(vc4_hdmi->hsm_clock); + clk_prepare_enable(vc4_hdmi->pixel_bvb_clock); + } + pm_runtime_enable(dev); drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_TMDS);