Skip to contentSkip to conversation

Add Lontium LT7911EXC eDP to MIPI DSI bridge

PATCH Superseded [email protected] 2 participants 5 messages Jul 14

Subsystems (4)

v15 of 17 Superseded Latest is v17 →

lore
Share & tools
lore
#0 lore raw

v15 cover Add Lontium LT7911EXC eDP to MIPI DSI bridge

From: Sunyun Yang <[email protected]>

The LT7911EXC is an I2C-controlled bridge that receives eDP1.4 and output mipi dsi. This series introduces:

- A device tree binding YAML file describing the hardware
- A new DRM bridge driver implementing the basic functionality

---
Change in v15:
- dt-binding:
- drm/bridge:
1. Remove the Reviewed-by: Dmitry Baryshkov <[email protected]> tag.
2. Adjust the design architecture of the chip's MIPI host and bridge.
3. remove devm_drm_panel_bridge_add_typed and drm_of_find_panel_or_bridge
4. Use REGCACHE_NONE to avoid cache inconsistency due to internal MCU modifying registers asynchronously
- Link to v14: https://lore.kernel.org/all/[email protected]/

Change in v14:
- dt-binding:
- drm/bridge:
1. [High] AB-BA / self-deadlock between the bridge's ocm_lock and DRM modeset [sashiko-bot]
locks during hotplug notification. - fixed
2. [High] Freeing the panel bridge in lt7911exc_dsi_host_detach while it is still attached to the DRM bridge chain causes a Use-After-Free. - fixed
- Link to v13: https://lore.kernel.org/lkml/[email protected]/

Change in v13:
- dt-binding:
- drm/bridge:
1. [High] Dangling pointer created during MIPI DSI host detach if the downstream [sashiko-bot]
device is a bridge rather than a panel. - fixed
2. [High] Firmware upgrade CRC mismatch due to unpadded partial page writes.
- hardware erases the entire flash area into a default state of 0xff. When doing a partial page short write,the total unwritten residual bytes on the physical flash sector inherently retain their 0xff state. Therefore, no modification is required.
3. [High] Firmware upgrade workqueue accesses bridge.dev without ensuring the DRM device is alive, leading to a Use-After-Free. - fixed
4. [High] Regmap page selector cache desynchronization after device reset causes firmware upgrade commands to be routed to the wrong register page. - fixed
- Link to v12: https://lore.kernel.org/lkml/[email protected]/

Change in v12:
- dt-binding:
- drm/bridge:
1. Move the cleanup work of drm_panel_bridge_remove() forward into lt7911exc_dsi_host_detach(). [sashiko-bot]
2. Do not hold any lock during lt7911exc_reset().
- Link to v11: https://lore.kernel.org/lkml/[email protected]/

Change in v11:
- dt-binding:
- drm/bridge:
1. Removed Reviewed-by, we would appreciate it if the maintainer could help review this.
2. Use devm_gpiod_get(,, GPIOD_OUT_HIGH) to fix the reset GPIO backpowering issue. [sashiko-bot]
3. Fixed Use-After-Free vulnerability due to dynamic DRM bridge removal in DSI detach callback.
4. Fixed Use-After-Free of regmap during DRM teardown because firmware upgrade worker defeats removal safeguard.
5. Fixed firmware upgrade performs a hardware reset, causing silent loss of DRM state and a blank screen.
6. Use of kmalloc for a 64KB software buffer is susceptible to memory fragmentation failures - Fix by using kvmalloc
7. Use the 'lt7911exc->ocm_lock' mutex and the 'lt7911exc->upgrade' flag to resolve the race condition between DRM atomic modeset and firmware upgrade.
8. Use the 'lt7911exc->upgrade_lock' mutex to prevent redundant upgrades.
9. Use the 'lt7911exc->removed' flag to prevent the driver from being triggered to upgrade during the unload process.
- Link to v10: https://lore.kernel.org/lkml/[email protected]/

