Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp599273pxb; Thu, 19 Aug 2021 07:03:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0Mka5f3XjATpcFgAizuRZWKadWX4yr0+WW0aVCKqmpQJLF5isQ+wPn5xLXbUe/29VWG2g X-Received: by 2002:a17:906:f190:: with SMTP id gs16mr16125271ejb.439.1629381783260; Thu, 19 Aug 2021 07:03:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629381783; cv=none; d=google.com; s=arc-20160816; b=wpcO44Kvnokjj5Yq6fY/PnoUsnwxKQsRnfHLjUa2ilkNJYWlZd9XNP3cSjTebh2aYn 2FzP2fxAwNcKqcF9PSyV+ZEBoX+iZiPT3asTAbSdhvcKJSr2h3LNDiGE9d5QoS+33kTU 9MeCngqOTCqh093aAxdz4bGP5C9rZYiSUcRKtCP+ImKZHO4zUQ1B+lKlFQbmO2FAQrij Lkv2Sf2q/As8pLgGSEwTm8tFSqihn3dGtSyXLvBtZ5txnLKnmqzUqkszKRspQya6Yt3T ZysqAZFUvstaAlcpiOI1Rk31uRG9FD5uoo7o/Z4EHUwb9MEcTTnIgEE8WiZ9hPAmZpIb ooWw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=AjzD4NCR+RXsI9pn023+m6EFCbk81Gsf49j9QMb7lOc=; b=Mi30DGGH2sbn7X4blh+VJLuwFimkgc6z327PqVGY9csWf3HPcGsWINQ24ICb1xAFl0 wFh6JiIrRd3mygFDxjwzpc8fxRdKKzXUfr5b9e7eYG4B5jLnaq33njLUSEsDCAIDfRyj GLkzIZyV19o1kVHH1Op1Y4rMye6WhTn+5qlgwvAmzzbYldxH1Fx0IgX9RS1pS5zOvlUX YLVj5CKcPobZO6Iw5r63YFcRiqorv0C+5WP1/a/peTP0uBpH2CQ/jB3HOFdDpAoMtMBE S3LWWWlYTbtcP1PuD2LDzH4MIhwEr83M738Qa1SxTqKZ30WS00SNg83QEd9bjBN1wi7M 8D3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b=hFQRMhok; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=WdiLVyPK; 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=cerno.tech Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b9si3397994ejv.423.2021.08.19.07.02.16; Thu, 19 Aug 2021 07:03:03 -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=@cerno.tech header.s=fm3 header.b=hFQRMhok; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=WdiLVyPK; 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=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240102AbhHSOAZ (ORCPT + 99 others); Thu, 19 Aug 2021 10:00:25 -0400 Received: from wnew3-smtp.messagingengine.com ([64.147.123.17]:51807 "EHLO wnew3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240428AbhHSOAX (ORCPT ); Thu, 19 Aug 2021 10:00:23 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.west.internal (Postfix) with ESMTP id D65B32B00560; Thu, 19 Aug 2021 09:59:45 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 19 Aug 2021 09:59:47 -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=AjzD4NCR+RXsI 9pn023+m6EFCbk81Gsf49j9QMb7lOc=; b=hFQRMhokJd5G9qjRa/TVC3PugbXW9 1oorXisFUfu/dgxzgqDFZmY9SM0qipsWHC25ojun2PXStGfO+PxyvEJX0yCKVzjy xvCNOXK08KRsMR/s3ZsjIXfeWBGEETK19YYtCXFQIOGyEosgdxzM/3TOokiniv68 RfZpFCMBsJIFHVkNEQz7OPC5ucqwIT9WKuIOBew7JspaVf+2WAAy6sAgv2lOhbyh v88VvYO072eyL+VDvZJx79mZcsmQp6Bjxkn+DYqXhkqUOC4jahlnj/MuuNlfvp+L tsEPoczh99lc+JJ+K6q9fpSmQkcJq+AoPfyaGDFptzkZcL3+dEX02d1RA== 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=AjzD4NCR+RXsI9pn023+m6EFCbk81Gsf49j9QMb7lOc=; b=WdiLVyPK L4XgKVqPfEcW/HfDs5NIEF2nVeW14IiwkN53j1wUJEe2okp9LF/ft3DOJjN285To 61egtdia/vgAHDhMFpHeSbN8UmFf+dI6CdFCOwLCZIymiygh6MPnIXdQb12aHtU9 vXEOihC47rTAsVUOGKW7Cscdr5p0J7nbVxlBYGuUzyiIG3lz7IglO+Eu1LT/p9VW FChl48+EXc7BCErrg835yGY/qoWGSSKYQiL/2SbrukupOCq5IyJVYhGP5RIBd4bG N9ogtTXB56JlCv5LfatTp9c4yBCy3uFRyMmYbTqChKU6mLCqBXFYO2qo2s9h04GI 1SEBHxghTGq1pA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrleejgdeilecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpedvkeelveefffekjefhffeuleetleefudeifeehuddugffghffhffehveevheeh vdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrg igihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Aug 2021 09:59:43 -0400 (EDT) From: Maxime Ripard To: dri-devel@lists.freedesktop.org, Daniel Vetter , David Airlie , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard Cc: linux-kernel@vger.kernel.org, Dave Stevenson , Phil Elwell , Tim Gover , Dom Cobley , Boris Brezillon , linux-rpi-kernel@lists.infradead.org, Hans Verkuil , bcm-kernel-feedback-list@broadcom.com, Emma Anholt , Nicolas Saenz Julienne , Maxime Ripard Subject: [PATCH v3 2/6] drm/vc4: hdmi: Make sure the controller is powered up during bind Date: Thu, 19 Aug 2021 15:59:27 +0200 Message-Id: <20210819135931.895976-3-maxime@cerno.tech> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210819135931.895976-1-maxime@cerno.tech> References: <20210819135931.895976-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") Reviewed-by: Dave Stevenson 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 602203b2d8e1..5dde3e5c1d7f 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) 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); @@ -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); @@ -2223,6 +2233,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: @@ -2231,6 +2243,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