Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4227332pxj; Tue, 25 May 2021 03:16:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCbKeHmkiIa/G2jfFlqKTv5imlQZPYaKCJS2BrNMnuoHcqEEA/TxTX6KD80vZ50V9cHDKP X-Received: by 2002:a5e:9e4a:: with SMTP id j10mr20171678ioq.52.1621937769408; Tue, 25 May 2021 03:16:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621937769; cv=none; d=google.com; s=arc-20160816; b=n5B5VblraT1JWGGf7RwVbTHTQa7wPCHmZCqpQrb3zrPoilgYGYDchtDXbwuv4kEqTC xpFjyRKbFJTnnNNNsQU7nru2EHE5xlKg2FIN/GPwUk3vMBsyMs/RQnJlqFeZN6RXcXxD wSXhsC9m7IW/EAyIyP8bwhpWOZUK9lBkgbxLcvV9HAuCutU09kYz6swBS9NLSUtq0Ebl hVn96mcwmYdWS0kymlTkEIAIQR+uHouUEYW/NZqyUg/USvHuncu3oWyF8DHe3JQxJ2O5 d40GD+QHqq31n22xeTl9Oj85UXYQ4gdVJXLAmbo4CJW3N+zmTZuy7odch7GG5f7DeHPi GCeg== 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=wP0jl4KlEN32LvnqGPt1Hnbbz7tRZrPWgnwL8nfmbWw=; b=s+yxOan+UhOoZKFES975hZfXQd6arezTdWcGMKjAgu1P6EK4EbdZRZCzAZBXDDjxVG seGOOiGIdj2DsHiq3SZYbMB6vAGgNWrhnVQUVD+vj4LZWJoxCVenEWsAZkwybCk9UsyF uKY0iu0L7XqoeoY374C8Q63BsM77Jx3omFZp7VBoWqGOuQbsJNVu1S0OBgyH6fO1ml7Y fVFR5WlYTJnOGQ1hDscfHWpoChBM1M4WqNgO8GuutTa2ULnaaUjHb1IrhJhG43d7Moa8 H07TF/czTYqErd+nqebo1dy72zSSzwA1QRVtVod5/fUYib96yWaT2BO89MSXJg3G7gIa fJmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm2 header.b=PR+k1p8o; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=FaJaliG5; 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 w8si15574236iou.72.2021.05.25.03.15.55; Tue, 25 May 2021 03:16:09 -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=fm2 header.b=PR+k1p8o; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=FaJaliG5; 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 S232381AbhEYJM6 (ORCPT + 99 others); Tue, 25 May 2021 05:12:58 -0400 Received: from wnew2-smtp.messagingengine.com ([64.147.123.27]:37801 "EHLO wnew2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232409AbhEYJMq (ORCPT ); Tue, 25 May 2021 05:12:46 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.west.internal (Postfix) with ESMTP id 79C9DD3C; Tue, 25 May 2021 05:11:15 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Tue, 25 May 2021 05:11:16 -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=fm2; bh=wP0jl4KlEN32L vnqGPt1Hnbbz7tRZrPWgnwL8nfmbWw=; b=PR+k1p8obfXp464V47PmmciELKDWk v79jXB5j6JgqBpaJErdwCbMwIy1EXUvgjr6jamNjXbUBKpYBKRHUlvAuXcvXD3vV YBy1Upg7CrnSL5osU+0Llc5wpkS4MHdHpbId/CGltzuaAygaDsgCfNm3Xk2aJKHz mXDi7iTwLgdlJt8i9gyt+dTm02b/kfyHFDcVFAHhtkOQQmpCIfxv0/pF9TJ4pWAV d/R7xmClbvXsNGXRimfzVtzFc9ZO1vsteJc0ZBaN2K9FTPfZYSZ7bOY2rs7/iscc D/7lFWrF0z6ZaD+xj3i4xCZ3W7Db4lmSX7Tb/8vW+S/lDXc0IOSaILvNg== 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= fm2; bh=wP0jl4KlEN32LvnqGPt1Hnbbz7tRZrPWgnwL8nfmbWw=; b=FaJaliG5 dcGxiKFue3W4UTbstltzVT1skrWaahkYUE+di0K5CrYRX3BRXd3nnatsorzxmtcp 6vgRS++8BjPV3F9LhR4LzWvtcS8nfpXjBZwGKdqJvOq2V51ovsP3xnau+85DauEJ zTiaN/XcKXRxvOYYqF3QoEHqZlCQt2qQat5PT7qtAH5icXzToU2P4Rdh5wRBWNGU E0FEDn3iNaU78TA2OIEQ1AlwkBU9Fxr9pkRxUkVhlOYPmnRbPaQ8dqrMfUe1/cQc g3zHT22rt1+4QBcTWEhpOncGnU/+22Ix3O4iMu+qroB4sFil04h4kwIB8VNvaq7R QgLPmXxlf7MrzQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdekuddgudefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepvdekleevfeffkeejhfffueelteelfeduieefheduudfggffhhfffheevveeh hedvnecukfhppeeltddrkeelrdeikedrjeeinecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 25 May 2021 05:11:14 -0400 (EDT) From: Maxime Ripard To: dri-devel@lists.freedesktop.org, Daniel Vetter , David Airlie , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard Cc: Daniel Vetter , Boris Brezillon , linux-kernel@vger.kernel.org, Eric Anholt , Emma Anholt , Dave Stevenson , Phil Elwell , Tim Gover , Dom Cobley , Maxime Ripard Subject: [PATCH 3/3] drm/vc4: hdmi: Make sure the controller is powered in detect Date: Tue, 25 May 2021 11:10:59 +0200 Message-Id: <20210525091059.234116-4-maxime@cerno.tech> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210525091059.234116-1-maxime@cerno.tech> References: <20210525091059.234116-1-maxime@cerno.tech> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 --- 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 867009a471e1..4b6857467e58 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -166,6 +166,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) { if (gpio_get_value_cansleep(vc4_hdmi->hpd_gpio) ^ vc4_hdmi->hpd_active_low) @@ -187,10 +189,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; } -- 2.31.1