From: Benjamin Herrenschmidt <bh40@calva.net>
To: linuxppc-dev@lists.linuxppc.org, Paul.Mackerras@cs.anu.edu.au
Subject: Sleep fix
Date: Wed, 15 Sep 1999 16:35:54 +0200 [thread overview]
Message-ID: <19990915163554.003512@mailhost.mipsys.com> (raw)
[-- 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);
reply other threads:[~1999-09-15 14:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=19990915163554.003512@mailhost.mipsys.com \
--to=bh40@calva.net \
--cc=Paul.Mackerras@cs.anu.edu.au \
--cc=linuxppc-dev@lists.linuxppc.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).