From patchwork Sun Jun 30 15:36:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13717159 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8181CC3064D for ; Sun, 30 Jun 2024 15:37:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7B43010E295; Sun, 30 Jun 2024 15:37:48 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; secure) header.d=gmx.net header.i=wahrenst@gmx.net header.b="fVdknZ5m"; dkim-atps=neutral Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 01D0A10E298 for ; Sun, 30 Jun 2024 15:37:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1719761843; x=1720366643; i=wahrenst@gmx.net; bh=jR2qUoYJWjo62ss14f32ABLuwKjco/WEcCrvFX1iwUQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=fVdknZ5mjA66HYdyBZ1DkGQaXT1SWXB65A7CaQGtGJCzBR3QToSHQr5r5B09qGYt G8/Po3Lt0aO6l54ZSXR+GYw8CNwgdWQ15sOcBRGnkvUULa5JXF0fUUFn+ztWmP32Q I96YP5NZoVEc5zi8sEcxwRidcCTyA63bethzXNmlmI++nnzxYAGvyLzYSOt5O66M8 rgVH6dap01enPILApRp5myHV42WB1+uWMkpiewrDSHAVMh9Q+zLenIA3zkOS9wi6K pll2eFx9a+L3JWpZVtp/4xSMG8eLecAaCm2FrBulde/nDfXTPi7thiRAaf96r22BK J62yRkV/D6ZFmn6R+w== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M6Ue3-1sUF4c2wHZ-008jJu; Sun, 30 Jun 2024 17:37:23 +0200 From: Stefan Wahren To: Greg Kroah-Hartman , Florian Fainelli , Ray Jui , Scott Branden , Maxime Ripard , Thomas Gleixner , Jassi Brar , Ulf Hansson , Jiri Slaby , Minas Harutyunyan Cc: Dave Stevenson , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Lukas Wunner , Peter Robinson , dri-devel@lists.freedesktop.org, bcm-kernel-feedback-list@broadcom.com, linux-pm@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-list@raspberrypi.com, Stefan Wahren Subject: [PATCH 07/11] drm/vc4: hdmi: Disable connector status polling during suspend Date: Sun, 30 Jun 2024 17:36:48 +0200 Message-Id: <20240630153652.318882-8-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240630153652.318882-1-wahrenst@gmx.net> References: <20240630153652.318882-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:16Ngb9tSxp2iZwHbx5dqk16AQEKX8kLcRlkqIw9cY3Qs9QzfZno XUBl7sn846cccKtsEHGyLm7q5kzaqH90IJ8JhAqcwRSCXHyTQ/DrwFhPNE5q3XMfEO9LpX4 UqsN5Ie+oAMtdG/IpeKtp5/GiHPbugvdU8ZZkjpvdkZcCfLb8CqLsZD2odXAP2AzNekfdOR W55XynRw/dHEi6zCgg2FA== UI-OutboundReport: notjunk:1;M01:P0:75eQMN8yRdA=;haDMuV5WnSJ3HWguPxybuI47jn1 e4lnr87wp77Gm16QAmleCGaZxLNO8UADI6b+3GHMbw8T70H8BaaETJzGOYaSEumgQ1zAyPBHp whCKx3IaXlR99Jto1W+YBWWMoM3+gB/0CnPOGYWUvQVbCKpCPcLGkXHzoiCBnTJ8VfYyj1vOR nEFO2xKx/UB1QjUcOpBYYDPs5uQ46ufs/WEWzoVr+sJer6FHSisICR4k0aXz0YXM9ltGhm3i4 VUaupQ7XCkMHi77rpWLTFw4ZDtMt0sdQuCVH+FcWqzLSFGzidhUBg0Z9PCZw1qgsVHXo3eJsa ehOxUR4RsD7LK2DhS/HWQLfU/EYAlZRN2rqMoc/79LEGhlD38XK7QYhDLrDxZEhC4236NFFHU vQm3dqi9zkQVh6u7OWqD1lacC2Pn1n+mKANxv1oid7QjuP9QKceGByCyOHbzvHMa2bfTeToNM Ya1YjdXYiZb5supX0l4tWBuzEI5nKm419FkiGDVzYYLSsHvNI4hJQ+M6u0mwzmf/FUlzszXML 0q3ETBjs93rhiom3cv5s8OoWtHuT0IwJ2pnNMZfii+2uRvNeYZvKbsf4oVmG41A6yqU0U/vcn vy0JDfubHvUehe9EKHSXPPPBlhJbBFQjWz6YFk8fujUbLOnl+fnYR4GtPf0wIDEKDGyxfyvb/ NIhztcr86voQaj6e4oxNaTwfZvL7XizyCUsr7pnxGgcJ6ZlhorN2/YvuiYocNpWMpHGtUiCLb OQFqSCezyx/m2r67/6HWhfzcgML/FhOXYig2GJmsnjdyIK4+h9yjWKA95tnRAaUXQvmNuNRL+ Tg1HaAqYr3KYh3d5ChmNnibKOufTBfrq1wbwJKba4o7qQ= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Suspend of VC4 HDMI will likely triggers a warning from vc4_hdmi_connector_detect_ctx() during poll of connector status. The power management will prevent the resume and keep the relevant power domain disabled. Since there is no reason to poll the connector status during suspend, the polling should be disabled during this. It not possible to use drm_mode_config_helper_suspend() here, because the callbacks might be called during bind phase and not all components are fully initialized. Link: https://lore.kernel.org/dri-devel/7003512d-7303-4f41-b0d6-a8af5bf8e497@gmx.net/ Signed-off-by: Stefan Wahren --- drivers/gpu/drm/vc4/vc4_hdmi.c | 11 +++++++++++ 1 file changed, 11 insertions(+) -- 2.34.1 diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index b3a42b709718..e80495cea6ac 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -3106,6 +3106,13 @@ static int vc5_hdmi_init_resources(struct drm_device *drm, static int vc4_hdmi_runtime_suspend(struct device *dev) { struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev); + struct drm_device *drm = vc4_hdmi->connector.dev; + + /* + * Don't disable polling if it was never initialized + */ + if (drm && drm->mode_config.poll_enabled) + drm_kms_helper_poll_disable(drm); clk_disable_unprepare(vc4_hdmi->hsm_clock); @@ -3115,6 +3122,7 @@ static int vc4_hdmi_runtime_suspend(struct device *dev) static int vc4_hdmi_runtime_resume(struct device *dev) { struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev); + struct drm_device *drm = vc4_hdmi->connector.dev; unsigned long __maybe_unused flags; u32 __maybe_unused value; unsigned long rate; @@ -3159,6 +3167,9 @@ static int vc4_hdmi_runtime_resume(struct device *dev) } #endif + if (drm && drm->mode_config.poll_enabled) + drm_kms_helper_poll_enable(drm); + return 0; err_disable_clk: