From patchwork Fri Jan 27 15:40:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 13118858 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 B5627C54EAA for ; Fri, 27 Jan 2023 15:41:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7B8DB10E16E; Fri, 27 Jan 2023 15:41:01 +0000 (UTC) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by gabe.freedesktop.org (Postfix) with ESMTPS id D645110E16E for ; Fri, 27 Jan 2023 15:41:00 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 51AEB3200488; Fri, 27 Jan 2023 10:40:56 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Fri, 27 Jan 2023 10:40:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-transfer-encoding:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm1; t=1674834055; x=1674920455; bh=jsatUeV5/0oLfTkS9GeGuCrs7 S982tAG2mwccT2mwfQ=; b=Osycq7W0Td3wIjtn7/1SD5k5sZTQIt3X2yq0gIXtZ /wnDUfIb0yvHrFImXKbvW6rwcFIfYz9elJLTaqXLwZAEDgWRfUvocKxKCD9AQ65Z 03pk2PcQ6BkRTz4BXv5GyX6Xo5rWFtn22C3X+STI3zn9UiY5Vhh+Lwcdl5R6oQj+ Wlo8iaC2Cm9tPVqzp4Ly7h+Efc+Hv19R2ZEiCaRY+J+RiQcK7ZjtnVYd3tFgxPO8 9QPCVENPPvwsUHZqwki04wqiai1XtE+LWbNDt+JY6/4uxRIxbcBnlURFZ7ChqnUE aylvFOCUcSrW3ALVjSIujIu9HA6n86PD04Qiqpwt55DYw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1674834055; x=1674920455; bh=jsatUeV5/0oLfTkS9GeGuCrs7S982tAG2mw ccT2mwfQ=; b=D/6izsJPDpGbQe8pDe1ve952TszFfdFWAmwZM7R2EVZG7XC7Q5Z eB8syiNQu3RFzcPi2GaxRNhJjxd/X01Qm8H8wrZN05WgylKrqA8Hp9otk8CYcsff DBzk+ie9uWi10fhrZHE7D/RaKo37r8R+t2iq92ynKrMM6yRGDcUIQIEujaEcBPAk qrNt8qNMCcJETWhkvzdwKAz5D/pgDQ3qNAbtwRLxPRCHNJmSDi5RyiL0vp2rFWDz dzNvCd+galRQSH7GfaEqGaQjepiRhyqA2e/FKJZE6tpD4K8XmhjlUrOtKijAcQWe DSmumIS1LymHr3aieEbeO393Ttn+PWdVfmA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedruddviedgjeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpeektedujeeijeefhfejuedtudegtdejffffvdettdeigeekffeileelgeevgfdv vdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrg igihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 27 Jan 2023 10:40:54 -0500 (EST) From: Maxime Ripard To: Daniel Vetter , David Airlie , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard Subject: [PATCH] drm/probe-helper: Cancel previous job before starting new one Date: Fri, 27 Jan 2023 16:40:52 +0100 Message-Id: <20230127154052.452524-1-maxime@cerno.tech> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 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: , Cc: Dom Cobley , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Dom Cobley Currently we schedule a call to output_poll_execute from drm_kms_helper_poll_enable for 10s in future. Later we try to replace that in drm_helper_probe_single_connector_modes with a 0s schedule with delayed_event set. But as there is already a job in the queue this fails, and the immediate job we wanted with delayed_event set doesn't occur until 10s later. And that call acts as if connector state has changed, reprobing modes. This has a side effect of waking up a display that has been blanked. Make sure we cancel the old job before submitting the immediate one. Fixes: 162b6a57ac50 ("drm/probe-helper: don't lose hotplug event") Signed-off-by: Dom Cobley Signed-off-by: Maxime Ripard --- drivers/gpu/drm/drm_probe_helper.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c index 8127be134c39..db954adb446a 100644 --- a/drivers/gpu/drm/drm_probe_helper.c +++ b/drivers/gpu/drm/drm_probe_helper.c @@ -589,9 +589,11 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, * disable itself again. */ dev->mode_config.delayed_event = true; - if (dev->mode_config.poll_enabled) + if (dev->mode_config.poll_enabled) { + cancel_delayed_work_sync(&dev->mode_config.output_poll_work); schedule_delayed_work(&dev->mode_config.output_poll_work, 0); + } } /* Re-enable polling in case the global poll config changed. */