Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1403908pxj; Fri, 21 May 2021 13:25:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMLqYVJys23z3t5M1QsDTRO9ACxlhFJLG2yGSSdcfGEFyKUwF4cx1LAH3i7KKzDiky8pnK X-Received: by 2002:a05:6e02:1348:: with SMTP id k8mr697286ilr.104.1621628728137; Fri, 21 May 2021 13:25:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621628728; cv=none; d=google.com; s=arc-20160816; b=P4GWyKKU2J7q5p/Dxb1EOZHEthc8Vkj6BLwJiaLdJ25iguBWsCG7AVN0GYc545j5h3 QpqVF/o9w1DsQ1WTQajEVG6aiRpVrpct9BGluJeNEnSFYdNqKa/M9WOI5MnZMozkFhLq QiYhjnaxvZfRwijIzHgzUKDnT8+9uPQw0M6Egtwl4gJ2x/6jPISpOgTcXkMlKUq8OimF NYRafhdnYIy7DJnG0gvEyT/U7g+uRV4yumGxjO3zS+MCgIG71v5CZmNASB3nsRp0s95e OgZDYoq+DUfseudnozZDK8zGRvhDiGztviuShSAYgInnmp/V6T/BjGiO4vgOLqOGlId1 +W8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=D5LwmNVFsSfy6EyRs7Ealr4gzA97VJM1KuOHtzH0Li0=; b=UJGaDDPVV4CbVMrsWLzGnN3pksKBrx4LY97BB9A7uA5nLR1IADFCk5+ltpfJ0ASqmn i8Ag17yradq7qLljOosX/651VXaAymFR1iz9T9LG34V87e8A+kkX+2mjK1Ez+I/jek5h 9G9DTQZxuv6yAuBK8OfCQLIH6F0Mak0XMVcV053yohmW7nSRwRM0p4SFOLtr5HJqTqkn LqwdifYHHWd6socW6RGD6H+kWfGqBWxZaFY0fgCl0cNoiB77CAJz6icbzpq0rrikkKDa 0gbZ2JOtr+OXfvc0n9bUyy+QK9nmqVRm4AtjD2ov5HguOLbwEM4evCj6uIxMENjsQYPE KTcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@raspberrypi.com header.s=google header.b=VE0HakH5; 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=raspberrypi.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d1si7608308ilg.93.2021.05.21.13.25.15; Fri, 21 May 2021 13:25:28 -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=@raspberrypi.com header.s=google header.b=VE0HakH5; 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=raspberrypi.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236324AbhEUSHf (ORCPT + 99 others); Fri, 21 May 2021 14:07:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234740AbhEUSHf (ORCPT ); Fri, 21 May 2021 14:07:35 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77CC9C061574 for ; Fri, 21 May 2021 11:06:11 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id d11so21877266wrw.8 for ; Fri, 21 May 2021 11:06:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=D5LwmNVFsSfy6EyRs7Ealr4gzA97VJM1KuOHtzH0Li0=; b=VE0HakH5HjuuQJKCxvKI5+8hyL5a8G9LX7e9Rjffwcw2UeJqvG6j3fhS10puSV5X73 CzlMG7QORuLeT3EXZg9T8bZIkO8xrHlT2wpEP4OnnbJoc0oPrrWSgA+q5wH7tZAkEPEI Teb+xPMKbuRZkdkwfW3WTLZWr+hC8Q5tG1i79mkvCsjSMt5yoou1NHoE53Ch4NCuv4bJ +eZyR5P+TZLyyHfG5boD/jGH6HdO+Uw2wRoiFdKyjn2X1cUuY6cUb03Zuh4aOh9ZjjYt 76J1DYOvCEVREhQe7M3CagXt/C7/CwqijicoI/cX4WWJ0ntUZpy1nIbU0CQ6TkW/E9k7 8wYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=D5LwmNVFsSfy6EyRs7Ealr4gzA97VJM1KuOHtzH0Li0=; b=DDYQnRWDLZ9UwXW8txUfvm34njqDVVhm8zRiwFLCmbl9rSXwrqjB2ptJlf+ohoiMQ0 MmnaR2aSHc38GG1J6OcwHJbsvB3KjRAq2zU3bLR8u+5gzVa36nz3j0ctRYTsN6DNG8tG PjU48KH39MQ9p3ULb2uafc5ivyr8/89+YdYMS9+tWd3K0sy9Rq+dIZdDyHCbZ0W099EZ IlSK/6OERj4XqLY09wLDGXOppzImzM8jxfPukmk3L/MI1AX+u5qaZv6RDMgc9pDWPY5X eYFRiesHWnBRn6KX/F15egUzn+faldjTKDHp5lIh932aJWHK2VNGIbaQgLWgkwTQbw9Z eWig== X-Gm-Message-State: AOAM533o8078uGDbQVVG1ll87PjWdHkGC1XKBl2qrO0mara4c95pgIKo 7kA1e9MPzCj8uZ1rutH5W7PG9j3DAuh7rxcaG8tq8g== X-Received: by 2002:a5d:4351:: with SMTP id u17mr10693936wrr.47.1621620370129; Fri, 21 May 2021 11:06:10 -0700 (PDT) MIME-Version: 1.0 References: <20210507150515.257424-1-maxime@cerno.tech> <20210507150515.257424-7-maxime@cerno.tech> In-Reply-To: <20210507150515.257424-7-maxime@cerno.tech> From: Dave Stevenson Date: Fri, 21 May 2021 19:05:53 +0100 Message-ID: Subject: Re: [PATCH v4 06/12] drm/vc4: hdmi: Prevent clock unbalance To: Maxime Ripard Cc: Maarten Lankhorst , Thomas Zimmermann , DRI Development , Daniel Vetter , David Airlie , Eric Anholt , Nicolas Saenz Julienne , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, Phil Elwell , Tim Gover , Dom Cobley , LKML , stable@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 7 May 2021 at 16:05, Maxime Ripard wrote: > > 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 > --- > drivers/gpu/drm/vc4/vc4_hdmi.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c > index 1fda574579af..9c919472ae84 100644 > --- a/drivers/gpu/drm/vc4/vc4_hdmi.c > +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c > @@ -1995,6 +1995,14 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) > 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); > -- > 2.31.1 >