drm mm is not initial on non-iommu context.
Fix crash:
[ 11.635376] Unable to handle kernel NULL pointer dereference at virtual address
00000000
[ 11.636148] pgd =
ffffffc0de19d000
[ 11.636474] [
00000000] *pgd=
0000000000000000, *pud=
0000000000000000
[ 11.637088] Internal error: Oops:
96000045 [#1] PREEMPT SMP
[ 11.637594] Modules linked in:
[ 11.637902] CPU: 4 PID: 424 Comm: sh Not tainted 4.4.71 #146
[ 11.638406] Hardware name: Rockchip RK3399 Evaluation Board v3 (Android) (DT)
[ 11.639050] task:
ffffffc0de796800 ti:
ffffffc0de260000 task.ti:
ffffffc0de260000
[ 11.639736] PC is at __mutex_lock_slowpath+0xa8/0x178
[ 11.640198] LR is at __mutex_lock_slowpath+0x7c/0x178
[ 11.788003] [<
ffffff8008b85b5c>] __mutex_lock_slowpath+0xa8/0x178
[ 11.788560] [<
ffffff8008b85c58>] mutex_lock+0x2c/0x44
[ 11.789024] [<
ffffff800849e8d8>] rockchip_drm_mm_dump+0x30/0x5c
[ 11.789560] [<
ffffff80081d612c>] seq_read+0x1a8/0x3f8
[ 11.790017] [<
ffffff80081b4208>] __vfs_read+0x38/0xf4
[ 11.790472] [<
ffffff80081b4adc>] vfs_read+0x84/0x128
[ 11.790927] [<
ffffff80081b552c>] SyS_read+0x54/0xa4
[ 11.791372] [<
ffffff80080828b0>] el0_svc_naked+0x24/0x28
Change-Id: I342311da43d50b743257b81425dfc6a327306803
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
struct rockchip_drm_private *priv = drm_dev->dev_private;
int ret;
+ if (!priv->domain)
+ return 0;
+
mutex_lock(&priv->mm_lock);
ret = drm_mm_dump_table(s, &priv->mm);