From: "H. Peter Anvin" <hpa@zytor.com>
To: Mikael Pettersson <mikpe@it.uu.se>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [BUG] 2.6.23-rc1 broke APM
Date: Mon, 23 Jul 2007 08:50:41 -0700 [thread overview]
Message-ID: <46A4CE51.2060509@zytor.com> (raw)
In-Reply-To: <200707231310.l6NDA9Dn004031@harpo.it.uu.se>
[-- Attachment #1: Type: text/plain, Size: 997 bytes --]
Mikael Pettersson wrote:
> On this machine (Gigabyte mobo with i815EP chipset and a PIII),
> APM worked fine up to 2.6.22. With 2.6.23-rc1 however the APM
> driver fails to locate the APM bios:
>
> --- dmesg-2.6.22 2007-07-23 14:07:46.000000000 +0200
> +++ dmesg-2.6.23-rc1 2007-07-23 14:48:24.000000000 +0200
> @@ -102,7 +105,7 @@
> Unpacking initramfs... done
> Freeing initrd memory: 976k freed
> Machine check exception polling timer started.
> -apm: BIOS version 1.2 Flags 0x07 (Driver version 1.16ac)
> +apm: BIOS not found.
> io scheduler noop registered
> io scheduler anticipatory registered (default)
> io scheduler deadline registered
>
> The only change in 2.6.23-rc1 to arch/i386/kernel/apm.c is a
> trivial nofreeze flag removal, so I suspect the boot code changes,
> perhaps the new arch/i386/boot/apm.c:query_apm_bios().
>
Seems like a reasonable suspicion.
Could you try the attached patch and:
a) see if it helps the situation, and
b) tell me what it prints?
-hpa
[-- Attachment #2: diff --]
[-- Type: text/plain, Size: 1812 bytes --]
diff --git a/arch/i386/boot/apm.c b/arch/i386/boot/apm.c
index a34087c..5843beb 100644
--- a/arch/i386/boot/apm.c
+++ b/arch/i386/boot/apm.c
@@ -34,6 +34,9 @@ int query_apm_bios(void)
: "=d" (err), "+a" (ax), "+b" (bx), "+c" (cx)
: : "esi", "edi");
+ printf("apm: err = %d, ax = %#x, bx = %#x, cx = %#x\n",
+ err, ax, bx, cx);
+
if (err)
return -1; /* No APM BIOS */
@@ -45,9 +48,10 @@ int query_apm_bios(void)
/* Disconnect first, just in case */
ax = 0x5304;
+ bx = 0;
asm volatile("pushl %%ebp ; int $0x15 ; popl %%ebp"
- : "+a" (ax)
- : : "ebx", "ecx", "edx", "esi", "edi");
+ : "+a" (ax), "+b" (bx)
+ : "ecx", "edx", "esi", "edi");
/* Paranoia */
ebx = esi = 0;
@@ -59,6 +63,10 @@ int query_apm_bios(void)
"+S" (esi), "+D" (di), "=m" (err)
: "a" (0x5303));
+ printf("apm: err = %d, ax = %#x, ebx = %#x, cx = %#x, dx = %#x\n"
+ " esi = %#x, di = %#x\n",
+ err, ax, ebx, cx, dx, esi, di);
+
boot_params.apm_bios_info.cseg = ax;
boot_params.apm_bios_info.offset = ebx;
boot_params.apm_bios_info.cseg_16 = cx;
@@ -79,6 +87,9 @@ int query_apm_bios(void)
: "=d" (err), "+a" (ax), "+b" (bx), "+c" (cx)
: : "esi", "edi");
+ printf("apm: err = %d, ax = %#x, bx = %#x, cx = %#x\n",
+ err, ax, bx, cx);
+
if (err || bx != 0x504d) {
/* Failure with 32-bit connect, try to disconect and ignore */
ax = 0x5304;
diff --git a/arch/i386/boot/main.c b/arch/i386/boot/main.c
index 7f01f96..b0072d7 100644
--- a/arch/i386/boot/main.c
+++ b/arch/i386/boot/main.c
@@ -150,6 +150,8 @@ void main(void)
/* Query APM information */
#if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE)
query_apm_bios();
+#else
+ printf("apm: disabled\n");
#endif
/* Query EDD information */
next prev parent reply other threads:[~2007-07-23 15:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-23 13:10 [BUG] 2.6.23-rc1 broke APM Mikael Pettersson
2007-07-23 15:50 ` H. Peter Anvin [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-07-23 22:26 Mikael Pettersson
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=46A4CE51.2060509@zytor.com \
--to=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mikpe@it.uu.se \
/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