]> git.baikalelectronics.ru Git - kernel.git/commit
Revert "drm: bridge: analogix/dp: add panel prepare/unprepare in suspend/resume time"
authorBrian Norris <briannorris@chromium.org>
Tue, 23 Aug 2022 01:08:04 +0000 (18:08 -0700)
committerDouglas Anderson <dianders@chromium.org>
Fri, 23 Sep 2022 14:15:18 +0000 (07:15 -0700)
commit5c289addee8fe4b7838209f4928c5f155e694e0a
treea52f1e02941fd21a30f7ccef4e8bb9fab2663894
parent7776cef9003ea95ac9c561df6e5c94f5a6d8f238
Revert "drm: bridge: analogix/dp: add panel prepare/unprepare in suspend/resume time"

This reverts commit 1818f1b58a7ba6400f5460d14f1b000d7ca2a503.

For quite some time, core DRM helpers already ensure that any relevant
connectors/CRTCs/etc. are disabled, as well as their associated
components (e.g., bridges) when suspending the system. Thus,
analogix_dp_bridge_{enable,disable}() already get called, which in turn
call drm_panel_{prepare,unprepare}(). This makes these drm_panel_*()
calls redundant.

Besides redundancy, there are a few problems with this handling:

(1) drm_panel_{prepare,unprepare}() are *not* reference-counted APIs and
are not in general designed to be handled by multiple callers --
although some panel drivers have a coarse 'prepared' flag that mitigates
some damage, at least. So at a minimum this is redundant and confusing,
but in some cases, this could be actively harmful.

(2) The error-handling is a bit non-standard. We ignored errors in
suspend(), but handled errors in resume(). And recently, people noticed
that the clk handling is unbalanced in error paths, and getting *that*
right is not actually trivial, given the current way errors are mostly
ignored.

(3) In the particular way analogix_dp_{suspend,resume}() get used (e.g.,
in rockchip_dp_*(), as a late/early callback), we don't necessarily have
a proper PM relationship between the DP/bridge device and the panel
device. So while the DP bridge gets resumed, the panel's parent device
(e.g., platform_device) may still be suspended, and so any prepare()
calls may fail.

So remove the superfluous, possibly-harmful suspend()/resume() handling
of panel state.

Fixes: 1818f1b58a7b ("drm: bridge: analogix/dp: add panel prepare/unprepare in suspend/resume time")
Link: https://lore.kernel.org/all/Yv2CPBD3Picg%2FgVe@google.com/
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220822180729.1.I8ac5abe3a4c1c6fd5c061686c6e883c22f69022c@changeid
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c