Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp710255pxv; Thu, 15 Jul 2021 14:07:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAKYoCvKbL7rYhthJ9qq24I2kFLGfqCz1HMr5XeaDRy1Hmx7YZx1nmmbwhnDmV0MVQruZz X-Received: by 2002:a17:906:4e09:: with SMTP id z9mr1754543eju.226.1626383253061; Thu, 15 Jul 2021 14:07:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626383253; cv=none; d=google.com; s=arc-20160816; b=uL33f/UDGnOpinGSOh3YtIhdIVKptoJF3gIUX7PnkC9i9a3RT6QzJYMj+eDsyzL/fw jZ3NJJAqsgpOtJ4mwpGxzkRNy1f1ZTBTV4T9terWMJvCr1V55aQdJH/aNjj6ObmZuk7H uKIwbzFnngRV1HrRyAH7D+JZPUXVkNqP1QeuaDD5zepWxhIpf45Ngl+ACMqwaf6ujlgg mfFdUddGTPrLenohk08aJS0Zl8fhZpjV7hFn0c9Xllozjq3NLCwCRowaBwmvjEkSmtcn rCWkqtVLOdqWrEgHHzlTcDOHoGARn1G+kicL3mEpVv+nJLvNje89iszpn0uAy+ZRsXxX b4aA== 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=mFzzEVuJ23v8o2Hww00EHWdLEvt4qpJvzvYynPkkqgXNd+Z5HeANJa9hwIEXw7N3Om 1FoQkPM/jyK5MlTO50fpSQ+nunjG9fDvFi3v+hr/Lee+Hlejm1gFuUG++LIg3vxGrWNu CjP6S++0rj77skIMxxbstq2i20r/QKAhAO1WoOerrjt5QPXDSXmmlvh9Bk1MB0adhbqn twq+wBLxucJciufPD+gEpsWV1NVnh34h4BlgSkSbDTOg4cnm6lq2ooe8lrl2CGAmwREy S2piOqZtrC12nJSuQYgiBhVZf8QS9riXxwZNAXxC3LuGTmWRyX2T0hjjoWWfjIKOeHh1 VhKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vDADvKUl; 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 bl4si9460055ejb.689.2021.07.15.14.07.08; Thu, 15 Jul 2021 14:07:33 -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=vDADvKUl; 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 S245027AbhGOTTM (ORCPT + 99 others); Thu, 15 Jul 2021 15:19:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:38430 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243681AbhGOTEi (ORCPT ); Thu, 15 Jul 2021 15:04:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B276161404; Thu, 15 Jul 2021 19:00:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375631; bh=AykE/DNX1ohxHWrctLld96qWYnNgwrQLNEkWEleFwec=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vDADvKUlvuDW/1gREkyEoPWIQ/1OLbqur+YVxKypVaZiE9i4S8xdyd8qkML8eRWi5 jp5yBe2a+Bu2i27HHfq83xmoFHATa2fneEgpYfb6jC1EznvXrq1lgtpRHKDP2ysQ3c qJKpA/WjcLFoevcmD/AJYKrij23c0qdtZTAfs9kY= 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.12 170/242] drm/vc4: hdmi: Prevent clock unbalance Date: Thu, 15 Jul 2021 20:38:52 +0200 Message-Id: <20210715182623.159968385@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182551.731989182@linuxfoundation.org> References: <20210715182551.731989182@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);