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 40E9D30CD80 for ; Tue, 14 Oct 2025 11:43:33 +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=1760442216; cv=none; b=L5OMM1QEdDtQ/jy23nNValoOkFiXw0h6T2Oh0SmMegEE/tLnkKzb3BX3XTbwRYnItGLJoCdPZDoCqd+mueifrTFnxQ8I7xPhAIm+CIdLupn9uLxphJq6vzg/2/SGiAdUA3a9WTFHivtW4zY6Ig3GJ23FF+jL15Wvp+SDi5aohcs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760442216; c=relaxed/simple; bh=z+MOC331uVrPaK4rXD+1EutydV0Qt6VQimqpIgnxja4=; h=Mime-Version:Content-Type:Date:Message-Id:From:To:Cc:Subject: References:In-Reply-To; b=mR4+qUJmTbuBaqtbQbm3ZqjJ9DLRaw+RmprP8hqm+gLzXkRWy95EgSG4HGHpUFoQFyy92sx6OoWBE01nTekM3hzc/fIesLHSQyLxBE0Lk06bB11wIIOqqFQvvbmhXl8VzDlGOSth8k4X2nd/EYp8c8peNxMwj2B/B7c7hzFdu2I= 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=yz3OKdHL; 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="yz3OKdHL" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 79E474E41098; Tue, 14 Oct 2025 11:43:32 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 44F13606EC; Tue, 14 Oct 2025 11:43:32 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 0217D102F2298; Tue, 14 Oct 2025 13:43:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1760442211; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=nCxasSvJLE/ntqOSQlVYeTt9F+Rb39yn4NlUI8d4k/M=; b=yz3OKdHLUlM5a0ogcR2e1FHIeHsXztLkAOqBkLeUoqs7Om7wan+FAvJcb6nl+Tg6jJb/H8 D7DXXQJUDhdX9/NTTT8pCkGoc0aYJHSMfqQtbi6yYQts0yMDaZdr8cbDu5pdxfW0DIHaLd RzrnVGJN95+qXdIHj7ulqmii9Sl6cgovt73I+mcpPSfRqfKYm+sc9QpOTxRCQjBZlCEbGt YHoOBfIfMbARrjtVmVlTUpJt+xWYGZQIYF/t0kQxB95cgb1MMCUOdbn7qf0t+XG8QJiFym 7lmzea5XoYT7i9bwNM1wq/2h064mVdgEaxa7K+/rqCTnecTZ6ShzMFioJP/tnQ== 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: Tue, 14 Oct 2025 13:43:21 +0200 Message-Id: From: "Luca Ceresoli" To: "Ernest Van Hoecke" Cc: "Anusha Srivatsa" , "Maxime Ripard" , "Neil Armstrong" , "Andrzej Hajda" , "Jessica Zhang" , "Robert Foss" , "Laurent Pinchart" , "Maarten Lankhorst" , "Thomas Zimmermann" , "Thomas Petazzoni" , "David Airlie" , "Simona Vetter" , "Hui Pu" , "Dmitry Baryshkov" , , , , Subject: Re: [REGRESSION] drm/panel/panel-simple v6.17 WARNING regression X-Mailer: aerc 0.20.1 References: In-Reply-To: X-Last-TLS-Session-Version: TLSv1.3 Hello Ernest, On Tue Oct 14, 2025 at 1:25 PM CEST, Ernest Van Hoecke wrote: > Hi Luca, > > Thanks for your fast reply and all your work here. > > On Tue, Oct 14, 2025 at 12:31:35PM +0200, Luca Ceresoli wrote: >> Let me have a look at the DRM_IMX driver, I'll try to send a series >> converting it to the new API within today. > > I will gladly test, thanks! Just sent: https://lore.kernel.org/all/20251014-drm-bridge-alloc-imx-ipuv3-v1-0-a1bb1d= cbff50@bootlin.com/ >> I recently sent a series proposing to make drm_bridge_add() mandatory >> before drm_bridge_attach() in the docs and warn if that is violated [1].= If >> you apply patch 4 of that series you should see the warning. > > I gave it a quick try and did not see the warning. Some printk debugging > told me that `list_empty(&bridge->list)`, inside drm_bridge_attach, is > returning 0. Ouch, I think this is because without using devm_drm_bridge_alloc() even the list is uninitialized, and so list_empty will do: static inline int list_empty(const struct list_head *head) { return READ_ONCE(head->next) =3D=3D head; ^ ^ NULL (bridge->list valid pointer zeroed by kzalloc) to bridge->list } So it returns false. I guess that means the series to make drm_bridge_add() mandatory before drm_bridge_attach() [0] will need a better check to trigger the warning. [0] https://lore.kernel.org/lkml/20251003-b4-drm-bridge-alloc-add-before-at= tach-v1-0-92fb40d27704@bootlin.com/ >> > However, later on, another regression seems to be introduced by >> > commit 8fa5909400f3 ("drm/bridge: get the bridge returned by drm_bridg= e_chain_get_first_bridge()") >> > so reverting 94d50c1a2ca3 on top of drm-misc-next does not solve >> > everything. This was tested by rebasing drm-misc-next onto (260f6f4fda= 93 >> > plus the revert of 94d50c1a2ca3) and then bisecting. >> > >> > So in v6.18-rc1, both regressions are present. >> > >> > There, I get the following additional warnings: >> > >> > [ 9.732278] ------------[ cut here ]------------ >> > [ 9.732336] WARNING: CPU: 0 PID: 38 at lib/refcount.c:22 drm_bridge= _get+0x10/0x18 >> > [ 9.744608] refcount_t: saturated; leaking memory. >> >> Not sure here, but it may well be another symptom of the same bug: the >> refcount was not initialized correctly, so it is found inconsistent late= r >> when trying to increase it. Let's fix the known issue and then we'll see= . > > Makes sense to me. Alright. Let me know whether the series I've sent fixes 0, 1 or both warnings. Best regards, Luca -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com