Commit 40488db2 authored by Ben Dooks's avatar Ben Dooks Committed by Linus Torvalds

FB/SM501: ensure console suspended before saving state

Move the console suspend to before we save the state of
the framebuffer to ensure that it does not try and change
the fb state again once we have copied it out.
Signed-off-by: default avatarBen Dooks <ben-linux@fluff.org>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: Vincent Sanders <vince@simtec.co.uk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent bc9c6a17
...@@ -1698,6 +1698,15 @@ static int sm501fb_suspend_fb(struct sm501fb_info *info, ...@@ -1698,6 +1698,15 @@ static int sm501fb_suspend_fb(struct sm501fb_info *info,
if (par->screen.size == 0) if (par->screen.size == 0)
return 0; return 0;
/* blank the relevant interface to ensure unit power minimised */
(par->ops.fb_blank)(FB_BLANK_POWERDOWN, fbi);
/* tell console/fb driver we are suspending */
acquire_console_sem();
fb_set_suspend(fbi, 1);
release_console_sem();
/* backup copies in case chip is powered down over suspend */ /* backup copies in case chip is powered down over suspend */
par->store_fb = vmalloc(par->screen.size); par->store_fb = vmalloc(par->screen.size);
...@@ -1717,12 +1726,6 @@ static int sm501fb_suspend_fb(struct sm501fb_info *info, ...@@ -1717,12 +1726,6 @@ static int sm501fb_suspend_fb(struct sm501fb_info *info,
memcpy_fromio(par->store_fb, par->screen.k_addr, par->screen.size); memcpy_fromio(par->store_fb, par->screen.k_addr, par->screen.size);
memcpy_fromio(par->store_cursor, par->cursor.k_addr, par->cursor.size); memcpy_fromio(par->store_cursor, par->cursor.k_addr, par->cursor.size);
/* blank the relevant interface to ensure unit power minimised */
(par->ops.fb_blank)(FB_BLANK_POWERDOWN, fbi);
acquire_console_sem();
fb_set_suspend(fbi, 1);
release_console_sem();
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment