Sleep fix

Benjamin Herrenschmidt bh40 at calva.net
Thu Sep 16 00:35:54 EST 1999


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 at calva.net>
           Work   e-mail: <mailto:benh at mipsys.com>
BenH.      Web   : <http://calvaweb.calvacom.fr/bh40/>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/octet-stream
Size: 1772 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/19990915/8fd6ae88/attachment.obj>


More information about the Linuxppc-dev mailing list