From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7A0F6606A32E for ; Tue, 1 Dec 2026 06:06: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=fGEKIsDg Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D2EBE10E679; Tue, 1 Dec 2026 06:06:53 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id EA8D910E679 for ; Tue, 1 Dec 2026 06:06:47 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id BB37D42DF0; Tue, 1 Dec 2026 06:06:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D46F31F0089A; Tue, 1 Dec 2026 06:06:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796105207; bh=wzBQNcVMsMXWqjjkH9wvU3Rg15+WWGFhtGU9eHlPk8M=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=fGEKIsDgVhMGaI14BXqVyZ4NGJPZvr3RA1D5WhoNBAg20pHn94hd5BDq+7BNm8aL2 qRgBNPdTKtmQBp4yJFNHjv8ECOVq8AgB6N/7iGXih8bnJ1PMx462v5VUg1XZx/OO33 6s7GAfTT7JRQKLHLmE0KRzBh6L/YfTCHmsM4LNceLdQEbQBM4VY1uK9uG3CYTQkeFQ 8XQ88qyNnWQ84xQWl2DTo0VcdwK5PibR1tEfirGdYGnDsZjy4HlDL49PumiPfDgv0x 4kabkL9VVyw0VajD48aMzTFSnKqgWT19zMe9rw6ZkHbb5rcMrBwqP9I/FA7btXaEA0 6UIjMKUH6VVXw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v20 2/2] drm/bridge: Add Lontium LT9611C(EX/UXD) MIPI DSI to HDMI driver To: mohit.dsor@oss.qualcomm.com Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org In-Reply-To: <20261201-lt9611c-v7-v20-2-fbe0e5581b4f@oss.qualcomm.com> References: <20261201-lt9611c-v7-v20-0-fbe0e5581b4f@oss.qualcomm.com> <20261201-lt9611c-v7-v20-2-fbe0e5581b4f@oss.qualcomm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 06:06:46 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "dri-devel" X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 3 potential issues to consider: - [High] drm/bridge: missing HDMI 2.0 scrambler callbacks in lt9611c_bridge_funcs - [Medium] drm/bridge: lt9611c: broken PM suspend/resume ordering and HPD notification - [Low] drm/bridge: mixed __free() and goto error handling in lt9611c_probe() -- commit b7c34121ab3b82f687b0cfa86b801eb2897b3aa6 Author: Sunyun Yang drm/bridge: Add Lontium LT9611C(EX/UXD) MIPI DSI to HDMI driver This commit adds a DRM bridge driver for the Lontium LT9611C, LT9611EX, and LT9611UXD MIPI DSI to HDMI bridge chips, including support for EDID reading, HPD detection, HDMI audio, dual-DSI mode, and firmware upgrades via sysfs. > diff --git a/drivers/gpu/drm/bridge/lontium-lt9611c.c b/drivers/gpu/drm/b= ridge/lontium-lt9611c.c > new file mode 100644 > index 0000000000000..443981bec923e > --- /dev/null > +++ b/drivers/gpu/drm/bridge/lontium-lt9611c.c [ ... ] > +static const struct drm_bridge_funcs lt9611c_bridge_funcs =3D { > + .attach =3D lt9611c_bridge_attach, > + .detect =3D lt9611c_bridge_detect, > + .edid_read =3D lt9611c_bridge_edid_read, > + .atomic_enable =3D lt9611c_bridge_atomic_enable, > + .atomic_duplicate_state =3D drm_atomic_helper_bridge_duplicate_state, > + .atomic_destroy_state =3D drm_atomic_helper_bridge_destroy_state, > + .atomic_create_state =3D drm_atomic_helper_bridge_create_state, > + > + .hdmi_tmds_char_rate_valid =3D lt9611c_hdmi_tmds_char_rate_valid, > + .hdmi_write_avi_infoframe =3D lt9611c_hdmi_write_avi_infoframe, > + .hdmi_clear_avi_infoframe =3D lt9611c_hdmi_clear_avi_infoframe, > + .hdmi_write_hdmi_infoframe =3D lt9611c_hdmi_write_hdmi_infoframe, > + .hdmi_clear_hdmi_infoframe =3D lt9611c_hdmi_clear_hdmi_infoframe, > + .hdmi_write_audio_infoframe =3D lt9611c_hdmi_write_audio_infoframe, > + .hdmi_clear_audio_infoframe =3D lt9611c_hdmi_clear_audio_infoframe, > + > + .hdmi_audio_prepare =3D lt9611c_hdmi_audio_prepare, > + .hdmi_audio_shutdown =3D lt9611c_hdmi_audio_shutdown, > +}; [Severity: High] Does connector initialization always fail with -EINVAL on LT9611UXD because lt9611c_bridge_funcs is missing .hdmi_scrambler_enable and .hdmi_scrambler_disable? In lt9611c_probe(), the driver sets DRM_BRIDGE_OP_HDMI in bridge.ops and se= ts bridge.supported_hdmi_ver to HDMI_VERSION_2_0 for CHIP_LT9611UXD, while lt9611c_bridge_attach() requires DRM_BRIDGE_ATTACH_NO_CONNECTOR. When the display driver initializes the connector, drm_bridge_connector_init() rejec= ts any HDMI_VERSION_2_0 bridge that lacks the scrambler callbacks: drivers/gpu/drm/display/drm_bridge_connector.c:drm_bridge_connector_init() { ... if (bridge->supported_hdmi_ver >=3D HDMI_VERSION_2_0 && (!bridge->funcs->hdmi_scrambler_enable || !bridge->funcs->hdmi_scrambler_disable)) return ERR_PTR(-EINVAL); ... } This breaks display pipeline probe on all lontium,lt9611uxd devices. [ ... ] > +static int lt9611c_probe(struct i2c_client *client) > +{ > + struct lt9611c *lt9611c; > + struct device *dev =3D &client->dev; > + struct device_node *dsi0_node __free(device_node) =3D NULL; > + struct device_node *dsi1_node __free(device_node) =3D NULL; > + struct mipi_dsi_device *dsi; > + int ret; [ ... ] > +err_remove_bridge: > + drm_bridge_remove(<9611c->bridge); > + cancel_work_sync(<9611c->work); > + > +err_disable_regulators: > + regulator_bulk_disable(ARRAY_SIZE(lt9611c->supplies), lt9611c->supplies= ); > + > + return ret; > +} [Severity: Low] This isn't a bug, but lt9611c_probe() declares dsi0_node and dsi1_node with __free(device_node) =3D NULL at the top of the function for later assignment while using goto labels for the rest of its error unwinding. Per cleanup.h conventions, __free() variables should be defined and initialized in a sing= le statement and not mixed with goto-based cleanup in the same function. [ ... ] > +static int lt9611c_bridge_suspend(struct device *dev) > +{ > + struct lt9611c *lt9611c =3D dev_get_drvdata(dev); > + int ret; > + > + disable_irq(lt9611c->client->irq); > + cancel_work_sync(<9611c->work); > + > + mutex_lock(<9611c->mcu_lock); > + gpiod_set_value_cansleep(lt9611c->reset_gpio, 1); > + ret =3D regulator_bulk_disable(ARRAY_SIZE(lt9611c->supplies), lt9611c->= supplies); > + if (ret) { > + dev_err(lt9611c->dev, "regulator bulk disable failed\n"); > + gpiod_set_value_cansleep(lt9611c->reset_gpio, 0); > + msleep(400); > + mutex_unlock(<9611c->mcu_lock); > + enable_irq(lt9611c->client->irq); > + return ret; > + } > + mutex_unlock(<9611c->mcu_lock); > + > + return 0; > +} > + > +static int lt9611c_bridge_resume(struct device *dev) > +{ > + struct lt9611c *lt9611c =3D dev_get_drvdata(dev); > + int ret; > + > + ret =3D regulator_bulk_enable(ARRAY_SIZE(lt9611c->supplies), lt9611c->s= upplies); > + if (ret) { > + dev_err(lt9611c->dev, "regulator bulk enable failed\n"); > + return ret; > + } > + > + mutex_lock(<9611c->mcu_lock); > + lt9611c_reset(lt9611c); > + mutex_unlock(<9611c->mcu_lock); > + > + enable_irq(lt9611c->client->irq); > + > + /* > + * Re-read HPD after reset so cable changes during suspend are not > + * missed. lt9611c_detect_hpd() acquires mcu_lock internally. > + */ > + drm_bridge_hpd_notify(<9611c->bridge, > + lt9611c_detect_hpd(lt9611c, 0)); > + > + return 0; > +} [Severity: Medium] As reported by Dmitry Baryshkov on v7 [1], can system suspend and resume dr= op hotplug changes or leave the bridge unconfigured after resume? During suspend, drm_mode_config_helper_suspend() calls drm_bridge_hpd_disable(), which clears bridge.hpd_cb to NULL until drm_mode_config_helper_resume() re-enables HPD polling. When lt9611c_bridge_resume() runs before drm_mode_config_helper_resume() (for example on DRM drivers that suspend in .prepare and resume in .complete), drm_bridge_hpd_notify() sees bridge.hpd_cb =3D=3D NULL and drops the notification, so cable changes during suspend are still lost. Conversely, because the bidirectional OF graph links between the DSI host a= nd lt9611c form a cycle that fw_devlink relaxes to DL_FLAG_SYNC_STATE_ONLY and no PM device link orders lt9611c before the DRM device, DRM drivers that ca= ll drm_mode_config_helper_resume() from their .resume callback can run lt9611c_bridge_atomic_enable() while lt9611c is still powered off in reset, after which lt9611c_bridge_resume() resets the chip into an unconfigured state. [1] https://lore.kernel.org/r/4t3bar2svwex4wojumql2t66ivtj6bsxnt7pgmygnc7og= 4zquh@fs7wdd4k4cjp --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201-lt9611c-v7= -v20-0-fbe0e5581b4f@oss.qualcomm.com?part=3D2