Change in v10:
- dt-binding:
- drm/bridge:
1. Fixed the firmware upgrade error paths to always clear the upgrade
flag before returning, including firmware size validation failures
and allocation failures. [sashiko-bot]
2. Added proper locking in lt7911exc_atomic_pre_enable() and lt7911exc_atomic_post_disable() to serialize register accesses with the firmware upgrade flow and avoid concurrent I2C transactions.
3. Added an exclusivity check in lt7911exc_dsi_host_attach() to reject multiple downstream attachments and prevent repeated drm_bridge_add() calls and panel bridge leaks.
4. Reworked lt7911exc_firmware_store() to use mutex_trylock() so concurrent sysfs writers immediately return -EBUSY instead of blocking behind an active firmware upgrade.
5. Updated the remove path to prevent new firmware upgrade work from being queued after device removal by setting the upgrade state before cancelling the worker.
- Link to v9: https://lore.kernel.org/lkml/[email protected]/

Change in v9:
- dt-binding:
- drm/bridge:
1. DSI transfer callback returns success for reads without populating [sashiko-bot]
the receive buffer, leaking uninitialized memory. - fixed it by implementing a strict whitelist mechanism.
2. DSI transfer callback polls for eDP video readiness before the
upstream encoder is enabled, guaranteeing a timeout. - removed
3. The driver attempts I2C transfers while the hardware is held in
physical reset. - fixed
4. Missing DRM_MIPI_DSI Kconfig dependency causes linker errors. - fixed
5. request_firmware is called while holding the hardware lock and
halting the MCU, risking a system pipeline stall. - fixed
6. Sleeping functions are called from atomic context in the DRM bridge callbacks. - fixed
7. lt7911exc_dsi_host_transfer bypasses the required MCU hardware halt sequence. - fixed by internal firmware controls the panel initialization sequence and handles all MIPI DSI command transmission.
- Link to v8: https://lore.kernel.org/lkml/[email protected]/

Change in v8:
- dt-binding:
- drm/bridge:
1. Protect firmware upgrade and DRM bridge callback paths with ocm_lock. [sashiko-bot]
2. Remove the hardware reset from the remove callback, and ensure that all hardware reset operations are protected by ocm_lock.
3. crc reconstruction explicitly casts each byte to u32 before shifting
4. The display configuration is handled by the firmware, and the MIPI DSI host registration issue has been fixed.
5. The batch register read/write operations have already been updated to include return value checking.
6. The dev_err_probe() used outside of probe context has been fixed.
- Link to v7: https://lore.kernel.org/lkml/[email protected]/

Change in v7:
- dt-binding:
1. fix commit message typos(Receiver、signal) [sashiko-bot]
2. remove the ambiguity caused by "signal/dual".
- drm/bridge:
1. using devm_regulator_get_enable avoids power leaks. [sashiko-bot]
2. set reset gpio is low after cutting off power in lt7911exc_remove function, avoid backpowering.
3. synchronous request_firmware() call cause a permanent probe failure if the driver is built-in, probe executes before the root filesystem is mounted, which would cause this to fail with -ENOENT, we have removed this functionality. Use trigger to upgrade.
4. add depends on I2C and select REGMAP_I2C in Kconfig.
5. add return value of devm_drm_bridge_add() in probe().
6. add directly header files (linux/slab.h, linux/delay.h, linux/regulator/consumer.h)
- Link to v6: https://lore.kernel.org/lkml/[email protected]/

Change in v6:
- dt-binding:
- drm/bridge:
1. use #define FW_FILE "Lontium/lt7911exc_fw.bin" to match linux-firmware
- Link to v5: https://lore.kernel.org/lkml/[email protected]/

Change in v5:
- dt-binding:
- drm/bridge:
1. Change "mipi" to "mipi dsi" in the commit message. [Dmitry]
2. Change "eDP/MIPI" to "eDP/MIPI DSI" in Kconfig.
- Link to v4: https://lore.kernel.org/lkml/[email protected]/

Change in v4:
- dt-binding:
1. Fix the missing spaces on the "subject". [Krzysztof]
2. Fix the error descriptions for port@0 and port@1.
- drm/bridge:
- Link to v3: https://lore.kernel.org/lkml/[email protected]/

Change in v3:
- dt-binding:
- drm/bridge:
1. already submit lt7911exc_fw.bin to linux-firmware. [Dmitry]
2. remove lt7911exc_remove function.
3. drop the "lontium, " in lt7911exc_i2c_table.
- Link to v2: https://lore.kernel.org/lkml/[email protected]/

Change in v2:
- dt-binding:
1. reset pins use active low. [Dmitry]
- drm/bridge:
1. use atomic_* callbacks. [Quentin]
2. fix the incorrect formatting and spaces.
3. add the required header files. [Dmitry]
4. remove "enabled" flag.
5. remove *fw from the lt7911exc struct.
6. .max_register and .range_max use actual range.
7. regulator use bulk interface.
8. use dev_err_probe, devm_mutex_init and devm_drm_bridge_add.
9. Replace GPL v2 with GPL.
- Link to v1: https://lore.kernel.org/lkml/[email protected]/

---
Sunyun Yang (2):
dt-bindings: bridge: Add Lontium LT7911EXC eDP to MIPI DSI bridge drm/bridge: Add Lontium LT7911EXC eDP to MIPI DSI bridge

 .../display/bridge/lontium,lt7911exc.yaml     |  89 ++
 drivers/gpu/drm/bridge/Kconfig                |  17 +
 drivers/gpu/drm/bridge/Makefile               |   1 +
 drivers/gpu/drm/bridge/lontium-lt7911exc.c    | 770 ++++++++++++++++++
 4 files changed, 877 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/lontium,lt7911exc.yaml
 create mode 100644 drivers/gpu/drm/bridge/lontium-lt7911exc.c
Signature · 1 line
2.34.1
#1 lore raw

PATCH v15 1/2 dt-bindings: bridge: Add Lontium LT7911EXC eDP to MIPI DSI bridge

From: Sunyun Yang <[email protected]>

This commit adds the device tree binding schema for the Lontium LT7911EXC. This device is an I2C-controlled bridge that converts eDP 1.4 input to MIPI DSI output.

---
 .../display/bridge/lontium,lt7911exc.yaml     | 89 +++++++++++++++++++
 1 file changed, 89 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/lontium,lt7911exc.yaml
Documentation/devicetree/bindings/display/bridge/lontium,lt7911exc.yaml new file +89 -0
new file mode 100644
index 000000000..3290b10ce
@@ -0,0 +1,89 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/bridge/lontium,lt7911exc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Lontium LT7911EXC eDP to MIPI DSI Bridge
+
+maintainers:
+  - Sunyun Yang <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - lontium,lt7911exc
+
+  reg:
+    maxItems: 1
+
+  reset-gpios:
+    maxItems: 1
+    description: GPIO connected to RST_ pin.
+
+  vdd-supply:
+    description: Regulator for 1.2V MIPI phy power.
+
+  vcc-supply:
+    description: Regulator for 3.3V IO power.
+
+  ports:
+    $ref: /schemas/graph.yaml#/properties/ports
+
+    properties:
+      port@0:
+        $ref: /schemas/graph.yaml#/properties/port
+        description: Video port for eDP input.
+
+      port@1:
+        $ref: /schemas/graph.yaml#/properties/port
+        description: Video port for MIPI DSI output.
+
+    required:
+      - port@0
+      - port@1
+
+required:
+  - compatible
+  - reg
+  - reset-gpios
+  - vdd-supply
+  - vcc-supply
+  - ports
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        mipi-bridge@41 {
+            compatible = "lontium,lt7911exc";
+            reg = <0x41>;
+            reset-gpios = <&gpy8 8 GPIO_ACTIVE_LOW>;
+            vdd-supply = <&lt7911exc_1v2>;
+            vcc-supply = <&lt7911exc_3v3>;
+
+            ports {
+                #address-cells = <1>;
+                #size-cells = <0>;
+
+                port@0 {
+                    reg = <0>;
+                    bridge_in: endpoint {
+                        remote-endpoint = <&edp_out>;
+                    };
+                };
+
+                port@1 {
+                    reg = <1>;
+                    bridge_out: endpoint {
+                        remote-endpoint = <&panel_in>;
+                    };
+                };
+            };
+        };
+    };
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH v15 1/2] dt-bindings: bridge: Add Lontium LT7911EXC eDP to MIPI DSI bridge

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] Non-standard generic node name used in the device tree example. The Devicetree specification…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Non-standard generic node name used in the device tree example. The Devicetree specification recommends using standard generic names for device nodes to represent the class of the device rather than the specific model or bus type (e.g., bridge@ instead of mipi-bridge@). --

