Skip to content

drm/bridge: tc358762: Set pre_enabled in pre_enable - #7799

Merged
pelwell merged 1 commit into
raspberrypi:rpi-6.18.yfrom
henryzhang62:tc358762-set-pre-enabled
Nov 26, 2026
Merged

pelwell merged 1 commit into
raspberrypi:rpi-6.18.yfrom
henryzhang62:tc358762-set-pre-enabled

Conversation

@henryzhang62

Copy link
Copy Markdown
Contributor

Commit 645dde2 ("drm/bridge: tc358762: revert move ops to enable") moved tc358762_init() back into tc358762_pre_enable() and dropped the ctx->pre_enabled = true assignment that ended the old pre_enable. Mainline v6.18 still has it.

With pre_enabled always false, tc358762_post_disable() returns early every time: vddc is never disabled and the reset GPIO is never asserted again. Unbinding the driver with the display enabled warns:

WARNING: ... at drivers/regulator/core.c:2460 _regulator_put+0x58/0x68
 ...
 devm_regulator_release+0x1c/0x30
 ...
 tc358762_driver_exit+0x18/0x38a0 [tc358762]

This patch sets pre_enabled again at the end of tc358762_pre_enable().

Testing

Raspberry Pi 5, Raspberry Pi 7" Touch Display (v1) on DSI0, 6.18.50-1+rpt1 (built from cff533a, whose tc358762.c is identical to the current rpi-6.18.y one). The patched driver was built out of tree from this file and loaded with insmod. drm-rp1-dsi had #7772 applied, which is needed to re-attach after an unbind.

Each cycle: stop lightdm, rmmod tc358762 panel_simple, load both again, start lightdm, then check dmesg, the bind, the DSI connector and the desktop.

  • Stock tc358762: the _regulator_put warning on unload, both times tried.
  • Patched: no warning in the direct comparison, then
    • 170 cycles with no HDMI monitor: no warnings or errors, DSI-1 back connected and enabled every cycle;
    • 50 cycles with a 4K HDMI monitor on HDMI-A-1: same, and HDMI-A-1 back connected and enabled every cycle.

Not tested: other tc358762 users, and suspend/resume.

Prepared with AI assistance (Claude); I reviewed and tested the change.

Commit 645dde2 ("drm/bridge: tc358762: revert move ops to enable")
moved tc358762_init() from tc358762_enable() back into
tc358762_pre_enable() and dropped the "ctx->pre_enabled = true"
assignment that ended the old pre_enable. Mainline still has it.

pre_enabled now stays false, so tc358762_post_disable() always returns
early: the vddc regulator is enabled on every pre_enable but never
disabled, and the reset GPIO is never asserted again. Unbinding the
driver while the display is enabled then warns in _regulator_put():

  WARNING: ... at drivers/regulator/core.c:2460 _regulator_put+0x58/0x68
  ...
   devm_regulator_release+0x1c/0x30
   ...
   tc358762_driver_exit+0x18/0x38a0 [tc358762]

Set pre_enabled again at the end of tc358762_pre_enable().

Fixes: 645dde2 ("drm/bridge: tc358762: revert move ops to enable")
Signed-off-by: Henry Zhang <henryzhang62@gmail.com>
@pelwell
pelwell merged commit ebb8939 into raspberrypi:rpi-6.18.y Nov 26, 2026
12 checks passed
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Dec 2, 2026
kerne: wifi: rtw89: 8852au: Pass the driver info to rtw89_usb_probe()

kernel: arm64: dts: bcm2712-ds: Remove downstream duplication
See: raspberrypi/linux#7797

kernel: drm/bridge: tc358762: Set pre_enabled in pre_enable
See: raspberrypi/linux#7799

kernel: drm/vc4: Fix the zpos range of the writeback overlay planes
See: raspberrypi/linux#7800

kernel: HEVC decode - fix a whole lot of security holes and misc issues
See: raspberrypi/linux#7780

kernel: ARM: uaccess_with_memcpy: don't retry forever when a page can't be pinned
See: raspberrypi/linux#7811

kernel: ams/rpi 6.18.y/mira upstream
See: raspberrypi/linux#7802
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Dec 2, 2026
kerne: wifi: rtw89: 8852au: Pass the driver info to rtw89_usb_probe()

kernel: arm64: dts: bcm2712-ds: Remove downstream duplication
See: raspberrypi/linux#7797

kernel: drm/bridge: tc358762: Set pre_enabled in pre_enable
See: raspberrypi/linux#7799

kernel: drm/vc4: Fix the zpos range of the writeback overlay planes
See: raspberrypi/linux#7800

kernel: HEVC decode - fix a whole lot of security holes and misc issues
See: raspberrypi/linux#7780

kernel: ARM: uaccess_with_memcpy: don't retry forever when a page can't be pinned
See: raspberrypi/linux#7811

kernel: ams/rpi 6.18.y/mira upstream
See: raspberrypi/linux#7802
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants