Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3635521pxb; Mon, 24 Jan 2022 14:04:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJwkPrAOWmyu7ct5eu4QRTESq+y/yt0XIEun2WuaY6Tw/ynqnmIw4RT8FLiJ7sOt+1VsLbME X-Received: by 2002:a17:902:f54b:b0:14b:1651:58ca with SMTP id h11-20020a170902f54b00b0014b165158camr16524786plf.58.1643061865265; Mon, 24 Jan 2022 14:04:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643061865; cv=none; d=google.com; s=arc-20160816; b=mynmenYYpvKmFqrd3wSztRKHxcZMD4lGOeWvdsnLPoz45QaNAV5rNufLRE9igrEFk4 HZrh+72kbW06/akHeJJiwd6k2CBvvLx4r3GUGbbRJH9LgqNQVeWeeE2mJv50k6Uu/PQU qinx+0FK8bZIth8e1HUcniXP9+r972wHntvhuiSOtdTSWwnPe3WzLpQqIuZYKQYNfa4K 6zEbWlljYP0HzfecC2867IXouiBoVKf8MZDqpIQUplZuFyXIBBK5kp3oLjdqwJWN2HYp 5IH5bU0Q1QrbcF+0H4E9UPFII3aKmXsets0vmf6ZVdZELpANPIfgk2CKexJBoZgc1Fpw tI1g== 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=iHoC46lSF5h8pTgBwfl0ufcixd9GyuTxZOujoMfIACo=; b=CjE65VNodGIv+ipyG3m5RnxvAVsFb26CVS5BMVml1z7WejsrGPOYhk/jLKMDoy+z1t bxDT99de4RDof4j5VBc2YkTpan52H5PpqzwEObWc3OjJIFi6D/npYUNqhTD4F8eoKrJi lx1SR2VdZuGvwoABsNZae56N0s2ewGyfgd/LrfhRyYPsYfc6looezfeGBPpSAislkvsv jWm48XVjPcRjASzAt2tkU5nDuBHFkYXQGF510Vx4TkiSfR7fYm2RecIYJIbOWk4X6eFS YpqIqYxfX6sgP7t6m1Z5mya7ZGJdblLh6pPI3kXfUDLA3+naAGJcb6ezyWOVa8WduDRS IXYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZpuEkGrb; 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 g15si7688324pgk.863.2022.01.24.14.04.11; Mon, 24 Jan 2022 14:04:25 -0800 (PST) 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=ZpuEkGrb; 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 S1576267AbiAXVxN (ORCPT + 99 others); Mon, 24 Jan 2022 16:53:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1450594AbiAXVVC (ORCPT ); Mon, 24 Jan 2022 16:21:02 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60B5BC028C21; Mon, 24 Jan 2022 12:14:16 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 02D97614BC; Mon, 24 Jan 2022 20:14:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CEF56C340EA; Mon, 24 Jan 2022 20:14:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643055255; bh=ZbJT9W9fZr4z12eRgoKUPTfiGaT2XM8p7hVz5O2s63A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZpuEkGrbYvJ0+ZqLoM+AbsXa5HB8UsckAWDvQ9uN2Xi9SqCcg2L82U14BPBjsc6tE 2S+N32pQup51HWVTrrIj+r8QlPGeiulbQFKTJOgxbU36szsRyzppoxTDIXpztQ1w3U Fwk2H69pUiEMUJTkJ2328761d7Rs+uw/cIh47jzQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dave Stevenson , Maxime Ripard , Sasha Levin Subject: [PATCH 5.15 092/846] drm/vc4: hdmi: Make sure the controller is powered up during bind Date: Mon, 24 Jan 2022 19:33:29 +0100 Message-Id: <20220124184104.165167084@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@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 [ Upstream commit 9c6e4f6ed1d61d5f46946e5c151ceb279eedadb1 ] In the bind hook, we actually need the device to have the HSM clock running during the final part of the display initialisation where we reset the controller and initialise the CEC component. Failing to do so will result in a complete, silent, hang of the CPU. Fixes: 411efa18e4b0 ("drm/vc4: hdmi: Move the HSM clock enable to runtime_pm") Link: https://patchwork.freedesktop.org/patch/msgid/20210819135931.895976-3-maxime@cerno.tech Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard Signed-off-by: Sasha Levin --- drivers/gpu/drm/vc4/vc4_hdmi.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 21510ae31a9ec..2087717f1cce9 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -2190,6 +2190,18 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) if (ret) goto err_put_ddc; + /* + * We need to have the device powered up at this point to call + * our reset hook and for the CEC init. + */ + ret = vc4_hdmi_runtime_resume(dev); + if (ret) + goto err_put_ddc; + + pm_runtime_get_noresume(dev); + pm_runtime_set_active(dev); + pm_runtime_enable(dev); + if (vc4_hdmi->variant->reset) vc4_hdmi->variant->reset(vc4_hdmi); @@ -2201,8 +2213,6 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) clk_prepare_enable(vc4_hdmi->pixel_bvb_clock); } - pm_runtime_enable(dev); - drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_TMDS); drm_encoder_helper_add(encoder, &vc4_hdmi_encoder_helper_funcs); @@ -2226,6 +2236,8 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) vc4_hdmi_debugfs_regs, vc4_hdmi); + pm_runtime_put_sync(dev); + return 0; err_free_cec: @@ -2236,6 +2248,7 @@ err_destroy_conn: vc4_hdmi_connector_destroy(&vc4_hdmi->connector); err_destroy_encoder: drm_encoder_cleanup(encoder); + pm_runtime_put_sync(dev); pm_runtime_disable(dev); err_put_ddc: put_device(&vc4_hdmi->ddc->dev); -- 2.34.1