Re: [PATCH v4 4/5] drm/vc4: dsi: Serialize host transfers
From: Henry Zhang
Date: Wed Nov 18 2026 - 14:47:32 EST
On Wed, Nov 18, 2026 at 10:43 AM Dave Stevenson
<dave.stevenson@xxxxxxxxxxxxxxx> wrote:
> I'll agree that there's an issue, but as it will affect all DSI host
> controllers it feels like it should be handled centrally in the core
> mipi_dsi_device_transfer rather in all the drivers.
>
> One for the core DRM maintainers to comment on. A quick check says it
> would affect at least vc4_dsi, mtk_dsi, mcde_dsi, and cdns-dsi-core.
Agreed: serializing transfers against each other belongs in the core,
if the core maintainers want it there. I can look at that as a separate
patch.
> And your use case is genuine as panel-jdi-lt070me050000.c does exactly
> what you describe with the backlight functions are controlled via DCS
> commands. It would take quite exact timings to update the backlight
> from userspace at the same time it sends the power on init sequence
> though.
In our case it is easier to hit: our panel driver also lets userspace
read panel registers over DSI for test tools, so a second thread can
send at any time, also during a modeset.
> Do we need to take the mutex in any of these functions except
> vc4_dsi_host_transfer?
> This driver will misbehave if you request a host transfer before
> pre_enable or after post_disable. It's been on my list for a while to
> look into that one.
> But I don't believe there is anything in these functions that would
> interrupt a transfer, hence they wouldn't need the mutex.
For transfer-to-transfer serialization alone, the bridge callback
locking can be left out of 4/5. I will separate that from the recovery
requirements in 5/5.
It is 5/5 that needs the bridge callbacks locked. Its recovery runs
inside vc4_dsi_host_transfer(): it saves DISP0_CTRL, resets the block,
restores what pre_enable programmed, and writes DISP0_CTRL back.
Without the lock that could run while post_disable turns the clocks
off or pre_enable programs the timings, and the restore could undo the
DISP0_ENABLE change made by enable or disable. The lock also protects
the enabled flag that 5/5 uses to skip the recovery while the block is
off.
Transfers outside the powered/configured interval retain the existing
behavior; this series does not make them safe. 5/5 skips recovery when
the enabled flag is false.
For the next revision, I propose moving the bridge callback locking
into the recovery patch and explaining it there. If serialization is
handled in the core, the transfer-only patch can be reconsidered. The
recovery still needs a vc4 lock shared by the transfer and bridge
callbacks; a core transfer lock alone would not provide that exclusion.
I will wait for your review of 5/5 and the core maintainers' feedback
before respinning the remaining patches, omitting the applied 1/5.
Thanks,
Henry