Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp631133pxv; Thu, 15 Jul 2021 12:00:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUY2+PMPIexC6h7QSb2K7yodWLnl3imiIMMHQkJOUoWT4QMsLDps1DYmkjiHMd+vJAGaD+ X-Received: by 2002:a5d:8b8b:: with SMTP id p11mr4336229iol.77.1626375632085; Thu, 15 Jul 2021 12:00:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626375632; cv=none; d=google.com; s=arc-20160816; b=dW0/SiDVAln514jg1o8WTBNlFhKCL30jMeFXbA7QRLP6jf1kGHDuNXksxz8tRysKkn /vPoTmz1BANMVSEF/PzL7Q+kmEFCfaycpYMM0jBBvi+MrUL2Hh6Tl/jRNPekm3lCsYWm HMOjhs2TijEWaOiw96a1MUh2DFST+PST5kq+wC8uRtotOIjmHh8zqggMshcFJlGwuDey UCXNWGzWIp3PAJtVSV5f+QGXYEFRcH3TkByZC3s+SbezBcEeZkeZzX32UbHa+B7OPZO6 pmxo5f0id2WVxvn5+qHZke32oHGxlHrOyvFpACtLVWLDoGgD0lufAswelfgqQT9kjC6+ FXzg== 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=ELKrROOtEoluXRWWNZEy6TZ0Z7WeYbGMfOxoR4SgRp8=; b=VVk6KV4amLxyqe2YyY7BOjlLjMouvh15jI75BPxUZL2sALft4zHYFJXV+gkZl2N84s VP62M20Kql5hzIzZkqDIEPamexNqIiUvsCrqyQCSf6uMmiG99F+dt2hgxHs+YYSS7EHK wQ+bWD9jGB2WbFi/dimFw5Wp7P9mfTybouZDfvD7DXt24g+LK5wBqvBVYwhn+mzaIb3U 3dWAuuHuayFtfYEaK4U3CSU5r6bWVEPgnUblYRyimDrvmNuFdX8a/oIc0NQKYOMOWiFZ awjtU1xvcoD0Ze6d6LxBS9q0Gg+f6Sp8NcZ7pGQY9wm4bmktj8HIKByTyXJFe+2dpt0n 3UlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="K3s/0Qiz"; 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 x1si8393512jan.58.2021.07.15.12.00.19; Thu, 15 Jul 2021 12:00:32 -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="K3s/0Qiz"; 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 S243248AbhGOTBu (ORCPT + 99 others); Thu, 15 Jul 2021 15:01:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:58838 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241411AbhGOSyW (ORCPT ); Thu, 15 Jul 2021 14:54:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9CADC613C4; Thu, 15 Jul 2021 18:51:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375088; bh=qAzSmzRgqxdjSgXLVK587y2x4m1SBF20Eo1KJUZnJgg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K3s/0QizNHlmyX8twM1he7gWBn9vM3U2+C+31oZFztBhsAY4PbV/1ydBbdqBLxlCn gGLRsfwyJHxUWc2BITXIu8NsJJj0JdynsDEf2vQKH7Lknnv8XZ9QV1B4oqxZIIZwaw rD+JN9Ht7zPDRdI+zafNzkdxi2VP0ZREP+h4A/Bo= 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.10 155/215] drm/vc4: hdmi: Prevent clock unbalance Date: Thu, 15 Jul 2021 20:38:47 +0200 Message-Id: <20210715182626.903976297@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182558.381078833@linuxfoundation.org> References: <20210715182558.381078833@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 @@ -1807,6 +1807,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);