FROMLIST: drm/bridge: analogix: protect power when get_modes or detect
authorMark Yao <mark.yao@rock-chips.com>
Wed, 12 Oct 2016 10:03:08 +0000 (18:03 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Thu, 13 Oct 2016 02:13:26 +0000 (10:13 +0800)
commit22e5631e6317f91a286be17d940efbb2563171f4
tree05568dcbed6b5f5fa0d14643fb71f5811e7e66ec
parentec6b18cab9d06328b140199eac684c5f5863a910
FROMLIST: drm/bridge: analogix: protect power when get_modes or detect

The drm callback ->detect and ->get_modes seems is not power safe,
they may be called when device is power off, do register access on
detect or get_modes will cause system die.

Here is the path call ->detect before analogix_dp power on
[<ffffff800843babc>] analogix_dp_detect+0x44/0xdc
[<ffffff80083fd840>] drm_helper_probe_single_connector_modes_merge_bits+0xe8/0x41c
[<ffffff80083fdb84>] drm_helper_probe_single_connector_modes+0x10/0x18
[<ffffff8008418d24>] drm_mode_getconnector+0xf4/0x304
[<ffffff800840cff0>] drm_ioctl+0x23c/0x390
[<ffffff80081a8adc>] do_vfs_ioctl+0x4b8/0x58c
[<ffffff80081a8c10>] SyS_ioctl+0x60/0x88

Change-Id: Ica3fda1f22f903ee9ba2f0caed40cdae9bdfa32b
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
(am from https://patchwork.kernel.org/patch/9374135)
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c