phy: rockchip: mipi-dcphy: fix null point cause reboot issue

In camera preview state, press the power button to standby,
then press the power button immediately to wake up,
machine will reboot, so fix it.

Call trace:
 samsung_mipi_dcphy_power_on+0x68/0xc80 [phy_rockchip_samsung_dcphy]
 phy_power_on+0xa4/0x124
 dw_mipi_dsi2_pre_enable+0x350/0x364 [rockchipdrm]
 dw_mipi_dsi2_encoder_atomic_enable+0x308/0x3d0 [rockchipdrm]
 drm_atomic_helper_commit_modeset_enables+0x158/0x2ec
 rockchip_drm_atomic_helper_commit_tail_rpm+0x50/0x2f8 [rockchipdrm]
 commit_tail+0xbc/0x170
 drm_atomic_helper_commit+0x1f4/0x218
 drm_atomic_commit+0xbc/0xec
 drm_mode_atomic_ioctl+0x59c/0x70c
 drm_ioctl_kernel+0xf8/0x184
 drm_ioctl+0x2cc/0x528
 __arm64_sys_ioctl+0xa8/0xe4
 invoke_syscall+0x58/0x11c
 el0_svc_common+0xb4/0xf4
 do_el0_svc+0x2c/0xb0
 el0_svc+0x2c/0xa4
 el0t_64_sync_handler+0x68/0xb4
 el0t_64_sync+0x1a0/0x1a4
Code: 95d7b2de b9408a68 34000b48 f9403e76 (f9407ad4)
---[ end trace 0000000000000000 ]---

Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
Change-Id: Ie15e7cef29821683731d56ff5c4ceb924e340bb5
This commit is contained in:
Wang Panzhenzhuan
2023-10-28 01:29:28 +00:00
committed by Tao Huang
parent 42f4aa0733
commit 80ef6aeac0

View File

@@ -1744,7 +1744,7 @@ static int samsung_mipi_dcphy_power_on(struct phy *phy)
reset_control_assert(samsung->apb_rst);
udelay(1);
reset_control_deassert(samsung->apb_rst);
if (atomic_read(&samsung->stream_cnt)) {
if (atomic_read(&samsung->stream_cnt) && samsung->dphy_dev[0]) {
sensor_sd = get_remote_sensor(&samsung->dphy_dev[0]->sd);
samsung->stream_off(samsung->dphy_dev[0], &samsung->dphy_dev[0]->sd);
if (sensor_sd)