All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2] video: mxsfb: Fix reset hang when videomode variable is not present
@ 2017-02-22 10:09 Fabio Estevam
  2017-02-22 12:58 ` Anatolij Gustschin
  0 siblings, 1 reply; 3+ messages in thread
From: Fabio Estevam @ 2017-02-22 10:09 UTC (permalink / raw)
  To: u-boot

From: Fabio Estevam <fabio.estevam@nxp.com>

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 'videomode' variable is present and
in case it is not present, do not continue with the LCDIF powerdown
sequence.

Tested on a imx7dsabresd board.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
Changes since v1:
- Only check videomode variable to avoid LCDIF to initialize again.

 drivers/video/mxsfb.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
index 3cc03ca..eb986ee 100644
--- a/drivers/video/mxsfb.c
+++ b/drivers/video/mxsfb.c
@@ -135,6 +135,11 @@ void lcdif_power_down(void)
 {
 	struct mxs_lcdif_regs *regs = (struct mxs_lcdif_regs *)MXS_LCDIF_BASE;
 	int timeout = 1000000;
+	char *penv;
+
+	penv = getenv("videomode");
+	if (!penv)
+		return;
 
 	writel(panel.frameAdrs, &regs->hw_lcdif_cur_buf_reg);
 	writel(panel.frameAdrs, &regs->hw_lcdif_next_buf_reg);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH v2] video: mxsfb: Fix reset hang when videomode variable is not present
  2017-02-22 10:09 [U-Boot] [PATCH v2] video: mxsfb: Fix reset hang when videomode variable is not present Fabio Estevam
@ 2017-02-22 12:58 ` Anatolij Gustschin
  2017-02-22 13:37   ` Fabio Estevam
  0 siblings, 1 reply; 3+ messages in thread
From: Anatolij Gustschin @ 2017-02-22 12:58 UTC (permalink / raw)
  To: u-boot

Hi Fabio,

On Wed, 22 Feb 2017 07:09:46 -0300
Fabio Estevam festevam at gmail.com wrote:
...
> @@ -135,6 +135,11 @@ void lcdif_power_down(void)
>  {
>  	struct mxs_lcdif_regs *regs = (struct mxs_lcdif_regs *)MXS_LCDIF_BASE;
>  	int timeout = 1000000;
> +	char *penv;
> +
> +	penv = getenv("videomode");
> +	if (!penv)
> +		return;

will a simple check of frameAdrs fix this problem?

Like:
	if (!panel.frameAdrs)
		return;

Thanks,
Anatolij

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH v2] video: mxsfb: Fix reset hang when videomode variable is not present
  2017-02-22 12:58 ` Anatolij Gustschin
@ 2017-02-22 13:37   ` Fabio Estevam
  0 siblings, 0 replies; 3+ messages in thread
From: Fabio Estevam @ 2017-02-22 13:37 UTC (permalink / raw)
  To: u-boot

Hi Anatolij,

On Wed, Feb 22, 2017 at 9:58 AM, Anatolij Gustschin <agust@denx.de> wrote:

> will a simple check of frameAdrs fix this problem?
>
> Like:
>         if (!panel.frameAdrs)
>                 return;

Yes, it does! Thanks for the suggestion.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-22 13:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-22 10:09 [U-Boot] [PATCH v2] video: mxsfb: Fix reset hang when videomode variable is not present Fabio Estevam
2017-02-22 12:58 ` Anatolij Gustschin
2017-02-22 13:37   ` Fabio Estevam

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.