OSDN Git Service

drm/bridge: it6505: Improve synchronization between extcon subsystem
authorPin-yen Lin <treapking@chromium.org>
Thu, 13 Oct 2022 11:04:10 +0000 (19:04 +0800)
committerRobert Foss <robert.foss@linaro.org>
Mon, 24 Oct 2022 08:08:49 +0000 (10:08 +0200)
commitab28896f1a831581b0b59ef1f7e6fa64066c2546
tree46fd185687d5de679f5d54571ddfadfb7844fb49
parent5827b1e1c20514fe36b2bb92fab28df088cc2499
drm/bridge: it6505: Improve synchronization between extcon subsystem

Originally, the it6505 relies on a short sleep in the IRQ handler and a
long sleep to make sure it6505->lane_swap and it6505->lane_count is
configured in it6505_extcon_work and it6505_detect, respectively.

Use completion and additional DPCD read to remove the unnecessary waits,
and use a different lock for it6505_extcon_work and the threaded IRQ
handler because they no longer need to run exclusively.

The wait time of the completion is usually less than 10ms in local
experiments, but leave it larger here just in case.

Signed-off-by: Pin-yen Lin <treapking@chromium.org>
Reviewed-by: Robert Foss <robert.foss@linaro.org>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20221013110411.1674359-4-treapking@chromium.org
drivers/gpu/drm/bridge/ite-it6505.c