From patchwork Wed Sep 22 12:54:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12510631 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.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 A154FC433F5 for ; Wed, 22 Sep 2021 13:04:02 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6D4FA611C0 for ; Wed, 22 Sep 2021 13:04:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6D4FA611C0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uJTjLssgvtvkRDsOpE5Z8p2hK59PQIgtu9pJhWsP2f8=; b=fW6fopMcg7JO0p wMcdDsLsqlmeAhjhKY/mT0ACubF16ApD1cbjPqVphsS76sw2OvmOxlg9NrHUZiR0i1IcsomZ/Qhh4 o9D2NuotnMzhkgHORo3t7x9ASTFc74Y43UxI6017QzyH4zho0aUeYAY43cm1nO6Fts9nbNhsUJ1EM bAxDiGqeSjH/Mr7Rs60lVe4rDqFPEMFVjIDqnAJUmeLbxUX9WuahisFQYxNUUcIa1OPT41Wx2UOHA 7IdJ6bcxL6dkRMYs7Dxzp/O6wJi/9yPW0sXJGi7h7OCUv4rX3GvOZWYAWgHX5VN23PB9qJkOWdFan QzxbagvaE5kLxEI6eJUg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mT1sq-008Uwa-8A; Wed, 22 Sep 2021 13:01:57 +0000 Received: from wnew3-smtp.messagingengine.com ([64.147.123.17]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mT1lr-008SEF-Q6; Wed, 22 Sep 2021 12:54:45 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.west.internal (Postfix) with ESMTP id 61D722B015E3; Wed, 22 Sep 2021 08:54:42 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 22 Sep 2021 08:54:43 -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=/i2wIOW8fG63Q +xqJpbK2PRWLCguAPaHH1zfAMA+Z2g=; b=et5KajvVXSLjYc0w39FhVvyrcYBuf 2CpC9e58Ine7wjkWb9o2lPvQlsnxhsy4naoRM3rX3VuGF03V7rW9P5+uKV9bf7X8 ZvgRwxuYEX10jEX1i60jDIxX40sLdXyQNdqHWGacnv8k9An4coIPmM4QlFVSjnU4 khWug5WBYCzBDYeWCoY1eSPUkCqooB2Qry2mBzaK9LZRI14TfFxLDBpPmHjJIFP9 xwwbulmQhQwLnXAMiavnnGlmPThsEdOBFMm4qw3xGHzuJmfkBdHUtMco2Fd7SgSv jNnteCch2lfmS7DW5ZP0W0C1YOTfapVkKDTnwzFcHl4yvpWc5Vu5LeM+Q== 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=/i2wIOW8fG63Q+xqJpbK2PRWLCguAPaHH1zfAMA+Z2g=; b=qWbANZJB KvPmz172JXRBJQPkJJVfpzxMpMlcz7++0tcme5yY/YSV95ixoA+xfI29zqFGyiZR l523IzmZ2Y/XvLF7N8bGjqfa6OD25aywEKAYC+UHRQ8iGAQ7uAdJUzOm+44Yy1ab o7+SWyJDXbEDQslvCs82e27yy+0+zAciYwU0EDlnZS9OwM2SZ9IQlOFWdZdUfl1V seDAEA2U5OULoaGZ2EQfJrSvSjdaVWRkBHt9jPtGKZVTGWdL1iiRZPZKqIX4lVzs nsLaOnFcMRqKRwF+h63P9OcLlw1NoobBwO3wf4uuI+Z017RHC9FbzSAcMpXDfYDt X2i10U+t95/8aQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudeijedgheejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepvdekleevfeffkeejhfffueelteelfeduieefheduudfggffhhfffheevveeh hedvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmh grgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 22 Sep 2021 08:54:41 -0400 (EDT) From: Maxime Ripard To: Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Daniel Vetter , David Airlie Cc: linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, Mike Turquette , Stephen Boyd , Nicolas Saenz Julienne , Florian Fainelli , Michael Stapelberg , Linus Torvalds , Dave Stevenson Subject: [PATCH 5/5] drm/vc4: hdmi: Make sure the controller is powered in detect Date: Wed, 22 Sep 2021 14:54:19 +0200 Message-Id: <20210922125419.4125779-6-maxime@cerno.tech> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210922125419.4125779-1-maxime@cerno.tech> References: <20210922125419.4125779-1-maxime@cerno.tech> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210922_055443_958046_1D0EBB83 X-CRM114-Status: GOOD ( 10.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org If the HPD GPIO is not available and drm_probe_ddc fails, we end up reading the HDMI_HOTPLUG register, but the controller might be powered off resulting in a CPU hang. Make sure we have the power domain and the HSM clock powered during the detect cycle to prevent the hang from happening. Fixes: 4f6e3d66ac52 ("drm/vc4: Add runtime PM support to the HDMI encoder driver") Signed-off-by: Maxime Ripard Reviewed-by: Dave Stevenson Reviewed-by: Nicolas Saenz Julienne Tested-by: Nicolas Saenz Julienne --- drivers/gpu/drm/vc4/vc4_hdmi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 630b84ab73a2..8e6d7e1af200 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -168,6 +168,8 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector); bool connected = false; + WARN_ON(pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev)); + if (vc4_hdmi->hpd_gpio && gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio)) { connected = true; @@ -188,10 +190,12 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) } } + pm_runtime_put(&vc4_hdmi->pdev->dev); return connector_status_connected; } cec_phys_addr_invalidate(vc4_hdmi->cec_adap); + pm_runtime_put(&vc4_hdmi->pdev->dev); return connector_status_disconnected; }