From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC910C07E95 for ; Wed, 7 Jul 2021 09:23:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BA5C361CBD for ; Wed, 7 Jul 2021 09:23:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231464AbhGGJZt (ORCPT ); Wed, 7 Jul 2021 05:25:49 -0400 Received: from wnew2-smtp.messagingengine.com ([64.147.123.27]:44767 "EHLO wnew2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231317AbhGGJZs (ORCPT ); Wed, 7 Jul 2021 05:25:48 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.west.internal (Postfix) with ESMTP id 5480C2B0091E; Wed, 7 Jul 2021 05:23:07 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 07 Jul 2021 05:23:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=yPHveBCmazss3 HiqhL18dQubSdoqqYUXa13P7zvEQzM=; b=1p8PkATyxYJNVHFZ1auOw2oIpeJSh 7YMyPO1L3uNzu9k0k0/EgqEYNs6mxUcsMUYwEsVq9POiNYa/VaiAKfMAZyNPWV7Q bLvWdj4dtnb1vIj8gCsk3oRAgPlzsZHS5TaLaqpCVSQtprtpTRZ6Q1L/ho58rxHt CiWVWsJb9ecUsHgHpd2Z1SVN1Y5jmgylBsrTqMMHik2tLLDg+YJUJ/UE4gv7yP9l 4uW3cBgeNZ2guaMN/TBTQ5kLBCHf5Xr4+z7AHDGaILKHhFYtKYisekw/JN51aUS9 CQebNBym1Nx890I8xz3CtSYQKgJ8QAJ+nOB5Bj/qp6vzHQcW31vlOMyeQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=yPHveBCmazss3HiqhL18dQubSdoqqYUXa13P7zvEQzM=; b=wWQnZPtJ 4P+rhqosIPoGwD47tBa3JR77NnZvI9/Ruc8R+5wvZ1X0Pc843fukPPMg0QG3NkeN 6+WLIoTlIp/pOauP1FuySBG5HwIwJgMememClk0RYlwfI8RaWScnGGeWAyyovLt8 sPXXxCM3AY0Ciozqz3tydQqddcxNNZGEc3NKSf6/Hf1sACm82fxk9umn9dj0kM4N IEp8XvVe/ElY7MG8KB7lamx076dHJSfW9+/uAP/DXcMG6604h1zphcPDKhzPe8H2 kDmPiFUi4/HF3/JulsbhjfNf+EpSEN8bIu0BVRrysIMMD5JYwm7b1Sem1NHN3jI4 AWOi8ajnuY/gIw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrtddvgddugecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpedvkeelveefffekjefhffeuleetleefudeifeehuddugffghffhffehveevheeh vdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrg igihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 7 Jul 2021 05:23:04 -0400 (EDT) From: Maxime Ripard To: dri-devel@lists.freedesktop.org, Daniel Vetter , David Airlie , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard Cc: Maxime Ripard , Emma Anholt , Dave Stevenson , Boris Brezillon , Phil Elwell , Tim Gover , Dom Cobley , linux-rpi-kernel@lists.infradead.org, Nicolas Saenz Julienne , Hans Verkuil , linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com Subject: [PATCH v2 1/5] drm/vc4: hdmi: Make sure the controller is powered up during bind Date: Wed, 7 Jul 2021 11:22:53 +0200 Message-Id: <20210707092257.1465109-2-maxime@cerno.tech> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210707092257.1465109-1-maxime@cerno.tech> References: <20210707092257.1465109-1-maxime@cerno.tech> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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") Signed-off-by: Maxime Ripard --- 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 aab1b36ceb3c..dac47b100b8b 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -2176,6 +2176,18 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) vc4_hdmi->disable_4kp60 = true; } + /* + * 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); @@ -2187,8 +2199,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); @@ -2208,6 +2218,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: @@ -2216,6 +2228,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) 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.31.1