video: mxsfb: Fix reset hang when videomode variable is not present
Subsystems (2)
Fabio Estevam
reviewerPATCH 1/1 video: mxsfb: Fix reset hang when videomode variable is not present
From: Fabio Estevam <[email protected]>
Currently the system hangs when the 'videomode' variable is not present:
=> setenv videomode
=> saveenv
=> reset
(Board hangs)
lcdif_power_down() assumes that the LCDIF controller has been properly configured and enabled, which may not be true.
To fix this issue check whether video_hw_init() succeeded or not and only perform the LCDIF shutdown when the controller has been properly enabled.
Tested on a imx7dsabresd board.
--- drivers/video/mxsfb.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/video/mxsfb.c +3 -0
@@ -136,6 +136,9 @@ void lcdif_power_down(void)struct mxs_lcdif_regs *regs = (struct mxs_lcdif_regs *)MXS_LCDIF_BASE ;int timeout =1000000 ; +if (!video_hw_init ()) +return ; +writel (panel.frameAdrs, ®s->hw_lcdif_cur_buf_reg);writel (panel.frameAdrs, ®s->hw_lcdif_next_buf_reg);writel (LCDIF_CTRL1_VSYNC_EDGE_IRQ , ®s->hw_lcdif_ctrl1_clr);
Signature · 1 line
2.7.4
PATCH 1/1 video: mxsfb: Fix reset hang when videomode variable is not present
Hi Fabio,
Quoted 28 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
Currently the system hangs when the 'videomode' variable is not present:
=> setenv videomode
=> saveenv
=> reset(Board hangs)
lcdif_power_down()assumes that the LCDIF controller has been properly configured and enabled, which may not be true.To fix this issue check whether
video_hw_init()succeeded or not and only perform the LCDIF shutdown when the controller has been properly enabled.Tested on a imx7dsabresd board.
Signed-off-by Fabio Estevam <[email protected]>---
drivers/video/mxsfb.c| 3 +++1 file changed, 3 insertions(+)drivers/video/mxsfb.c +0
-0
drivers/video/mxsfb.c void lcdif_power_down(void) · line 140
Quoted 5 lines
drivers/video/mxsfb.c +2
-0@@ -136,6 +136,9 @@ void lcdif_power_down(void)struct mxs_lcdif_regs *regs = (struct mxs_lcdif_regs *)MXS_LCDIF_BASE ;int timeout =1000000 ; +if (!video_hw_init ()) +return ;
If videomode is set, this will reinitialize the lcdif. Checking videomode env is ok to handle it as you proposed just now.
Regards,
Peng.