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: 13717178 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 3874AC27C4F for ; Sun, 30 Jun 2024 15:38:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=jR2qUoYJWjo62ss14f32ABLuwKjco/WEcCrvFX1iwUQ=; b=0Q42411xzER/ao4DgUqPUEf9L+ kH8QTovelNL0aXbMUa52yEHjkqc5Rz6f6r/l5MVi7qCTeGAYck1Il0oBm/8t8Qlh1qZtYeayxYb5W lKG659mIYiWopJbdgjTG7puKceNxxSuwlJzrmIqaZS+1mUUTtpi1z0QBz8q87vRQOb7TJfp2mafJ3 O9GdlerSa1gW0A3w6wHliSoOOqLFitvK6dy3F9dlZw/dfwOOIAdiI5srn9Ft5zzW6lQmS8flpEHJE bSx60fZhmGz95fftlWOw0B4TyY7hykZGtuiqvkhf8jCsZqlXTIotlNnE1mizFJ7D8VmIB34AD7FL2 IFRavVAw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sNwdE-00000000cgo-0yBN; Sun, 30 Jun 2024 15:38:24 +0000 Received: from mout.gmx.net ([212.227.15.15]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sNwca-00000000cOD-1DNA for linux-arm-kernel@lists.infradead.org; Sun, 30 Jun 2024 15:37:46 +0000 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240630_083744_747917_4C33081D X-CRM114-Status: GOOD ( 13.57 ) 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 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: