From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5CD6930C62D for ; Wed, 24 Jun 2026 15:34:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782315269; cv=none; b=a5fhfN7Socg7MlW88o0VswYzbpUM7wLUI2BqR8zNx+vbcDyMoEUMJavsDZIXk79f0R/7z2TTFbUaNXaVF5B2Q9LMYc6Rck8ymX4s+WHKDC56j5eV71wvlRhKR08ZbsF0IWuXImxGvGqcP/SXu1qk0H5ivX1opZVqsL1L3JALRsg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782315269; c=relaxed/simple; bh=42Ed64+3wm0Z8NK99dtzeXWSZhG0dOiv/Jc+q54mDck=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:To:From:Subject: References:In-Reply-To; b=J3m0Pnmeiyxz5yNYaftKXbIsm5MjKikxbC888RipQhm4sFtvAwUrGlYYNAYoAFeRR/TxUYVAHaL9AYADm0wRv8GRvbvmBd4Dw6UBlU+xB3+NAI7ATt32MQlqyl4NMkNffZDPTe9y3IsvdHP7YLWEJU9jQzOlJxS2QbA3nZ7ii84= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=oyQNmsCI; arc=none smtp.client-ip=185.246.84.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="oyQNmsCI" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id DC3281A0913; Wed, 24 Jun 2026 15:34:25 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id AB872601C5; Wed, 24 Jun 2026 15:34:25 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 7EAC5106C8382; Wed, 24 Jun 2026 17:34:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1782315264; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=hQIzpvMfwF06Dy+Dr6X7XbgYJ2zdNKivwH5fV0BlR9A=; b=oyQNmsCIcNTgs68aF1WzEwUyaqMGrQDkkQYBeAFupUMciys441g2Pmpqb9q63M9TgB3z9E obW679sV3ac8zlACQM9Jmg/vA1v3ow+j/P/Xhfnreqz+gfsGN0Qft8YbEltzMW38iraK5G 9iEx3IU3pw62tpfcDlC29EJONLP21quC1Rlrlhpp4LfK2hpOrdisPqhb0sZ1oOElcLMo3u oTaeeKfmEJ1VM5c5SAWIaeFvOjdocre7HQHMPxIxunAsVG/t7aa/fRy61Zs8UWONtYA4mP QamLzEJxL0b9mjX7CEKx7PilFcaI1roV0COlX17AIapF6umjrYF86R9VRHohCg== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 24 Jun 2026 17:34:14 +0200 Message-Id: Cc: "Maarten Lankhorst" , "Thomas Zimmermann" , "David Airlie" , "Simona Vetter" , "Andrzej Hajda" , "Neil Armstrong" , "Robert Foss" , "Laurent Pinchart" , "Jonas Karlman" , "Jernej Skrabec" , "Inki Dae" , "Jagan Teki" , "Marek Szyprowski" , "Marek Vasut" , "Stefan Agner" , "Frank Li" , "Sascha Hauer" , "Pengutronix Kernel Team" , "Fabio Estevam" , "Hui Pu" , "Ian Ray" , "Thomas Petazzoni" , , , , To: "Maxime Ripard" , "Luca Ceresoli" From: "Luca Ceresoli" Subject: Re: [PATCH 15/37] drm/display: bridge-connector: allocate the connector dynamically X-Mailer: aerc 0.21.0 References: <20260519-drm-bridge-hotplug-v1-0-45e2bdb3dfb4@bootlin.com> <20260519-drm-bridge-hotplug-v1-15-45e2bdb3dfb4@bootlin.com> <20260608-rustling-infrared-turkey-e09af8@houat> <20260624-judicious-enigmatic-hippo-b13ffe@houat> In-Reply-To: <20260624-judicious-enigmatic-hippo-b13ffe@houat> X-Last-TLS-Session-Version: TLSv1.3 Hi Maxime, thanks for the feedback. On Wed Jun 24, 2026 at 1:48 PM CEST, Maxime Ripard wrote: > On Fri, Jun 12, 2026 at 02:44:43PM +0200, Luca Ceresoli wrote: >> On Mon Jun 8, 2026 at 1:46 PM CEST, Maxime Ripard wrote: >> > On Tue, May 19, 2026 at 12:37:32PM +0200, Luca Ceresoli wrote: >> >> Currently the drm_bridge_connector has an embedded drm_connector, so = their >> >> allocation lifetimes are tied to each other. This is insufficient to >> >> support DRM bridge hotplugging, which requires the connector to be ad= ded >> >> and removed dynamically at runtime multiple times based on hotplug/un= plug >> >> events while the drm_bridge_connector is persistent. >> >> >> >> Moreover the drm_connector is exposed to user space and thus an ongoi= ng >> >> operation (e.g. an ioctl) might last for an arbitrarily long time eve= n >> >> after the hardware gets removed. This means a new connector might hav= e to >> >> be added when the previous one is still referenced by user space. >> >> >> >> In preparation to handle hotplug, allocate the drm-connector dynamica= lly, >> >> to allow: >> >> >> >> * creating and destroying a connector multiple times during a single >> >> drm_bridge_connector lifetime >> >> * creating a new connector even though the previous one is still in = use >> >> and thus still refcounted and not yet freed >> >> >> >> This commit does not introduce the actions in the two bullets (it wil= l >> >> happen in a later commit), it only moves to dynamic APIs for connecto= r >> >> allocation and init. >> >> >> >> Signed-off-by: Luca Ceresoli >> > >> > I think this patch should be split in half, with the switch to using >> > destroy first, and then the actual move to the dynamically allocated >> > connector API. >> >> Is it doable? drm_connector_dynamic_init() mandates a .destroy callback, >> drm_connector_init() forbids it. > > drmm_connector_init forbids it. drm_connector_init mandates it. Something bogus in my reply, sorry. :) So you mean splitting in: * first patch: move from drmm_connector[_hdmi]_init() to drm_connector[_hdmi]_init() and add a .destroy * second patch: move from drm_connector[_hdmi]_init() to drm_connector[_hdmi]_dynamic_init() + drm_connector_dynamic_register/unregister() ? Luca -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com