From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (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 60D684DA9A5 for ; Mon, 21 Sep 2026 16:51:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790009518; cv=none; b=VAYoWcTovQGopKaqntm1b1H0Ga9q27pp2i0gWzCpF1N++5J/TrDU0mha6YpSOQWQ+vzQ+Xx9bLoVSF9q7M+qbcvt0NOiz0MtHSqsLt6AJ9MOmikuyuKJqusznupohV2rpl3uH2Iqa/FEH5hiHKa64LQcmC8U3V2MbXsZ8mEcLXw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790009518; c=relaxed/simple; bh=/s+Rm5TPnXMuq1eSozgqOKlpb07HdyEVcwVTo15Mu20=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:To:From:Subject: References:In-Reply-To; b=YMzDLOhxcQujN4mTf8Emew1rDoFTStzIk5jyd3ckTcahmQjrMvXj1v6rXlWwg4LQkLyNNAhRxnkU6C5bcMjaQXdedf395Sd6fNLreLIHlT6Lg+j9w6EGGyIvmY1vS6rPeu8O5VEf191KQp2MqEeGkzahiZhydPG0Mlvx6RISBNw= 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=IjYWD3xI; arc=none smtp.client-ip=185.246.85.4 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="IjYWD3xI" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 46F5E4E40755; Mon, 21 Sep 2026 16:51:48 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 04BCA5FFB2; Mon, 21 Sep 2026 16:51:48 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 59E35103291BD; Mon, 21 Sep 2026 18:51:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1790009502; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=cSwoV7JYFKwWDkDL4IDFclIBqtgIii8ZsKhV2r0CgdE=; b=IjYWD3xIKW0KiAwSGgakYrxt0r+vUYd0qxiCiN/UWCsb/Lzv6F9MRJMiln7kdo9fS0L97I MsXakBjOTJ1+zKqPla6JTpP36tNNijKQuc05p4N/sYCzdy/c7URDCf+uJa5rryyF/pGD5K CvqGwT/3RpwqR10lvWnK934ts0XBX+qWLGQw+t4WaJu2BG8/qPF+HiQ1510dHvF6L28CmX ioTpVmqh4beeqW3L3IIl55sutm8DOpW/zT1po1oe7QbGwrjZOVXRXmuApmKzwv2DLncD2H 1SpLtpGpNxBgOe0ek/Ku+tmxFQw0ujiCLjuQSMInGOlC5v95Mxni3AZCvi3qHg== Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 21 Sep 2026 18:51:25 +0200 Message-Id: Cc: , , , , , , , "Sashiko" To: "Luca Ceresoli" , "Cristian Ciocaltea" , "Maarten Lankhorst" , "Maxime Ripard" , "Thomas Zimmermann" , "David Airlie" , "Simona Vetter" , "Dave Stevenson" , "Dmitry Baryshkov" , "Andrzej Hajda" , "Neil Armstrong" , "Robert Foss" , "Laurent Pinchart" , "Jonas Karlman" , "Jernej Skrabec" , "Chen-Yu Tsai" , "Samuel Holland" , =?utf-8?q?Ma=C3=ADra_Canal?= , "Raspberry Pi Kernel Maintenance" , "Raphael Gallais-Pou" , "Sandy Huang" , =?utf-8?q?Heiko_St=C3=BCbner?= , "Andy Yan" , "Algea Cao" , "Daniel Stone" , "Liu Ying" , "Phong LE" , "Helge Deller" From: "Luca Ceresoli" Subject: Re: [PATCH v11 12/74] drm/bridge: Fix unlocked list_del in drm_bridge_add() X-Mailer: aerc 0.22.0 References: <20260901-dw-hdmi-qp-scramb-v11-0-bc12954a0688@collabora.com> <20260901-dw-hdmi-qp-scramb-v11-12-bc12954a0688@collabora.com> In-Reply-To: X-Last-TLS-Session-Version: TLSv1.3 On Mon Sep 21, 2026 at 9:21 AM CEST, Luca Ceresoli wrote: > On Mon Sep 21, 2026 at 9:16 AM CEST, Luca Ceresoli wrote: >> Hello Cristian, >> >> On Tue Sep 1, 2026 at 8:50 PM CEST, Cristian Ciocaltea wrote: >>> When re-adding a bridge that was previously removed, drm_bridge_add() >>> drops it from bridge_lingering_list without holding bridge_lock. >>> >>> Both bridge_list and bridge_lingering_list are protected by bridge_lock= , >>> as they are concurrently modified by drm_bridge_remove() and >>> __drm_bridge_free(), and walked by the debugfs 'bridges' file. Running >>> the list_empty() test and the list_del_init() outside of the lock may >>> therefore corrupt either list. >> >> The analysis appears correct, with a small nit: __drm_bridge_free() cann= ot >> touch the list concurrently to other functions, because it only runs whe= n >> the refcount is 0, and all other functions tounch the lists only when th= ey >> have a reference. (Should this sentence be wrong, that would be a big bu= g!) > > Ah, no, I just realized my concern does not stand. Indeed > __drm_bridge_free() can run concurrently on a different bridge than the o= ne > being handled by other functions, ending up in modifying the same list. S= o > your comment is fully correct: > > Reviewed-by: Luca Ceresoli And tested with bridge hotplug: Tested-by: Luca Ceresoli -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com 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 27E35C982ED for ; Mon, 21 Sep 2026 16:52:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:References:Subject:From:To: Cc:Message-Id:Date:Mime-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Gc6SHVCd6UzEAABH/X9iWbBvSLAyZg0d1W4VBTZVVJ4=; b=JBbEocAiAUsB40 uFFJAGGBjrY/4QO3zbx8Ww9/uvzBk6mz3F4ymvhfL6tlZcXxQfaPzzETOoHg0ZXHL9HscWm3UOEna OgfUv9H7jFubDEQAjOpzBo6Gb1TcUH+Fg6zpVw+m0POOqkkf5VOi1mDewb+6yQLMP/rVRHiNVhMcz w0Sr/82syj8GEjQkFDQUoAoIKvh5N+Ogg4pM2IKYtK7EH7ENsZ709CBLpODuw4htcRcvtg+ekr0ul 1Bu1ToLjkvrC9P61MpjQuvcoTJ2QaNEhH5LuAiKOrQeprtwJmk7GerpChrRL64dlAOXQ2pKyz3Q5r RsLNj9kQ6fo7qLt/m6UQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x8hFE-00000002tC1-3i6e; Mon, 21 Sep 2026 16:51:56 +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 1x8hFA-00000002tAG-3epI; Mon, 21 Sep 2026 16:51:54 +0000 Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 46F5E4E40755; Mon, 21 Sep 2026 16:51:48 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 04BCA5FFB2; Mon, 21 Sep 2026 16:51:48 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 59E35103291BD; Mon, 21 Sep 2026 18:51:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1790009502; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=cSwoV7JYFKwWDkDL4IDFclIBqtgIii8ZsKhV2r0CgdE=; b=IjYWD3xIKW0KiAwSGgakYrxt0r+vUYd0qxiCiN/UWCsb/Lzv6F9MRJMiln7kdo9fS0L97I MsXakBjOTJ1+zKqPla6JTpP36tNNijKQuc05p4N/sYCzdy/c7URDCf+uJa5rryyF/pGD5K CvqGwT/3RpwqR10lvWnK934ts0XBX+qWLGQw+t4WaJu2BG8/qPF+HiQ1510dHvF6L28CmX ioTpVmqh4beeqW3L3IIl55sutm8DOpW/zT1po1oe7QbGwrjZOVXRXmuApmKzwv2DLncD2H 1SpLtpGpNxBgOe0ek/Ku+tmxFQw0ujiCLjuQSMInGOlC5v95Mxni3AZCvi3qHg== Mime-Version: 1.0 Date: Mon, 21 Sep 2026 18:51:25 +0200 Message-Id: Cc: , , , , , , , "Sashiko" To: "Luca Ceresoli" , "Cristian Ciocaltea" , "Maarten Lankhorst" , "Maxime Ripard" , "Thomas Zimmermann" , "David Airlie" , "Simona Vetter" , "Dave Stevenson" , "Dmitry Baryshkov" , "Andrzej Hajda" , "Neil Armstrong" , "Robert Foss" , "Laurent Pinchart" , "Jonas Karlman" , "Jernej Skrabec" , "Chen-Yu Tsai" , "Samuel Holland" , =?utf-8?q?Ma=C3=ADra_Canal?= , "Raspberry Pi Kernel Maintenance" , "Raphael Gallais-Pou" , "Sandy Huang" , =?utf-8?q?Heiko_St=C3=BCbner?= , "Andy Yan" , "Algea Cao" , "Daniel Stone" , "Liu Ying" , "Phong LE" , "Helge Deller" From: "Luca Ceresoli" Subject: Re: [PATCH v11 12/74] drm/bridge: Fix unlocked list_del in drm_bridge_add() X-Mailer: aerc 0.22.0 References: <20260901-dw-hdmi-qp-scramb-v11-0-bc12954a0688@collabora.com> <20260901-dw-hdmi-qp-scramb-v11-12-bc12954a0688@collabora.com> In-Reply-To: X-Last-TLS-Session-Version: TLSv1.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260921_095153_065366_07A95136 X-CRM114-Status: UNSURE ( 8.36 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org On Mon Sep 21, 2026 at 9:21 AM CEST, Luca Ceresoli wrote: > On Mon Sep 21, 2026 at 9:16 AM CEST, Luca Ceresoli wrote: >> Hello Cristian, >> >> On Tue Sep 1, 2026 at 8:50 PM CEST, Cristian Ciocaltea wrote: >>> When re-adding a bridge that was previously removed, drm_bridge_add() >>> drops it from bridge_lingering_list without holding bridge_lock. >>> >>> Both bridge_list and bridge_lingering_list are protected by bridge_lock, >>> as they are concurrently modified by drm_bridge_remove() and >>> __drm_bridge_free(), and walked by the debugfs 'bridges' file. Running >>> the list_empty() test and the list_del_init() outside of the lock may >>> therefore corrupt either list. >> >> The analysis appears correct, with a small nit: __drm_bridge_free() cannot >> touch the list concurrently to other functions, because it only runs when >> the refcount is 0, and all other functions tounch the lists only when they >> have a reference. (Should this sentence be wrong, that would be a big bug!) > > Ah, no, I just realized my concern does not stand. Indeed > __drm_bridge_free() can run concurrently on a different bridge than the one > being handled by other functions, ending up in modifying the same list. So > your comment is fully correct: > > Reviewed-by: Luca Ceresoli And tested with bridge hotplug: Tested-by: Luca Ceresoli -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip