* Sleep fix
@ 1999-09-15 14:35 Benjamin Herrenschmidt
0 siblings, 0 replies; only message in thread
From: Benjamin Herrenschmidt @ 1999-09-15 14:35 UTC (permalink / raw)
To: linuxppc-dev, Paul.Mackerras
[-- Attachment #1: Type: text/plain, Size: 2004 bytes --]
Here's a fix for a hang when sleeping on some wallstreet revisions:
--- linux.orig/drivers/video/atyfb.c Thu Sep 2 02:34:39 1999
+++ linux/drivers/video/atyfb.c Wed Sep 15 16:28:01 1999
@@ -3922,13 +3922,15 @@
/* Stop accel engine (stop bus mastering) */
if (info->current_par.accel_flags & FB_ACCELF_TEXT)
reset_engine(info);
-#if 1
- /* Backup fb content */
+
+ /* Backup fb content (apparently only required for some
+ chips, we keep it like this for now)
+ */
info->save_framebuffer = vmalloc(nb);
if (info->save_framebuffer)
memcpy(info->save_framebuffer,
(void *)info->frame_buffer, nb);
-#endif
+
/* Blank display and LCD */
atyfbcon_blank(VESA_POWERDOWN+1, (struct fb_info *)info);
@@ -3950,6 +3952,11 @@
aty_st_le32(POWER_MANAGEMENT, pm, info);
do {
pm = aty_ld_le32(POWER_MANAGEMENT, info);
+ /* There's apparently a problem with the chip ID 4c50
+ here's a temp fix until ATI
gives me a definitive
+ answer. --BenH */
+ if (Gx == LP_CHIP_ID)
+ break;
} while ((pm & PWR_MGT_STATUS_MASK) != PWR_MGT_STATUS_SUSPEND);
mdelay(500);
}
@@ -3969,10 +3976,12 @@
aty_st_le32(POWER_MANAGEMENT, pm, info);
do {
pm = aty_ld_le32(POWER_MANAGEMENT, info);
+ if (Gx == LP_CHIP_ID)
+ break;
} while ((pm & PWR_MGT_STATUS_MASK) != 0);
mdelay(500);
}
-#if 1
+
/* Restore fb content */
if (info->save_framebuffer) {
memcpy((void *)info->frame_buffer,
@@ -3980,7 +3989,7 @@
vfree(info->save_framebuffer);
info->save_framebuffer = 0;
}
-#endif
+
/* Restore display */
atyfb_set_par(&info->current_par, info);
atyfbcon_blank(0, (struct fb_info *)info);
--
Perso. e-mail: <mailto:bh40@calva.net>
Work e-mail: <mailto:benh@mipsys.com>
BenH. Web : <http://calvaweb.calvacom.fr/bh40/>
[-- Attachment #2: aty_sleep.diff --]
[-- Type: application/octet-stream, Size: 1772 bytes --]
--- linux.orig/drivers/video/atyfb.c Thu Sep 2 02:34:39 1999
+++ linux/drivers/video/atyfb.c Wed Sep 15 16:28:01 1999
@@ -3922,13 +3922,15 @@
/* Stop accel engine (stop bus mastering) */
if (info->current_par.accel_flags & FB_ACCELF_TEXT)
reset_engine(info);
-#if 1
- /* Backup fb content */
+
+ /* Backup fb content (apparently only required for some
+ chips, we keep it like this for now)
+ */
info->save_framebuffer = vmalloc(nb);
if (info->save_framebuffer)
memcpy(info->save_framebuffer,
(void *)info->frame_buffer, nb);
-#endif
+
/* Blank display and LCD */
atyfbcon_blank(VESA_POWERDOWN+1, (struct fb_info *)info);
@@ -3950,6 +3952,11 @@
aty_st_le32(POWER_MANAGEMENT, pm, info);
do {
pm = aty_ld_le32(POWER_MANAGEMENT, info);
+ /* There's apparently a problem with the chip ID 4c50
+ here's a temp fix until ATI gives me a definitive
+ answer. --BenH */
+ if (Gx == LP_CHIP_ID)
+ break;
} while ((pm & PWR_MGT_STATUS_MASK) != PWR_MGT_STATUS_SUSPEND);
mdelay(500);
}
@@ -3969,10 +3976,12 @@
aty_st_le32(POWER_MANAGEMENT, pm, info);
do {
pm = aty_ld_le32(POWER_MANAGEMENT, info);
+ if (Gx == LP_CHIP_ID)
+ break;
} while ((pm & PWR_MGT_STATUS_MASK) != 0);
mdelay(500);
}
-#if 1
+
/* Restore fb content */
if (info->save_framebuffer) {
memcpy((void *)info->frame_buffer,
@@ -3980,7 +3989,7 @@
vfree(info->save_framebuffer);
info->save_framebuffer = 0;
}
-#endif
+
/* Restore display */
atyfb_set_par(&info->current_par, info);
atyfbcon_blank(0, (struct fb_info *)info);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1999-09-15 14:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-09-15 14:35 Sleep fix Benjamin Herrenschmidt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).