summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/rockchip/cdn-dp-core.h
diff options
context:
space:
mode:
authorGuenter Roeck <groeck@chromium.org>2017-02-05 15:54:58 +0800
committerMark Yao <mark.yao@rock-chips.com>2017-02-05 16:29:46 +0800
commit5eb2e6ee97b5e9a8587143db339bc71b28a3e1ca (patch)
tree07aad5ee1fc248292ee4513687f9082c0c5995e9 /drivers/gpu/drm/rockchip/cdn-dp-core.h
parent83c132ed46a7e9c8ac17be436ef3892850df8695 (diff)
downloadlinux-5eb2e6ee97b5e9a8587143db339bc71b28a3e1ca.tar.bz2
drm/rockchip: cdn-dp: Do not run worker while suspended
If the driver is in suspended mode, the dp block may be disabled, and chip registers may not be accessible. Yet, the worker may be triggered in this situation by an extcon event. If that happens, the following crash will be seen. cdn-dp fec00000.dp: [drm:cdn_dp_pd_event_work] *ERROR* Enable dp failed -19 cdn-dp fec00000.dp: [drm:cdn_dp_pd_event_work] Connected, not enabled. Enabling cdn Bad mode in Error handler detected, code 0xbf000002 -- SError CPU: 1 PID: 10357 Comm: kworker/1:2 Not tainted 4.4.21-05903-ge0514ea #1 Hardware name: Google Kevin (DT) Workqueue: events cdn_dp_pd_event_work task: ffffffc0cda67080 ti: ffffffc0b9b80000 task.ti: ffffffc0b9b80000 PC is at cdn_dp_clock_reset+0x30/0xa8 LR is at cdn_dp_enable+0x1e0/0x69c ... Call trace: [<ffffffc0005a7e24>] cdn_dp_pd_event_work+0x58/0x3f4 [<ffffffc0002397f0>] process_one_work+0x240/0x424 [<ffffffc00023a28c>] worker_thread+0x2fc/0x424 [<ffffffc00023f5fc>] kthread+0x10c/0x114 [<ffffffc000203dd0>] ret_from_fork+0x10/0x40 Problem is two-fold: The worker should not run while suspended, and the suspend function should not call cdn_dp_disable() while the worker is running. Signed-off-by: Guenter Roeck <groeck@chromium.org> Signed-off-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Diffstat (limited to 'drivers/gpu/drm/rockchip/cdn-dp-core.h')
-rw-r--r--drivers/gpu/drm/rockchip/cdn-dp-core.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.h b/drivers/gpu/drm/rockchip/cdn-dp-core.h
index 3bea4b8d265f..7d48661362c8 100644
--- a/drivers/gpu/drm/rockchip/cdn-dp-core.h
+++ b/drivers/gpu/drm/rockchip/cdn-dp-core.h
@@ -82,6 +82,7 @@ struct cdn_dp_device {
struct mutex lock;
bool connected;
bool active;
+ bool suspended;
const struct firmware *fw; /* cdn dp firmware */
unsigned int fw_version; /* cdn fw version */