--- Patch [1]: [PATCH v15 1/2] dt-bindings: bridge: Add Lontium LT7911EXC eDP to MIPI DSI bridge --- commit 5c0643686f137815285d63f46eecfcaaaad55330
Author: Sunyun Yang <[email protected]>

dt-bindings: bridge: Add Lontium LT7911EXC eDP to MIPI DSI bridge

This commit adds the device tree binding schema for the Lontium LT7911EXC. It documents an I2C-controlled bridge that converts eDP 1.4 input to MIPI DSI output.

Quoted 5 lines
Documentation/devicetree/bindings/display/bridge/lontium,lt7911exc.yaml new file +0 -0
new file mode 100644
index 0000000000000..3290b10ce8835

[ ... ]

Documentation/devicetree/bindings/display/bridge/lontium,lt7911exc.yaml line 63

Quoted 8 lines
Documentation/devicetree/bindings/display/bridge/lontium,lt7911exc.yaml new file +8 -0
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        mipi-bridge@41 {

[Severity: Low]
This isn't a bug, but should this node name use a standard generic name like bridge@41 instead of mipi-bridge@41? The Devicetree specification recommends using standard generic names to represent the class of the device rather than the specific bus type, which helps avoid dt-schema warnings.

Quoted 3 lines
Documentation/devicetree/bindings/display/bridge/lontium,lt7911exc.yaml new file +3 -0
+            compatible = "lontium,lt7911exc";
+            reg = <0x41>;
+            reset-gpios = <&gpy8 8 GPIO_ACTIVE_LOW>;

[ ... ]

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
#3 lore raw

PATCH v15 2/2 drm/bridge: Add Lontium LT7911EXC eDP to MIPI DSI bridge

In reply to [email protected]

From: Sunyun Yang <[email protected]>

Add support for the Lontium LT7911EXC bridge chip, which converts eDP input to MIPI DSI output using an internal firmware-controlled pipeline.

The driver provides:
- DRM bridge integration for eDP-to-DSI routing
- MIPI DSI host interface for downstream panel attachment
- Firmware upgrade mechanism over I2C (erase/program/verify)
- GPIO-based reset and regulator management

Display timing and MIPI DCS packet generation are handled by the chip firmware and are not configured by the driver.

---
 drivers/gpu/drm/bridge/Kconfig             |  17 +
 drivers/gpu/drm/bridge/Makefile            |   1 +
 drivers/gpu/drm/bridge/lontium-lt7911exc.c | 770 +++++++++++++++++++++
 3 files changed, 788 insertions(+)
 create mode 100644 drivers/gpu/drm/bridge/lontium-lt7911exc.c
drivers/gpu/drm/bridge/Kconfig +17 -0
index 4a57d49b4..ddf1143a6 100644
@@ -132,6 +132,23 @@ config DRM_ITE_IT6505
 	help
 	  ITE IT6505 DisplayPort bridge chip driver.
 
+config DRM_LONTIUM_LT7911EXC
+	tristate "Lontium LT7911EXC eDP/MIPI DSI bridge"
+	depends on OF
+	depends on I2C
+	select CRC32
+	select DRM_PANEL_BRIDGE
+	select DRM_MIPI_DSI
+	select DRM_KMS_HELPER
+	select FW_LOADER
+	select REGMAP_I2C
+	select REGULATOR
+	help
+	  DRM driver for the Lontium LT7911EXC bridge
+	  chip. The LT7911EXC converts eDP input to MIPI
+	  DSI output.
+	  Please say Y if you have such hardware.
+
 config DRM_LONTIUM_LT8912B
 	tristate "Lontium LT8912B DSI/HDMI bridge"
 	depends on OF
drivers/gpu/drm/bridge/Makefile +1 -0
index 15cc821d8..e94def6c0 100644
@@ -13,6 +13,7 @@ obj-$(CONFIG_DRM_I2C_NXP_TDA998X) += tda998x.o
 obj-$(CONFIG_DRM_INNO_HDMI) += inno-hdmi.o
 obj-$(CONFIG_DRM_ITE_IT6263) += ite-it6263.o
 obj-$(CONFIG_DRM_ITE_IT6505) += ite-it6505.o
+obj-$(CONFIG_DRM_LONTIUM_LT7911EXC) += lontium-lt7911exc.o
 obj-$(CONFIG_DRM_LONTIUM_LT8912B) += lontium-lt8912b.o
 obj-$(CONFIG_DRM_LONTIUM_LT9211) += lontium-lt9211.o
 obj-$(CONFIG_DRM_LONTIUM_LT9611) += lontium-lt9611.o
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +770 -0

770 lines not on this page · raw message

Signature · 1 line
2.34.1
#4 lore raw

Re: [PATCH v15 2/2] drm/bridge: Add Lontium LT7911EXC eDP to MIPI DSI bridge

Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider: - [High] `devm_drm_of_get_bridge()` in the hot-pluggable `lt7911exc_dsi_host_attach()` callback leaks…

Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:
- [High] devm_drm_of_get_bridge() in the hot-pluggable lt7911exc_dsi_host_attach() callback leaks devres memory and causes use-after-free upon panel unbind/rebind.
- [High] Double removal of the DRM bridge due to a flawed list_empty check in lt7911exc_remove(), leading to double mutex destruction and use-after-free.
- [High] Firmware upgrade clears the upgrade flag AFTER sending the hotplug event, causing potential modesets to fail silently.
- [Medium] Direct mutation of pre_enable_prev_first on an external drm_bridge object owned by a downstream driver.
--

--- Patch [2]: [PATCH v15 2/2] drm/bridge: Add Lontium LT7911EXC eDP to MIPI DSI bridge --- commit 4c1fba2c711f35f533a59a3680b0b1fda9a82f94
Author: Sunyun Yang <[email protected]>

drm/bridge: Add Lontium LT7911EXC eDP to MIPI DSI bridge

Add support for the Lontium LT7911EXC bridge chip, which converts eDP input to MIPI DSI output using an internal firmware-controlled pipeline.

Quoted 4 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +0 -0
new file mode 100644

[ ... ]

Quoted 2 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +2 -0
+static void lt7911exc_firmware_upgrade_work(struct work_struct *work)
+{

[ ... ]

drivers/gpu/drm/bridge/lontium-lt7911exc.c line 444

Quoted 6 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +6 -0
+	if (ret)
+		dev_err(dev, "failed to read version after upgrade\n");
+
+	/* Notify DRM to re-trigger modeset after firmware upgrade */
+	if (lt7911exc->bridge.dev)
+		drm_kms_helper_hotplug_event(lt7911exc->bridge.dev);

[Severity: High]
Could this hotplug event fire before the upgrade flag is cleared?

Since drm_kms_helper_hotplug_event() triggers modesets synchronously (or fast async), it might call lt7911exc_atomic_pre_enable() while lt7911exc->upgrade is still true. If that happens, pre_enable() will silently skip writing the hardware enable registers, resulting in a black screen.

Would it be safer to clear the upgrade flag before firing the hotplug event?

Quoted 17 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +17 -0
+
+	goto out_release_fw;
+
+out_mcu_run:
+	scoped_guard(mutex, &lt7911exc->ocm_lock)
+		lt7911exc_inside_mcu_run(lt7911exc);
+
+out_release_fw:
+	release_firmware(fw);
+
+out_unlock_upgrade:
+	scoped_guard(mutex, &lt7911exc->ocm_lock) {
+		if (!lt7911exc->removed)
+			lt7911exc->upgrade = false;
+	}
+	mutex_unlock(&lt7911exc->upgrade_lock);
+}

[ ... ]

drivers/gpu/drm/bridge/lontium-lt7911exc.c line 521

Quoted 10 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +10 -0
+static int lt7911exc_dsi_host_attach(struct mipi_dsi_host *host, struct mipi_dsi_device *dev)
+{
+	struct lt7911exc *lt7911exc = dsi_host_to_lt7911exc(host);
+
+	if (dev->lanes > 4) {
+		dev_err(lt7911exc->dev, "unsupported number of data lanes(%u)\n", dev->lanes);
+		return -EINVAL;
+	}
+
+	lt7911exc->output_bridge = devm_drm_of_get_bridge(lt7911exc->dev, host->dev->of_node, 1, 0);

[Severity: High]
Could this devm allocation leak devres memory and cause a use-after-free?

The devm_drm_of_get_bridge() allocation is tied to the host device (lt7911exc->dev), but it runs in lt7911exc_dsi_host_attach() which can be called repeatedly if the downstream DSI panel is unbound and rebound.

Because the allocation is tied to the host device, it won't be freed until the host driver unbinds. This leaks memory on every panel rebind. Also, the retained drm_panel_bridge will hold a dangling pointer after the panel is destroyed, risking a use-after-free if accessed later.

drivers/gpu/drm/bridge/lontium-lt7911exc.c line 531

Quoted 10 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +10 -0
+	if (IS_ERR(lt7911exc->output_bridge))
+		return PTR_ERR(lt7911exc->output_bridge);
+
+	/*
+	 * LT7911EXC requires the panel to be powered and ready before
+	 * enabling MIPI DSI output. Keep default order (panel first)
+	 * regardless of panel's prepare_prev_first setting, since the
+	 * chip's internal firmware handles panel initialization.
+	 */
+	lt7911exc->output_bridge->pre_enable_prev_first = false;

[Severity: Medium]
Is it safe to directly mutate the state of an external bridge object?

This output_bridge is owned and managed by the downstream driver. Setting its pre_enable_prev_first field from this host driver violates object ownership and could override necessary configuration expected by the downstream driver.

Quoted 5 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +5 -0
+
+	drm_bridge_add(&lt7911exc->bridge);
+
+	return 0;
+}

[ ... ]

Quoted 11 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +11 -0
+static void lt7911exc_remove(struct i2c_client *client)
+{
+	struct device *dev = &client->dev;
+	struct lt7911exc *lt7911exc = dev_get_drvdata(dev);
+
+	if (!lt7911exc)
+		return;
+
+	scoped_guard(mutex, &lt7911exc->ocm_lock) {
+		lt7911exc->removed = true;
+		lt7911exc->upgrade = true;

drivers/gpu/drm/bridge/lontium-lt7911exc.c line 737

Quoted 10 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +10 -0
+	}
+
+	cancel_work_sync(&lt7911exc->work);
+
+	dev_set_drvdata(dev, NULL);
+
+	mipi_dsi_host_unregister(&lt7911exc->dsi_host);
+
+	if (!list_empty(&lt7911exc->bridge.list))
+		drm_bridge_remove(&lt7911exc->bridge);

[Severity: High]
Will this result in a double free of the bridge?

During module unload, mipi_dsi_host_unregister() detaches all DSI children, which calls lt7911exc_dsi_host_detach(). That explicitly calls drm_bridge_remove() and moves the list node to the global bridge_lingering_list.

When execution reaches this list_empty() check, it will evaluate to false because the node is on the lingering list (and its next pointer isn't pointing to itself). This causes drm_bridge_remove() to be erroneously called a second time on the same bridge, leading to a double free and double mutex_destroy().

Quoted 3 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +3 -0
+
+	gpiod_set_value_cansleep(lt7911exc->reset_gpio, 1);
+}
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2