Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3690753pxb; Mon, 24 Jan 2022 15:28:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJymTNyJvtW5aKhhKw7zfbD6td4lDT20hP7/SCrgDG30xQ8P1Y5KZRXRf5K/jShIPqSN0vm8 X-Received: by 2002:a17:90a:aa95:: with SMTP id l21mr631103pjq.207.1643066928203; Mon, 24 Jan 2022 15:28:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643066928; cv=none; d=google.com; s=arc-20160816; b=jcCqS7838U2lIwwTJloy9jibl3enUAHhMLYXHq1YNLEp0QEwv407fzklYS54OEuBsM I0qRYcDRLfn0eotGr7/jWUjqLGhHJbjBvrHelOjqsZeEk17btuJVsafaSniiOYzVXO/7 1R1RJT1JJL4IcBaL93VPw76/Kmzg1EYR8REAmxy/iknyGiShEaWWl3w2yGC3XgcSuq6T Y2LbcZxXl2RnnZlRT/sKFHdCmQloh8lery7+awSZb1yUS4+4QdC6YgWeJG/qIn4jeUPF 28cr8h38iewUGVNTviKB9kEG8nIXfr8w9FUWx9uw1NK6BRZpMwOZOvAsqRdQslDwGxQ7 naWA== 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=v3CEIUp7iLmqbKOkrnFO3SQv44iA18qY6KA4LSxoJJY=; b=yRlYRbj9ibrA20StZzooml7f16FVSnAG3Q0HR+KbOsc60MP5MH+ZiNmMiN/LcvkUf4 KFe0ozcsZtERPzSBQDxNOFQXCfsgObOSE5wlye4uEH55JXiQFINMprjstXlPrp1psBuw 9eV10v0AWeuwskDsj3qYyYZfqqIOekqCT9/yZa6rauAS7DjBaY/EPlMkUjaC77oDT4rd H0QjpD2SB8/8SFIvrr9mT0Z+u+/zB174xYf9McB62aFy8qUJk0pduMRHeV4g4WUNc1yq lJAKKxLzdVNC4LK7KsLXxd182J1NMh4whg9BBH/XVZ12kkd7KbkOJ/c7V5WTe7LEo/0g Czmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CXHMFvTH; 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 j6si8412677plx.191.2022.01.24.15.28.36; Mon, 24 Jan 2022 15:28:48 -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=CXHMFvTH; 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 S1848636AbiAXXW4 (ORCPT + 99 others); Mon, 24 Jan 2022 18:22:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1588256AbiAXWbq (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 025C8C09542D; Mon, 24 Jan 2022 12:57:25 -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 9382B611ED; Mon, 24 Jan 2022 20:57:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B3EBC340E5; Mon, 24 Jan 2022 20:57:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643057844; bh=V42/D9J+eVOms8WP+nFToDm5/whPS2Hd3Bz6n2GX7uI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CXHMFvTHcPvsy0y/bM1ORmceXuXo9WapkfJA9XE0FApJTiWzP4kKgA+uOR+zQQX6q 4KRzU6SkqWAzbTb/sEo4VVvq1akmEQIVdeKndljEpcdMM+/LHB610lqdonZDovHwL1 1qBqXlONe2SKibwEJkGhc3KqkBM8v6rcfvt1LsjQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maxime Ripard , Dave Stevenson , Nicolas Saenz Julienne , Michael Stapelberg , Sasha Levin Subject: [PATCH 5.16 0098/1039] drm/vc4: hdmi: Make sure the controller is powered in detect Date: Mon, 24 Jan 2022 19:31:27 +0100 Message-Id: <20220124184128.449490958@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 0f5251339eda7f7eb7bd4467607ae1d01b24e129 ] 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 Tested-by: Michael Stapelberg Link: https://patchwork.freedesktop.org/patch/msgid/20210922125419.4125779-6-maxime@cerno.tech Signed-off-by: Sasha Levin --- 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 63b07087d37e8..f7e48bc6cb114 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; } -- 2.34.1