From patchwork Wed Jun 12 07:23:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 13694526 X-Patchwork-Delegate: kieran@bingham.xyz Received: from laurent.telenet-ops.be (laurent.telenet-ops.be [195.130.137.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EFC7E16C865 for ; Wed, 12 Jun 2024 07:23:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.130.137.89 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718177004; cv=none; b=fWh3HzBpjKO+LC4FjcXvROxKBy732JKMEG9sppryfeQVFSCxRNyKH19E4Be+v97gBOuD7PW3I5ZDuuwekrKMUwacjHcA17JM0xTz56e6goo7kLWXx6OI0R9TZKVT+JPVsoRQ4HUgTtYmBAwOZn1fU7fbgxXQVFENbHNBloWZnPE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718177004; c=relaxed/simple; bh=K7rDYSmQm0br0O/8nY7xeJ//jLo9Ur+c/jejdJai0Ts=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=IBRLQNtvCZDFGLQP+AVBFS4wGApe/3She32PThH0tvuiHcAHLLS70XtdWRD08IGq6oa71Jb93hp41ngaZI0d83gh0thjx7/FEwac7mZZWR0anvVYrtIO6u8cVUrW7TaRLzHFrY6qEpOlY5vXORDSIGHeTnZOVz2ihLWLL0xI6dU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be; spf=none smtp.mailfrom=linux-m68k.org; arc=none smtp.client-ip=195.130.137.89 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux-m68k.org Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed80:170b:1b4a:247:a009]) by laurent.telenet-ops.be with bizsmtp id aXPG2C00A3axqkY01XPGYN; Wed, 12 Jun 2024 09:23:19 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1sHIJ8-007OGF-Vs; Wed, 12 Jun 2024 09:23:16 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1sHIKC-00E9WZ-3I; Wed, 12 Jun 2024 09:23:16 +0200 From: Geert Uytterhoeven To: Laurent Pinchart , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Douglas Anderson Cc: dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven , Sui Jingfeng Subject: [PATCH v3] drm: renesas: shmobile: Call drm_atomic_helper_shutdown() at shutdown time Date: Wed, 12 Jun 2024 09:23:13 +0200 Message-Id: <17c6a5a668e5975f871b77fb1fca6711a0799d9e.1718176895.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Douglas Anderson Based on grepping through the source code, this driver appears to be missing a call to drm_atomic_helper_shutdown() at system shutdown time. This is important because drm_atomic_helper_shutdown() will cause panels to get disabled cleanly which may be important for their power sequencing. Future changes will remove any custom powering off in individual panel drivers so the DRM drivers need to start getting this right. The fact that we should call drm_atomic_helper_shutdown() in the case of OS shutdown comes straight out of the kernel doc "driver instance overview" in drm_drv.c. Suggested-by: Maxime Ripard Signed-off-by: Douglas Anderson Link: https://lore.kernel.org/r/20230901164111.RFT.15.Iaf638a1d4c8b3c307a6192efabb4cbb06b195f15@changeid [geert: s/drm_helper_force_disable_all/drm_atomic_helper_shutdown/] [geert: shmob_drm_remove() already calls drm_atomic_helper_shutdown] Signed-off-by: Geert Uytterhoeven Reviewed-by: Laurent Pinchart Reviewed-by: Sui Jingfeng --- v3: - Add Reviewed-by, - Fix remaining references to drm_helper_force_disable_all(), v2: - Add Reviewed-by. Tested on Atmark Techno Armadillo-800-EVA. --- drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c index e83c3e52251dedf9..0250d5f00bf102dc 100644 --- a/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c +++ b/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c @@ -171,6 +171,13 @@ static void shmob_drm_remove(struct platform_device *pdev) drm_kms_helper_poll_fini(ddev); } +static void shmob_drm_shutdown(struct platform_device *pdev) +{ + struct shmob_drm_device *sdev = platform_get_drvdata(pdev); + + drm_atomic_helper_shutdown(&sdev->ddev); +} + static int shmob_drm_probe(struct platform_device *pdev) { struct shmob_drm_platform_data *pdata = pdev->dev.platform_data; @@ -273,6 +280,7 @@ static const struct of_device_id shmob_drm_of_table[] __maybe_unused = { static struct platform_driver shmob_drm_platform_driver = { .probe = shmob_drm_probe, .remove_new = shmob_drm_remove, + .shutdown = shmob_drm_shutdown, .driver = { .name = "shmob-drm", .of_match_table = of_match_ptr(shmob_drm_of_table),