Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3696448pxb; Mon, 24 Jan 2022 15:37:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJzJK72iUj5JmsPhVgcN34NPwd2m1xUy4VAWx4KoRyLa1ui2lim2/kbPqSWjoG4uLVjDouZA X-Received: by 2002:a63:d417:: with SMTP id a23mr13268958pgh.297.1643067476281; Mon, 24 Jan 2022 15:37:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643067476; cv=none; d=google.com; s=arc-20160816; b=VfY4cVYbf/EFG0YWq/6P7XcRkwmX5qXaATSn1C0L5yYTHBlR4f+wXXfBiFNxoblZZX rQlb9w+gNSbluP1d+S77JdTdsfkGmLNGggI/3iiyExWVfDPkyBsh2CYRWewZ9oK9jgJl hbK/tVJ3ZcvrfctxsDVZkU6jKWx5emE8tegVLOEvDZYKnAgUJBuGvGhglv8HcfwN9kV7 0HTB+QxW0TU4TsN0tc0auVDllzUwheYQ768UEMYJPePN7O+2h1+/UQwFv8J1Sg5G9LD/ hnVAihDZxnCGqycRhql/HZ/+QGUx4SI5LWKa8IdBhkhJ/Ra63UT06zZufzDDJhCwhZ02 bJww== 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=FZ+6T8CKj36NYJ6HQzRaYKn+rQ2dZBQaaEE5f2Iy1I8=; b=nQDLHe2l9yq3ZgKBAzLPyvJUsK3BrJk+EvIbr/hF/tdke0fVqowTZ4mVs0tMdOdL1A nwR1+fjemrlqPUFr5Xb2R5l7qygmHFtXIeDBUM3hNxJzX5eRIhdzpiehY8hkifNcmGqm 22BFSsT4IrzlgoU6AXrIJ5yqzOIzqlTcL3qUhA5ZJi8frM2Yf+mLiK4RJT4sWx+m9xNl 738kRrjp+WUHt/OVFf+tsKwH4UQ3wPVGkIYOVtnepKwLm4c9+dosnHMLhaBfbVJHWDZO IoA/via3RCYFnWDs74OSMZmbnQFO2Ia89xOQU6QqPY9HK3hV19n5O7xJ9jiuQDeb++C4 K8mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=J3d3ETxx; 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 j14si13026973plr.553.2022.01.24.15.37.44; Mon, 24 Jan 2022 15:37:56 -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=J3d3ETxx; 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 S1849969AbiAXX1I (ORCPT + 99 others); Mon, 24 Jan 2022 18:27:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1588258AbiAXWbq (ORCPT ); Mon, 24 Jan 2022 17:31:46 -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 EBF19C095430; Mon, 24 Jan 2022 12:57:27 -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 89761612C8; Mon, 24 Jan 2022 20:57:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C986C340E8; Mon, 24 Jan 2022 20:57:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643057847; bh=TN6v4/4sN1+XYeIpKg4vF/SxBkB5QkaJ3j9sK91D2XA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J3d3ETxxwe94ITcip4+QmAbib9egIyrr7khkDSECqvwyDZ5EnQSz0JPq10Dh+jylE /xWWBcL5qxL8vomttAgAU7VkR1z5oudm0C+LLpaOWPxUQnRal16pUps8BK/YrxvwsW dbw3z7rBP71eunQKX+ndJAYpfesjROQZBoY7JSv0= 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.16 0099/1039] drm/vc4: hdmi: Make sure the controller is powered up during bind Date: Mon, 24 Jan 2022 19:31:28 +0100 Message-Id: <20220124184128.482138775@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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 f7e48bc6cb114..29ee9264b0870 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -2191,6 +2191,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); @@ -2202,8 +2214,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); @@ -2227,6 +2237,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: @@ -2237,6 +2249,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