From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796006219; b=Os3wy45NJQ/Upjut2oXWIFZrw616IbeUgBDFlwMyKiOvW6jM1l5axuUvm9XbwOZ2Q09Z bbQuhJtJ/jG6m8NlxLpG3Crpf7lQy50+gAxJln5P0b+bY2Xl8jhoj+TGoYhTHK1u8OwOc xHiqotx+AB5WanaXu2jA6uClwHDAQjHoGhMklCuEXSNChYwi9kOqTwx0f8BNurGoA3kes d775OIeEGPTJRHYlyfnoFntP0RksnBVsM7FDHeWyT64hZnXwqwl0JIYOuWb3qGVRFUv+s ceF0dinq93/2AXJc4GOtQhkXA+C5P/fjtxjT2axoWL+l3YfEYBR23TPDHRf9Pp5UrNw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796006219; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=KcfBTBrpvPecoXv9VdCP9AMf3pphqUe+qEY1+gy04Kc=; b=OcLD8I++V3p5Z8Haf3rQR3SmKYjFpPGNnD0aL+TQQFS3EWhVm9uVMffAs2Bw+IIaumsi iYdV1TWdkfFeefyjZ/J65IlYPrmkC4mr4ysIvs/VizCdMipqVmZXfT4KAADssp/NO3zCD hEDeCJNhwWZo76C1y0INErdq0Xc5idwYejFgPuS4JQDmJM5EJGzxVysAoijbodeGPHa/q fKkOV4xIA62isCuT9rTuNtAMC9JrBvDdIlpjGTnKlmsRFcs5ql0dAyxg1mDMwLhJ3m0iw egjVH3a3Bxop+w6h1w7BTT+hCn44vlA7neukDwMYW2y7SdGt4G+O4GVb605MvvpgrVQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=EaaAGuvf; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 82E12606A31C for ; Mon, 30 Nov 2026 02:36:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=EaaAGuvf Received: by smtp.kernel.org (Postfix) with ESMTPSA id C791B1F000C1; Mon, 30 Nov 2026 02:36:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796006219; bh=KcfBTBrpvPecoXv9VdCP9AMf3pphqUe+qEY1+gy04Kc=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=EaaAGuvfzk5jxAZq7+ofKNkZJrnY5z06MwMwIWOt0YNMl/0+pqpLEJsClol+zCzab r+ekHcfXcGu1zOVq0P3jG2aNFCYl316rAF1Aw9j6PQ+Q2f3Gp1dEBwbFLoLbifJ9MJ HnAldWqKOkX3iLs9rIW4X0eunabFTUWUdajcWclUDRe9NdQHSDZQ+C21Q1ebfisuiA 9lEQgrZ0wa8klnoZI24HbIqwNDQ2iZnw+F/+szUapoSg/Ji2KtZg2r+RQQM8LbBWsN yCtpX7Gv/xdcUJdcNFID+srOU2nrGFWbn9wC9xf1HuMezYzYF85hctNLc8NTmkolnf h9GAnuS7TyIFA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v8 4/5] drm/bridge: trilinear: add the DPTX core and build glue Reply-To: sashiko-reviews@lists.linux.dev To: "Luo Liu" Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org In-Reply-To: <20261130022510.762141-5-Luo.Liu@cixtech.com> References: <20261130022510.762141-1-Luo.Liu@cixtech.com> <20261130022510.762141-5-Luo.Liu@cixtech.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Mon, 30 Nov 2026 02:36:58 +0000 X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] drm/bridge: trilinear: dptx_deinit() race skips aux_unregister() on detach -- commit 00155c57bf2032aceb755ea1f307b341e22e5c42 Author: Luo Liu drm/bridge: trilinear: add the DPTX core and build glue This commit adds the core probe, power management, hotplug handling, and stream state machine for the Trilinear DPTX bridge driver, along with Kconf= ig and Makefile integration. > diff --git a/drivers/gpu/drm/bridge/trilinear/dptx_core.c b/drivers/gpu/d= rm/bridge/trilinear/dptx_core.c > new file mode 100644 > index 0000000000000..87c21bb189f89 > --- /dev/null > +++ b/drivers/gpu/drm/bridge/trilinear/dptx_core.c [ ... ] > +static void dptx_deinit(struct dptx_dev *dp) > +{ > + struct device_link *link =3D NULL; > + > + scoped_guard(mutex, &dp->lock) { > + if (!(dp->state & DPTX_STATE_CONFIGURED)) > + return; > + > + WRITE_ONCE(dp->hpd_stopped, true); > + dp->released =3D true; > + dptx_irq_off(dp); > + } > + > + dptx_cancel_hpd_works(dp); > + > + scoped_guard(mutex, &dp->lock) { > + dptx_stop_streams(dp); > + dptx_host_deinit(dp); > + dp->hw->ops->aux_unregister(dp->hw); > + dp->state &=3D ~(DPTX_STATE_CONFIGURED); > + link =3D dp->link; > + dp->link =3D NULL; > + } > + > + if (link) > + device_link_del(link); > +} [Severity: Medium] Can dptx_bridge_detach() return before dp->hw->aux is unregistered when it races with dptx_deinit()? dptx_bridge_detach() skips aux_unregister() when dp->released is set: drivers/gpu/drm/bridge/trilinear/dptx_drm.c:dptx_bridge_detach() { ... scoped_guard(mutex, &dp->lock) { dp->attached =3D false; if (!dp->released) dp->hw->ops->aux_unregister(dp->hw); ... } Because dptx_deinit() sets dp->released in the first critical section and drops dp->lock to cancel the HPD workers before calling aux_unregister() in the second critical section, the two teardowns can interleave: CPU0 CPU1 dptx_deinit() dptx_bridge_detach() lock(&dp->lock) dptx_quiesce_hpd() dp->released =3D true; unlock(&dp->lock) dptx_cancel_hpd_works() lock(&dp->lock) if (!dp->released) /* false */ unlock(&dp->lock) /* drm_device teardown proceeds while aux is still registered */ lock(&dp->lock) ... dp->hw->ops->aux_unregister() dptx_bridge_detach() then returns to drm_bridge_detach(), allowing DRM devi= ce cleanup to free bridge->dev while dp->hw->aux is still registered and dp->hw->aux.drm_dev still points to the DRM device. Moving dp->released =3D true into the second critical section of dptx_deinit() (where aux_unregiste= r() runs under the same lock acquisition) avoids this window. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261130022510.7621= 41-1-Luo.Liu@cixtech.com?part=3D4