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=1796371505; b=Ad23bKl9cSLrU5H+76U2Ptfdv3WOaq3KcXdJQyiPX1GvllkMQFWTqYxqM/HkMU0lYjiO q+oUpBFKG2jvRWJ4jsA3dA5CRNrJJ6zExtsiY4AxCvYqFgMnORujnkBnS1WRZvY0lzV4N ckbdB3ATDAw3fol4IftIen3E70PRT5Fte/c2NpQAK/UY4M3h/O+z2xCpcknW1i+OOPMOt U59WX6Toun4K18locS2HmV+yRvYsPon22y9Jxs/+NLGWw2DoujRGhBhXVypIWPVkqS/ru q7gQZS4vV5GlsncTKONEely4WfXtTzt+zahzSwqoKDDZosx/py6jWAV/Nk/MCWQ14rg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796371505; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=T2W6DF4lzeon0/dA3D8y+3G+DDkIfgRkDTcuxs+C/4M=; b=eqFfA2KjBHWPnTPq3Tu3JWQbf2t+kiERrOCPpOIWQUCY3hvzT7LsjYAKHZRBAw7MwzFn 29g9wgl+/wwPODAr1eMqwU/356vhKFiVDWWGOL6Z6d0b+dGHFATMF2i7BLjvyX+tYjRo8 XaoxjE1hFPLRGFHtDJgpgx7j776255ALBV9oKvT/8rxJmil2DgN9JRc+QcuvjL90FxxoU R9HshSQtcYhQ8c2+p0AVWE7n4DscgLUPTkqpmjgjuNmNFzwvr0Pf/hM5uWyX5YmBDTIH/ tRBZK3tIK04YZGM5MhtvzV1eYzH2cPQp8SfR1G98HT1bOv06Pb6bhdI/GqpC/IEQpQA== 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=A6lOpRQN; 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 800E9606A335 for ; Fri, 4 Dec 2026 08:05:05 +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=A6lOpRQN Received: by smtp.kernel.org (Postfix) with ESMTPSA id B46171F000C2; Fri, 4 Dec 2026 08:05:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796371505; bh=T2W6DF4lzeon0/dA3D8y+3G+DDkIfgRkDTcuxs+C/4M=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=A6lOpRQNHZu5OgMYbFtsh9U/feA1ArasLAHKonWkSGGGbuWNYJtG3odjmgUzop0d4 ZXEoOiU2aFsx/Iveo5UP+OZSMCM3RaF9uqjkFpr8BjFTXWBq9XocTj2adqghpGOoDO 8oSaEcuxJ4fUtI0MXcCrN/bwqjoL9zaIVq8BHCe28SqaVOpDwgMAihHp5L4MMPEPUh xqTlIsDLprBhOvPCf/wQ6XIQBp4euvx4HGPPjWijQweAhKtPJECl0QQkaQ2iwLheo2 UJuQgZd5SatzfHLXC6zmZY8UIwXY5gt0YGd5y+Xh5zbcp894/t8WPcDG5UkoFH9PJS USWRRMOetdIvQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v9 5/5] drm/cix: add the Sky1 DisplayPort platform 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: <20261204074239.133559-6-Luo.Liu@cixtech.com> References: <20261204074239.133559-1-Luo.Liu@cixtech.com> <20261204074239.133559-6-Luo.Liu@cixtech.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 08:05:04 +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 5 potential issues to consider: - [Medium] drm/bridge: trilinear: dptx_deinit() races with dptx_bridge_attach() - [Medium] drm/bridge: trilinear: unlocked device_link_del() races with purge - [Low] drm/cix: MAINTAINERS omits drivers/gpu/drm/cix/ Kconfig and Makefile - [Low] drm/bridge: trilinear: 32-bit overflow in dptx_hw_stream_timing_set() - [Low] drm/cix: rely on undocumented dev_set_drvdata() in trilinear_dptx_probe() -- commit dc89c829eff9a7f0dba586da4c0b1ecdf3d742f9 Author: Luo Liu drm/cix: add the Sky1 DisplayPort platform glue This commit adds the Cix Sky1 DisplayPort platform glue driver, which maps the SoC RCSU video adapter registers, configures pixel format and pixel-per-clock settings, and binds the shared Trilinear DPTX bridge driver. > diff --git a/MAINTAINERS b/MAINTAINERS > index 9315302ab7628..2314af4da0b7a 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -6535,6 +6535,7 @@ L: dri-devel@lists.freedesktop.org > S: Maintained > F: Documentation/devicetree/bindings/display/cix,sky1-dp.yaml > F: drivers/gpu/drm/bridge/trilinear/ > +F: drivers/gpu/drm/cix/dptx/ > F: include/drm/bridge/trilinear_dp.h [Severity: Low] Should this entry also cover drivers/gpu/drm/cix/Kconfig and drivers/gpu/drm/cix/Makefile (for example via F: drivers/gpu/drm/cix/)? Those two newly added files are not matched by any MAINTAINERS entry. [ ... ] > diff --git a/drivers/gpu/drm/cix/dptx/cix_dptx.c b/drivers/gpu/drm/cix/dp= tx/cix_dptx.c > new file mode 100644 > index 0000000000000..a4e028181383a > --- /dev/null > +++ b/drivers/gpu/drm/cix/dptx/cix_dptx.c [ ... ] > + dp =3D trilinear_dptx_probe(dev, soc_data, priv); > + if (IS_ERR(dp)) > + return PTR_ERR(dp); > + > + return 0; > +} [Severity: Low] Should cix_dptx_probe() call platform_set_drvdata(pdev, dp) instead of discarding dp? cix_dptx_remove(), cix_dptx_pm_suspend(), cix_dptx_pm_resume(), and cix_dptx_shutdown() all retrieve the struct dptx_dev pointer from drvdata. This currently works only because trilinear_dptx_probe() calls dev_set_drvdata(dev, dp) internally, even though the trilinear driver never reads drvdata and include/drm/bridge/trilinear_dp.h does not document that side effect. Setting drvdata here and dropping dev_set_drvdata() from trilinear_dptx_probe() would match other shared DRM bridge libraries and avoid clobbering drvdata for future glue drivers. > + > +static void cix_dptx_remove(struct platform_device *pdev) > +{ > + trilinear_dptx_remove(platform_get_drvdata(pdev)); > +} [Severity: Medium] Can dptx_deinit() race with dptx_bridge_attach() and leave dp->hpd_event_wo= rk polling dp->phy after devres releases it? In drivers/gpu/drm/bridge/trilinear/dptx_core.c, dptx_deinit() sets dp->hpd_stopped =3D true and drops dp->lock to call dptx_cancel_hpd_works(), setting dp->released =3D true only in a second dp->lock critical section: CPU0 CPU1 cix_dptx_remove() dptx_deinit() lock(&dp->lock) dp->hpd_stopped =3D true unlock(&dp->lock) dptx_cancel_hpd_works() dptx_bridge_attach() lock(&dp->lock) /* dp->released is still false */ dp->hpd_stopped =3D false unlock(&dp->lock) dptx_replay_deferred_hotplug() queue_delayed_work(hpd_event_work) dptx_hpd_event_work_func() /* passes abort check, unlocks */ dptx_wait_phy_dp_mode() lock(&dp->lock) dp->released =3D true unlock(&dp->lock) devres_release_all() devm_phy_release(dp->phy) phy_get_mode(dp->phy) <-- use-after-free Because dp->hpd_stopped was cleared back to false and dptx_hpd_notify() only checks dp->hpd_stopped (not dp->released), out-of-band HPD notifications on cix,sky1-usbdp can also keep queueing HPD work after device removal. Setting dp->released =3D true alongside dp->hpd_stopped =3D true in the fir= st dp->lock critical section of dptx_deinit() closes this window. [Severity: Medium] Can dropping dp->lock before device_link_del() in dptx_deinit() and dptx_bridge_detach() race with device_links_purge()? Both dptx_deinit() and dptx_bridge_detach() clear dp->link under dp->lock, then drop dp->lock before calling device_link_del(link): CPU0 CPU1 dptx_bridge_detach() lock(&dp->lock) link =3D dp->link dp->link =3D NULL unlock(&dp->lock) device_del(dp->dev) bus_remove_device() cix_dptx_remove() -> dptx_deinit() /* sees dp->link =3D=3D NULL */ device_links_purge(dp->dev) __device_link_del(&link->kref) device_link_del(link) <-- double delete / use-after-free The symmetric race happens when dptx_deinit() steals dp->link and drops dp->lock while the consumer device is being deleted. Calling device_link_del(link) while still holding dp->lock (matching device_link_add() in dptx_bridge_attach()) serializes deletion before device_links_purge() can run. [ ... ] > +static const struct dptx_plat_data sky1_usbdp_data =3D { > + .adapter_config =3D cix_dp_usbc_adapter_config, > + .oob_hpd =3D true, > + .max_bw_code =3D DP_LINK_BW_5_4, > +}; > + > +static const struct dptx_plat_data sky1_dp_data =3D { > + .adapter_config =3D cix_dp_native_adapter_config, > + .max_bw_code =3D DP_LINK_BW_5_4, > +}; [Severity: Low] Can setting max_bw_code to DP_LINK_BW_5_4 trigger a 32-bit overflow in dptx_hw_stream_timing_set()? drivers/gpu/drm/bridge/trilinear/dptx_hw.c:dptx_hw_stream_timing_set() { ... dptx_hw_write(hw, DPTX_SECONDARY_DATA_WINDOW(stream_id), (mode->htotal - mode->hdisplay) * (link_rate / 40) * 9 / mode->clock); ... } Because link_rate is u32, this multiplication is evaluated in 32-bit unsigned arithmetic. At 540000 kHz, (link_rate / 40) * 9 is 121500, so any custom mode with horizontal blanking (mode->htotal - mode->hdisplay) of at least 35350 overflows U32_MAX before dividing by mode->clock. Neither dptx_adjust_mode() nor dptx_bridge_atomic_check() bounds horizontal blanking, so this writes a miscalculated secondary data window to hardware. Computing the numerator in 64-bit arithmetic with div_u64() avoids the wraparound. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204074239.1335= 59-1-Luo.Liu@cixtech.com?part=3D5