From mboxrd@z Thu Jan 1 00:00:00 1970 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 EE963CA5FD4 for ; Thu, 1 Oct 2026 12:44:03 +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:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=d8sRHCj1LfeaitArGCptBNg5yIjIKKLU8Yc9pqpZHp8=; b=sSSBPEyIbpairmxG5KIZ/sKogI ryctwy7Ny6yqZJPplg4uRVFQs4FXm+TLX6+N/DW2+yYrwXGMHo6StFNWCx0Dv6ckU4OUYCUz2Qu0U rxx4GrCCcLHZtc3ipN8+AMfYbL3+bMbsdGsRM1hxIcC4qGQL7rTCZpV2BZzqgprX0D9p8ool0lo52 RI3u3HHBy9+H5RSOClw8IMNspuAlOUMW+Z7LA+j9vZCCN8iRNUL4a+g1UEEN5hakeuF2e0GMBZ5fq mWBBIjp+8/zMzgV390ITmH4cKZ/gAlvpfhGh8k6sz9PFPmIBC16rk2fngpI6tUtSZ9kj7KXboUdCv vlqO99MA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1xCG8j-000000096py-0ttK; Thu, 01 Oct 2026 12:43:57 +0000 Received: from smtpout-03.galae.net ([185.246.85.4]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1xCG8h-000000096mP-0Suc for linux-arm-kernel@lists.infradead.org; Thu, 01 Oct 2026 12:43:56 +0000 Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 7FAA84E41E84; Thu, 1 Oct 2026 12:43:53 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 2C5A160341; Thu, 1 Oct 2026 12:43:53 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id B20031032809F; Thu, 1 Oct 2026 14:43:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1790858630; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=d8sRHCj1LfeaitArGCptBNg5yIjIKKLU8Yc9pqpZHp8=; b=uKqwpUTxeMSVETp8oi2R2qfYX3XikeUsnqq6J6anFGUgYa0FuvoZkeKx3hY5Sx2qrYcPHH Js5oT13YMmnmZvKP83HPQIdRLekLXWkwgb5yFixpjBmh0/Fc+qJpqTdIGpVj5I251YMCWx Lw0V2VSRgJ6hwfFwu3zEbOCr/EbfOiGX3M5tonBIXjJftpVfZmlAPki2k4AyMWuStB9hrs LuHYY8vNXRPVMAxmyaKjivrL6T9L8pHpgJi8twn24DOQiRUdj5ac1hF8zt2IXnsjEzoOCa cpITW9wSrIBWoPhGuFE+YJAjH44ioVtKFeGk/lC0C/S7gvmqFAV3q459WcQI2w== From: Luca Ceresoli Date: Thu, 01 Oct 2026 14:42:34 +0200 Subject: [PATCH RFC v2 12/24] drm/bridge: shutdown and cleanup on bridge unplug MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20261001-drm-bridge-hotplug-v2-12-8e34986dcb68@bootlin.com> References: <20261001-drm-bridge-hotplug-v2-0-8e34986dcb68@bootlin.com> In-Reply-To: <20261001-drm-bridge-hotplug-v2-0-8e34986dcb68@bootlin.com> To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Inki Dae , Jagan Teki , Marek Szyprowski , Jessica Zhang , Douglas Anderson , Marek Vasut , Stefan Agner , Frank Li , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: Hui Pu , Ian Ray , Luca Ceresoli , Thomas Petazzoni , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org X-Mailer: b4 0.16.0 X-Last-TLS-Session-Version: TLSv1.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261001_054355_304453_C560265D X-CRM114-Status: UNSURE ( 9.73 ) X-CRM114-Notice: Please train this message. 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 With the upcoming support for DRM bridge hot(un)plugging, bridges can be removed at any time. When this happens, shutdown the pipeline and detach from the encoder chain the bridge being removed along with all the following ones. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/drm_bridge.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index 2a112ed69e20..c0a2f7f1ce62 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -509,9 +509,17 @@ EXPORT_SYMBOL(devm_drm_bridge_add); * it won't be found by users via of_drm_find_and_get_bridge(), and add it * to the lingering bridge list, to keep track of it until its allocated * memory is eventually freed. + * + * If the bridge was attached, also shutdown CRTCs and detach this bridge + * and the following ones. */ void drm_bridge_remove(struct drm_bridge *bridge) { + if (bridge->encoder) { + drm_atomic_shutdown(bridge->dev); + drm_encoder_cleanup_from(bridge->encoder, bridge); + } + mutex_lock(&bridge_lock); list_move_tail(&bridge->list, &bridge_lingering_list); mutex_unlock(&bridge_lock); -- 2.55.0