linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 2.2.18pre21 oops reading /proc/apm
@ 2000-12-08  3:34 Neale Banks
  2000-12-08 13:57 ` Alan Cox
  0 siblings, 1 reply; 13+ messages in thread
From: Neale Banks @ 2000-12-08  3:34 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-kernel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 471 bytes --]

Hi Stephen,

I presume this should be going to you, as the person named in
arch/i386/kernel/apm.c - if not please redirect/ignore as appropriate.

I compiled the Debian distribution of 2.2.18pre21 source on and for a
AcerNote-950, with APM enabled.

All is fine except that I can reliably "oops" it simply by trying to read
from /proc/apm (e.g. cat /proc/apm).

oops output and ksymoops-2.3.4 output is attached.

Is there anything else I can contribute?

Thanks,
Neale.

[-- Attachment #2: Type: TEXT/PLAIN, Size: 1453 bytes --]

Unable to handle kernel paging request at virtual address 00003eb8
current->tss.cr3 = 02577000, %cr3 = 02577000
*pde = 00000000
Oops: 0002
CPU:    0
EIP:    0050:[<00008185>]
EFLAGS: 00010006
eax: 000063cb   ebx: 00000000   ecx: 0000012f   edx: 0000ffff
esi: 000000ff   edi: c25c0391   ebp: 00003eac   esp: c25c3eae
ds: 0058   es: 0000   ss: 0018
Process cat (pid: 557, process nr: 58, stackpage=c25c3000)
Stack: 3f300000 005000ff 00013ec0 00000000 8328530a 00000048 ffff0000 61daffff 
       0010c010 ffff0000 3f30ffff 0018c25c 00180000 51f10000 00ffc01a ffff0000 
       ffffffff 0292ffff 00000000 0000c20b 63cec014 530ac010 00010000 00000000 
Call Trace: Bad ESP value.
Code: <1>Unable to handle kernel paging request at virtual address 00008185
current->tss.cr3 = 02577000, %cr3 = 02577000
*pde = 00000000
Oops: 0000
CPU:    0
EIP:    0010:[<c0108be3>]
EFLAGS: 00010046
eax: 00008185   ebx: 00000000   ecx: c25c3e72   edx: c25c3e72
esi: c25c3eae   edi: c25c3f0e   ebp: c25c2000   esp: c25c3e1e
ds: 0018   es: 0018   ss: 0018
Process cat (pid: 557, process nr: 58, stackpage=c25c3000)
Stack: c26d4bf8 c25c2000 c01ebd4e c0108c44 c25c3e72 c01a5856 c01a71ce 00000002 
       00000000 c010de3c c01a71ce c25c3e72 00000002 c25c2000 000000ff c25c0391 
       00003eac c26d4bf8 c01088b5 c25c3e72 00000002 00000000 0000012f 0000ffff 
Call Trace: Bad ESP value.
Code: 8a 04 03 25 ff 00 00 00 50 68 4e 58 1a c0 e8 4a 9c 00 00 83 

[-- Attachment #3: Type: TEXT/PLAIN, Size: 3322 bytes --]

ksymoops 2.3.4 on i586 2.2.18pre21.  Options used
     -V (default)
     -k /proc/ksyms (default)
     -l /proc/modules (default)
     -o /lib/modules/2.2.18pre21/ (default)
     -m /boot/System.map-2.2.18pre21 (default)

Warning: You did not tell me where to find symbol information.  I will
assume that the log matches the kernel and modules that are running
right now and I'll use the default options above for symbol resolution.
If the current kernel and/or modules do not match the log, you can get
more accurate output by telling me the kernel version and where to find
map, modules, ksyms etc.  ksymoops -h explains the options.

Unable to handle kernel paging request at virtual address 00003eb8
current->tss.cr3 = 02577000, %cr3 = 02577000
*pde = 00000000
Oops: 0002
CPU:    0
EIP:    0050:[<00008185>]
Using defaults from ksymoops -t elf32-i386 -a i386
EFLAGS: 00010006
eax: 000063cb   ebx: 00000000   ecx: 0000012f   edx: 0000ffff
esi: 000000ff   edi: c25c0391   ebp: 00003eac   esp: c25c3eae
ds: 0058   es: 0000   ss: 0018
Process cat (pid: 557, process nr: 58, stackpage=c25c3000)
Stack: 3f300000 005000ff 00013ec0 00000000 8328530a 00000048 ffff0000 61daffff 
       0010c010 ffff0000 3f30ffff 0018c25c 00180000 51f10000 00ffc01a ffff0000 
       ffffffff 0292ffff 00000000 0000c20b 63cec014 530ac010 00010000 00000000 
Call Trace: Bad ESP value.
Code: <1>Unable to handle kernel paging request at virtual address 00008185
Warning (Oops_code): trailing garbage ignored on Code: line
  Text: 'Code: <1>Unable to handle kernel paging request at virtual address 00008185'
  Garbage: 'Unable to handle kernel paging request at virtual address 00008185'
Warning (Oops_code_values): Code looks like message, not hex digits.  No disassembly attempted.

>>EIP; 00008185 Before first symbol   <=====

current->tss.cr3 = 02577000, %cr3 = 02577000
*pde = 00000000
Oops: 0000
CPU:    0
EIP:    0010:[<c0108be3>]
EFLAGS: 00010046
eax: 00008185   ebx: 00000000   ecx: c25c3e72   edx: c25c3e72
esi: c25c3eae   edi: c25c3f0e   ebp: c25c2000   esp: c25c3e1e
ds: 0018   es: 0018   ss: 0018
Process cat (pid: 557, process nr: 58, stackpage=c25c3000)
Stack: c26d4bf8 c25c2000 c01ebd4e c0108c44 c25c3e72 c01a5856 c01a71ce 00000002 
       00000000 c010de3c c01a71ce c25c3e72 00000002 c25c2000 000000ff c25c0391 
       00003eac c26d4bf8 c01088b5 c25c3e72 00000002 00000000 0000012f 0000ffff 
Call Trace: Bad ESP value.
Code: 8a 04 03 25 ff 00 00 00 50 68 4e 58 1a c0 e8 4a 9c 00 00 83 

>>EIP; c0108be3 <show_registers+213/244>   <=====
Code;  c0108be3 <show_registers+213/244>
00000000 <_EIP>:
Code;  c0108be3 <show_registers+213/244>   <=====
   0:   8a 04 03                  mov    (%ebx,%eax,1),%al   <=====
Code;  c0108be6 <show_registers+216/244>
   3:   25 ff 00 00 00            and    $0xff,%eax
Code;  c0108beb <show_registers+21b/244>
   8:   50                        push   %eax
Code;  c0108bec <show_registers+21c/244>
   9:   68 4e 58 1a c0            push   $0xc01a584e
Code;  c0108bf1 <show_registers+221/244>
   e:   e8 4a 9c 00 00            call   9c5d <_EIP+0x9c5d> c0112840 <printk+0/160>
Code;  c0108bf6 <show_registers+226/244>
  13:   83 00 00                  addl   $0x0,(%eax)


3 warnings issued.  Results may not be reliable.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 2.2.18pre21 oops reading /proc/apm
  2000-12-08  3:34 2.2.18pre21 oops reading /proc/apm Neale Banks
@ 2000-12-08 13:57 ` Alan Cox
  2000-12-08 22:03   ` Neale Banks
  2000-12-09 23:26   ` Neale Banks
  0 siblings, 2 replies; 13+ messages in thread
From: Alan Cox @ 2000-12-08 13:57 UTC (permalink / raw)
  To: Neale Banks; +Cc: Stephen Rothwell, linux-kernel

> I compiled the Debian distribution of 2.2.18pre21 source on and for a
> AcerNote-950, with APM enabled.
> 
> All is fine except that I can reliably "oops" it simply by trying to read
> from /proc/apm (e.g. cat /proc/apm).
> 
> oops output and ksymoops-2.3.4 output is attached.
> 
> Is there anything else I can contribute?

The latitude and longtitude of the bios writers current position, and
a ballistic missile.

Please boot 2.2.18pre24 (not pre25) on the machine and send me its DMI strings
printed at boot time. I'll add it to the 'stupid morons who cant program and
wouldnt know QA if it hit them on the head with a mallet' list

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 2.2.18pre21 oops reading /proc/apm
  2000-12-08 13:57 ` Alan Cox
@ 2000-12-08 22:03   ` Neale Banks
  2000-12-09  0:17     ` Alan Cox
  2000-12-09 23:26   ` Neale Banks
  1 sibling, 1 reply; 13+ messages in thread
From: Neale Banks @ 2000-12-08 22:03 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel

On Fri, 8 Dec 2000, Alan Cox wrote:

> > Is there anything else I can contribute?
> 
> The latitude and longtitude of the bios writers current position, and
> a ballistic missile.

;-)

> Please boot 2.2.18pre24 (not pre25) [...]

Please pardon the naive question: is pre-patch-2.2.18-24 to be applied
over 2.2.17?

Thanks,
Neale.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 2.2.18pre21 oops reading /proc/apm
  2000-12-08 22:03   ` Neale Banks
@ 2000-12-09  0:17     ` Alan Cox
  0 siblings, 0 replies; 13+ messages in thread
From: Alan Cox @ 2000-12-09  0:17 UTC (permalink / raw)
  To: Neale Banks; +Cc: Alan Cox, linux-kernel

> On Fri, 8 Dec 2000, Alan Cox wrote:
> 
> > > Is there anything else I can contribute?
> > 
> > The latitude and longtitude of the bios writers current position, and
> > a ballistic missile.
> 
> ;-)
> 
> > Please boot 2.2.18pre24 (not pre25) [...]
> 
> Please pardon the naive question: is pre-patch-2.2.18-24 to be applied
> over 2.2.17?

Yes. Each pre is relative to 2.2.17

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 2.2.18pre21 oops reading /proc/apm
  2000-12-08 13:57 ` Alan Cox
  2000-12-08 22:03   ` Neale Banks
@ 2000-12-09 23:26   ` Neale Banks
  2000-12-10  1:09     ` Alan Cox
  1 sibling, 1 reply; 13+ messages in thread
From: Neale Banks @ 2000-12-09 23:26 UTC (permalink / raw)
  To: Alan Cox; +Cc: Stephen Rothwell, linux-kernel

On Fri, 8 Dec 2000, Alan Cox wrote:

[...]
> Please boot 2.2.18pre24 (not pre25) on the machine and send me its DMI strings
> printed at boot time. I'll add it to the 'stupid morons who cant program and
> wouldnt know QA if it hit them on the head with a mallet' list

OK, I did this (at least I think I got it right: the patch was happy) but
I can't see anything resembling DMI strings (even after I removed
frame-buffer so as not to nuke the first few messages).  What keywords etc
should I be seeing, at what point?

the only vaguely relevant message I see is:

	apm: BIOS version 1.1 Flags 0x03 (Driver version 1.13)

Thanks,
Neale.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 2.2.18pre21 oops reading /proc/apm
  2000-12-09 23:26   ` Neale Banks
@ 2000-12-10  1:09     ` Alan Cox
  2000-12-10  7:14       ` Neale Banks
  0 siblings, 1 reply; 13+ messages in thread
From: Alan Cox @ 2000-12-10  1:09 UTC (permalink / raw)
  To: Neale Banks; +Cc: Alan Cox, Stephen Rothwell, linux-kernel

> OK, I did this (at least I think I got it right: the patch was happy) but
> I can't see anything resembling DMI strings (even after I removed

Ok your machine probably doesnt have DMI then. That unfortunately means its
hard to identify the specific machine


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 2.2.18pre21 oops reading /proc/apm
  2000-12-10  1:09     ` Alan Cox
@ 2000-12-10  7:14       ` Neale Banks
  2000-12-10 18:18         ` Alan Cox
  0 siblings, 1 reply; 13+ messages in thread
From: Neale Banks @ 2000-12-10  7:14 UTC (permalink / raw)
  To: Alan Cox; +Cc: Stephen Rothwell, linux-kernel

On Sun, 10 Dec 2000, Alan Cox wrote:

> > OK, I did this (at least I think I got it right: the patch was happy) but
> > I can't see anything resembling DMI strings (even after I removed
> 
> Ok your machine probably doesnt have DMI then. That unfortunately means its
> hard to identify the specific machine

Which I presume rather rules out automagic detection and workaround?

I take it you are refering to the Phoenix BIOS detection code in
arch/i386/kernel/dmi_scan.c (ah yes, I see coments about QA ;-) and
subsequent call to apm_battery_horked()?

Is it "obvious" that I'm dealing with the same or similar kind of
bugginess here?

That being the case, any reason I can't/shouldn't put in a function
similar to apm_battery_horked(), and call/run it based on a config-time
variable?

FWIW, the machine claims "Phoenix NoteBIOS" dated 1994, and the poweroff
bit of APM appears to work just fine.

Thanks,
Neale.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 2.2.18pre21 oops reading /proc/apm
  2000-12-10  7:14       ` Neale Banks
@ 2000-12-10 18:18         ` Alan Cox
  2000-12-12  2:49           ` Neale Banks
  0 siblings, 1 reply; 13+ messages in thread
From: Alan Cox @ 2000-12-10 18:18 UTC (permalink / raw)
  To: Neale Banks; +Cc: Alan Cox, Stephen Rothwell, linux-kernel

> Is it "obvious" that I'm dealing with the same or similar kind of
> bugginess here?

Obvious no, but its a pretty good guess.

> 
> That being the case, any reason I can't/shouldn't put in a function
> similar to apm_battery_horked(), and call/run it based on a config-time
> variable?

None at all

> FWIW, the machine claims "Phoenix NoteBIOS" dated 1994, and the poweroff
> bit of APM appears to work just fine.

Alan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 2.2.18pre21 oops reading /proc/apm
  2000-12-10 18:18         ` Alan Cox
@ 2000-12-12  2:49           ` Neale Banks
  2000-12-12 11:23             ` Neale Banks
  0 siblings, 1 reply; 13+ messages in thread
From: Neale Banks @ 2000-12-12  2:49 UTC (permalink / raw)
  To: Alan Cox; +Cc: Stephen Rothwell, linux-kernel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 689 bytes --]

On Sun, 10 Dec 2000, Alan Cox wrote:

> > Is it "obvious" that I'm dealing with the same or similar kind of
> > bugginess here?
> 
> Obvious no, but its a pretty good guess.

FWIW, I now get:

-------------------------------------
neale@gull:~$ cat /proc/apm
1.13 1.1 0x03 0xff 0xff 0xff -1% -1 ?
-------------------------------------

> > That being the case, any reason I can't/shouldn't put in a function
> > similar to apm_battery_horked(), and call/run it based on a config-time
> > variable?
> 
> None at all

Diff against unmolested 2.2.18pre24 is attached.

Obviously the next challenge is to figure out how I can get what
information out of this strange beastie.

Regards,
Neale.

[-- Attachment #2: Type: TEXT/PLAIN, Size: 3871 bytes --]

diff -ur -x *.ntb0 -x .config linux-2.2.18pre24-orig/Documentation/Configure.help linux-2.2.18pre24/Documentation/Configure.help
--- linux-2.2.18pre24-orig/Documentation/Configure.help	Tue Dec 12 11:39:51 2000
+++ linux-2.2.18pre24/Documentation/Configure.help	Mon Dec 11 19:06:33 2000
@@ -10295,6 +10295,17 @@
   a work-around for a number of buggy BIOSes. Switch this option on if
   your computer crashes instead of powering off properly.
 
+Buggy battery status reporting
+CONFIG_APM_ASHES_NOTEBIOS
+  Currently disables battery status reporting for buggy BIOS which
+  (a) oopses on reading from /proc/apm and (b) does NOT have DMI.
+  (AcerNote-950 with Phoenix NoteBIOS 1994).
+  In future, this might implement a bug-workaround.
+  
+  Note that if the machine has DMI then the BIOS version should be
+  automagically detectable and this workaround automated.  Send the DMI
+  strings printed at boot-time with any report if this is not happening.
+
 Watchdog Timer Support 
 CONFIG_WATCHDOG
   If you say Y here (and to one of the following options) and create a
diff -ur -x *.ntb0 -x .config linux-2.2.18pre24-orig/arch/i386/config.in linux-2.2.18pre24/arch/i386/config.in
--- linux-2.2.18pre24-orig/arch/i386/config.in	Tue Dec 12 11:39:54 2000
+++ linux-2.2.18pre24/arch/i386/config.in	Mon Dec 11 19:00:44 2000
@@ -116,6 +116,7 @@
   bool '   RTC stores time in GMT' CONFIG_APM_RTC_IS_GMT
   bool '   Allow interrupts during APM BIOS calls' CONFIG_APM_ALLOW_INTS
   bool '   Use real mode APM BIOS call to power off' CONFIG_APM_REAL_MODE_POWER_OFF
+  bool '   Buggy battery status reporting' CONFIG_APM_ASHES_NOTEBIOS
 fi
 tristate 'Toshiba Laptop support' CONFIG_TOSHIBA
 
diff -ur -x *.ntb0 -x .config linux-2.2.18pre24-orig/arch/i386/kernel/apm.c linux-2.2.18pre24/arch/i386/kernel/apm.c
--- linux-2.2.18pre24-orig/arch/i386/kernel/apm.c	Tue Dec 12 11:39:54 2000
+++ linux-2.2.18pre24/arch/i386/kernel/apm.c	Tue Dec 12 08:44:22 2000
@@ -130,6 +130,9 @@
  *         is now the way life works). 
  *         Fix thinko in suspend() (wrong return).
  *   1.13ac: Added apm_battery_horked() for Compal boards (Dell 5000e etc)
+ *   1.13ac-nb: WIP: AcerNote-950 oops on reading /proc/apm
+ *         Try disabling battery status reporting.
+ *         Neale Banks <neale@lowendale.com.au>
  *
  * APM 1.1 Reference:
  *
@@ -211,6 +214,8 @@
  * P: Toshiba 1950S: battery life information only gets updated after resume
  * P: Midwest Micro Soundbook Elite DX2/66 monochrome: screen blanking
  * 	broken in BIOS [Reported by Garst R. Reese <reese@isn.net>]
+ * ?: AcerNote-950: oops on reading /proc/apm - workaround is a WIP
+ * 	Neale Banks <neale@lowendale.com.au> December 2000
  *
  * Legend: U = unusable with APM patches
  *         P = partially usable with APM patches
@@ -327,6 +332,11 @@
 static int			power_off_enabled = 1;
 #endif
 static int 			dell_crap = 0;	/*Set if we find a 5000e */
+#ifdef CONFIG_APM_ASHES_NOTEBIOS
+static int 			ashes_notebios = 1;	/*Set by configure*/
+#else
+static int 			ashes_notebios = 0;	/* Default to OK */
+#endif
 
 static DECLARE_WAIT_QUEUE_HEAD(apm_waitqueue);
 static DECLARE_WAIT_QUEUE_HEAD(apm_suspend_waitqueue);
@@ -1272,7 +1282,7 @@
 
 	p = buf;
 
-	if ((smp_num_cpus == 1) && (!dell_crap) && 
+	if ((smp_num_cpus == 1) && (!dell_crap) && (!ashes_notebios) &&
 	    !(error = apm_get_power_status(&bx, &cx, &dx))) {
 		ac_line_status = (bx >> 8) & 0xff;
 		battery_status = bx & 0xff;
@@ -1492,6 +1502,9 @@
 		(apm_bios_info.version & 0xff),
 		apm_bios_info.flags,
 		driver_version);
+	if (dell_crap || ashes_notebios) {
+		printk(KERN_INFO "apm: battery status reporting disabled\n");
+	}
 	if ((apm_bios_info.flags & APM_32_BIT_SUPPORT) == 0) {
 		printk(KERN_INFO "apm: no 32 bit BIOS support\n");
 		return -ENODEV;

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 2.2.18pre21 oops reading /proc/apm
  2000-12-12  2:49           ` Neale Banks
@ 2000-12-12 11:23             ` Neale Banks
  2000-12-13  2:01               ` Neale Banks
  0 siblings, 1 reply; 13+ messages in thread
From: Neale Banks @ 2000-12-12 11:23 UTC (permalink / raw)
  To: Alan Cox; +Cc: Stephen Rothwell, linux-kernel

On Tue, 12 Dec 2000, Neale Banks wrote:

[...]
> Diff against unmolested 2.2.18pre24 is attached.

Hold that one, I just found another case I haven't covered: booting with
apm=debug causes oops and nukes the bootup.  Reading the source, I can't
see how this doesn't also affect the "dell_crap" case too.

New diff to follow, hopefully tomorrow.

Neale.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 2.2.18pre21 oops reading /proc/apm
  2000-12-12 11:23             ` Neale Banks
@ 2000-12-13  2:01               ` Neale Banks
  2000-12-13  2:14                 ` Alan Cox
  0 siblings, 1 reply; 13+ messages in thread
From: Neale Banks @ 2000-12-13  2:01 UTC (permalink / raw)
  To: Alan Cox; +Cc: Stephen Rothwell, linux-kernel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 624 bytes --]

On Tue, 12 Dec 2000, Neale Banks wrote:

[...]
> New diff to follow, hopefully tomorrow.

New diff against unmolested 2.2.18pre24 (appears to apply cleanly to
2.2.18 also) is attached.

Main points:

(1) adds a configure item for buggy BIOS (i.e. that can't be automagically
detected).

(2) catches the case of booting with boot-parameter apm=debug (previously
this could cause a fatal oops during the boot)

(3) modifies the output of /proc/apm when power status reporting is
disabled - on reflection, maybe this wasn't such a smart thing to do
(could royally stuff anybody who is automagically parsing /proc/apm?)

Neale.

[-- Attachment #2: Type: TEXT/PLAIN, Size: 5046 bytes --]

diff -ur -x *.ntb? -x .config linux-2.2.18pre24-orig/Documentation/Configure.help linux-2.2.18pre24/Documentation/Configure.help
--- linux-2.2.18pre24-orig/Documentation/Configure.help	Tue Dec 12 11:39:51 2000
+++ linux-2.2.18pre24/Documentation/Configure.help	Wed Dec 13 09:34:56 2000
@@ -10295,6 +10295,18 @@
   a work-around for a number of buggy BIOSes. Switch this option on if
   your computer crashes instead of powering off properly.
 
+Buggy battery status reporting
+CONFIG_APM_ASHES_NOTEBIOS
+  Currently disables power status reporting - for buggy BIOS which
+  (a) oopses on reading from /proc/apm and (b) does NOT have DMI.
+  (AcerNote-950 with Phoenix NoteBIOS 1994).
+  In future, this setting might invoke a bug-workaround.
+  
+  Note that if the machine has DMI then the BIOS version should be
+  automagically detectable and this workaround automated.  Send the DMI
+  strings printed at boot-time with any report if this is not happening
+  (or try patching arch/i386/kernel/dmi_scan.c).
+
 Watchdog Timer Support 
 CONFIG_WATCHDOG
   If you say Y here (and to one of the following options) and create a
diff -ur -x *.ntb? -x .config linux-2.2.18pre24-orig/arch/i386/config.in linux-2.2.18pre24/arch/i386/config.in
--- linux-2.2.18pre24-orig/arch/i386/config.in	Tue Dec 12 11:39:54 2000
+++ linux-2.2.18pre24/arch/i386/config.in	Wed Dec 13 09:35:21 2000
@@ -116,6 +116,7 @@
   bool '   RTC stores time in GMT' CONFIG_APM_RTC_IS_GMT
   bool '   Allow interrupts during APM BIOS calls' CONFIG_APM_ALLOW_INTS
   bool '   Use real mode APM BIOS call to power off' CONFIG_APM_REAL_MODE_POWER_OFF
+  bool '   Buggy power status reporting' CONFIG_APM_ASHES_NOTEBIOS
 fi
 tristate 'Toshiba Laptop support' CONFIG_TOSHIBA
 
diff -ur -x *.ntb? -x .config linux-2.2.18pre24-orig/arch/i386/kernel/apm.c linux-2.2.18pre24/arch/i386/kernel/apm.c
--- linux-2.2.18pre24-orig/arch/i386/kernel/apm.c	Tue Dec 12 11:39:54 2000
+++ linux-2.2.18pre24/arch/i386/kernel/apm.c	Wed Dec 13 10:32:55 2000
@@ -130,6 +130,9 @@
  *         is now the way life works). 
  *         Fix thinko in suspend() (wrong return).
  *   1.13ac: Added apm_battery_horked() for Compal boards (Dell 5000e etc)
+ *   1.13ac-nb: WIP: AcerNote-950 oops on reading /proc/apm
+ *         Try disabling power status reporting.
+ *         Neale Banks <neale@lowendale.com.au>
  *
  * APM 1.1 Reference:
  *
@@ -211,6 +214,8 @@
  * P: Toshiba 1950S: battery life information only gets updated after resume
  * P: Midwest Micro Soundbook Elite DX2/66 monochrome: screen blanking
  * 	broken in BIOS [Reported by Garst R. Reese <reese@isn.net>]
+ * ?: AcerNote-950: oops on reading /proc/apm - workaround is a WIP
+ * 	Neale Banks <neale@lowendale.com.au> December 2000
  *
  * Legend: U = unusable with APM patches
  *         P = partially usable with APM patches
@@ -327,6 +332,11 @@
 static int			power_off_enabled = 1;
 #endif
 static int 			dell_crap = 0;	/*Set if we find a 5000e */
+#ifdef CONFIG_APM_ASHES_NOTEBIOS
+static int 			ashes_notebios = 1;	/*Set by configure*/
+#else
+static int 			ashes_notebios = 0;	/* Default to OK */
+#endif
 
 static DECLARE_WAIT_QUEUE_HEAD(apm_waitqueue);
 static DECLARE_WAIT_QUEUE_HEAD(apm_suspend_waitqueue);
@@ -658,6 +668,14 @@
 	u32	edx;
 	u32	dummy;
 
+	/* Catch cases of known buggy BIOSen */
+	if (dell_crap || ashes_notebios) {
+		*status = *bat = *life = 0xffff;
+		/* not sure of the _best_ code to return here.
+		   For now, APM_DISABLED will have to do  */
+		return APM_DISABLED;
+	}
+
 	if (apm_bios_call(APM_FUNC_GET_STATUS, APM_DEVICE_ALL, 0,
 			&eax, &ebx, &ecx, &edx, &dummy))
 		return (eax >> 8) & 0xff;
@@ -1272,7 +1290,7 @@
 
 	p = buf;
 
-	if ((smp_num_cpus == 1) && (!dell_crap) && 
+	if ((smp_num_cpus == 1) &&
 	    !(error = apm_get_power_status(&bx, &cx, &dx))) {
 		ac_line_status = (bx >> 8) & 0xff;
 		battery_status = bx & 0xff;
@@ -1325,7 +1343,9 @@
 	      -1: Unknown
 	   8) min = minutes; sec = seconds */
 
-	p += sprintf(p, "%s %d.%d 0x%02x 0x%02x 0x%02x 0x%02x %d%% %d %s\n",
+	if ((smp_num_cpus == 1) && !(error))
+		p += sprintf(p,
+		     "%s %d.%d 0x%02x 0x%02x 0x%02x 0x%02x %d%% %d %s\n",
 		     driver_version,
 		     (apm_bios_info.version >> 8) & 0xff,
 		     apm_bios_info.version & 0xff,
@@ -1336,6 +1356,13 @@
 		     percentage,
 		     time_units,
 		     units);
+	else
+		p += sprintf(p,
+		     "%s %d.%d 0x%02x Power status reporting disabled\n",
+		     driver_version,
+		     (apm_bios_info.version >> 8) & 0xff,
+		     apm_bios_info.version & 0xff,
+		     apm_bios_info.flags);
 
 	return p - buf;
 }
@@ -1492,6 +1519,9 @@
 		(apm_bios_info.version & 0xff),
 		apm_bios_info.flags,
 		driver_version);
+	if (dell_crap || ashes_notebios) {
+		printk(KERN_INFO "apm: power status reporting disabled\n");
+	}
 	if ((apm_bios_info.flags & APM_32_BIT_SUPPORT) == 0) {
 		printk(KERN_INFO "apm: no 32 bit BIOS support\n");
 		return -ENODEV;

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 2.2.18pre21 oops reading /proc/apm
  2000-12-13  2:01               ` Neale Banks
@ 2000-12-13  2:14                 ` Alan Cox
  2000-12-13  4:27                   ` Neale Banks
  0 siblings, 1 reply; 13+ messages in thread
From: Alan Cox @ 2000-12-13  2:14 UTC (permalink / raw)
  To: Neale Banks; +Cc: Alan Cox, Stephen Rothwell, linux-kernel

> (3) modifies the output of /proc/apm when power status reporting is
> disabled - on reflection, maybe this wasn't such a smart thing to do
> (could royally stuff anybody who is automagically parsing /proc/apm?)

Please dont - it correctly reports 'dunno' right now

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 2.2.18pre21 oops reading /proc/apm
  2000-12-13  2:14                 ` Alan Cox
@ 2000-12-13  4:27                   ` Neale Banks
  0 siblings, 0 replies; 13+ messages in thread
From: Neale Banks @ 2000-12-13  4:27 UTC (permalink / raw)
  To: Alan Cox; +Cc: Stephen Rothwell, linux-kernel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 373 bytes --]

On Wed, 13 Dec 2000, Alan Cox wrote:

> > (3) modifies the output of /proc/apm when power status reporting is
> > disabled - on reflection, maybe this wasn't such a smart thing to do
> > (could royally stuff anybody who is automagically parsing /proc/apm?)
> 
> Please dont - it correctly reports 'dunno' right now

OK, (yet another) diff attached, against 2.2.18.

Neale.

[-- Attachment #2: Type: TEXT/PLAIN, Size: 4224 bytes --]

diff -ur -x .config linux-2.2.18-orig/Documentation/Configure.help linux-2.2.18/Documentation/Configure.help
--- linux-2.2.18-orig/Documentation/Configure.help	Mon Dec 11 11:49:41 2000
+++ linux-2.2.18/Documentation/Configure.help	Wed Dec 13 13:36:54 2000
@@ -10298,6 +10298,18 @@
   a work-around for a number of buggy BIOSes. Switch this option on if
   your computer crashes instead of powering off properly.
 
+Buggy battery status reporting
+CONFIG_APM_ASHES_NOTEBIOS
+  Currently disables power status reporting - for buggy BIOS which
+  (a) oopses on reading from /proc/apm and (b) does NOT have DMI.
+  (AcerNote-950 with Phoenix NoteBIOS 1994).
+  In future, this setting might invoke a bug-workaround.
+  
+  Note that if the machine has DMI then the BIOS version should be
+  automagically detectable and this workaround automated.  Send the DMI
+  strings printed at boot-time with any report if this is not happening
+  (or try patching arch/i386/kernel/dmi_scan.c).
+
 Watchdog Timer Support 
 CONFIG_WATCHDOG
   If you say Y here (and to one of the following options) and create a
diff -ur -x .config linux-2.2.18-orig/arch/i386/config.in linux-2.2.18/arch/i386/config.in
--- linux-2.2.18-orig/arch/i386/config.in	Mon Dec 11 11:49:41 2000
+++ linux-2.2.18/arch/i386/config.in	Wed Dec 13 13:36:54 2000
@@ -116,6 +116,7 @@
   bool '   RTC stores time in GMT' CONFIG_APM_RTC_IS_GMT
   bool '   Allow interrupts during APM BIOS calls' CONFIG_APM_ALLOW_INTS
   bool '   Use real mode APM BIOS call to power off' CONFIG_APM_REAL_MODE_POWER_OFF
+  bool '   Buggy power status reporting' CONFIG_APM_ASHES_NOTEBIOS
 fi
 tristate 'Toshiba Laptop support' CONFIG_TOSHIBA
 
diff -ur -x .config linux-2.2.18-orig/arch/i386/kernel/apm.c linux-2.2.18/arch/i386/kernel/apm.c
--- linux-2.2.18-orig/arch/i386/kernel/apm.c	Mon Dec 11 11:49:41 2000
+++ linux-2.2.18/arch/i386/kernel/apm.c	Wed Dec 13 13:40:23 2000
@@ -130,6 +130,9 @@
  *         is now the way life works). 
  *         Fix thinko in suspend() (wrong return).
  *   1.13ac: Added apm_battery_horked() for Compal boards (Dell 5000e etc)
+ *   1.13ac-nb: WIP: AcerNote-950 oops on reading /proc/apm
+ *         Try disabling power status reporting.
+ *         Neale Banks <neale@lowendale.com.au>
  *
  * APM 1.1 Reference:
  *
@@ -211,6 +214,8 @@
  * P: Toshiba 1950S: battery life information only gets updated after resume
  * P: Midwest Micro Soundbook Elite DX2/66 monochrome: screen blanking
  * 	broken in BIOS [Reported by Garst R. Reese <reese@isn.net>]
+ * ?: AcerNote-950: oops on reading /proc/apm - workaround is a WIP
+ * 	Neale Banks <neale@lowendale.com.au> December 2000
  *
  * Legend: U = unusable with APM patches
  *         P = partially usable with APM patches
@@ -327,6 +332,11 @@
 static int			power_off_enabled = 1;
 #endif
 static int 			dell_crap = 0;	/*Set if we find a 5000e */
+#ifdef CONFIG_APM_ASHES_NOTEBIOS
+static int 			ashes_notebios = 1;	/*Set by configure*/
+#else
+static int 			ashes_notebios = 0;	/* Default to OK */
+#endif
 
 static DECLARE_WAIT_QUEUE_HEAD(apm_waitqueue);
 static DECLARE_WAIT_QUEUE_HEAD(apm_suspend_waitqueue);
@@ -658,6 +668,14 @@
 	u32	edx;
 	u32	dummy;
 
+	/* Catch cases of known buggy BIOSen */
+	if (dell_crap || ashes_notebios) {
+		*status = *bat = *life = 0xffff;
+		/* not sure of the _best_ code to return here.
+		   For now, APM_DISABLED will have to do  */
+		return APM_DISABLED;
+	}
+
 	if (apm_bios_call(APM_FUNC_GET_STATUS, APM_DEVICE_ALL, 0,
 			&eax, &ebx, &ecx, &edx, &dummy))
 		return (eax >> 8) & 0xff;
@@ -1272,7 +1290,7 @@
 
 	p = buf;
 
-	if ((smp_num_cpus == 1) && (!dell_crap) && 
+	if ((smp_num_cpus == 1) &&
 	    !(error = apm_get_power_status(&bx, &cx, &dx))) {
 		ac_line_status = (bx >> 8) & 0xff;
 		battery_status = bx & 0xff;
@@ -1492,6 +1510,9 @@
 		(apm_bios_info.version & 0xff),
 		apm_bios_info.flags,
 		driver_version);
+	if (dell_crap || ashes_notebios) {
+		printk(KERN_INFO "apm: power status reporting disabled\n");
+	}
 	if ((apm_bios_info.flags & APM_32_BIT_SUPPORT) == 0) {
 		printk(KERN_INFO "apm: no 32 bit BIOS support\n");
 		return -ENODEV;

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2000-12-13  4:32 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-08  3:34 2.2.18pre21 oops reading /proc/apm Neale Banks
2000-12-08 13:57 ` Alan Cox
2000-12-08 22:03   ` Neale Banks
2000-12-09  0:17     ` Alan Cox
2000-12-09 23:26   ` Neale Banks
2000-12-10  1:09     ` Alan Cox
2000-12-10  7:14       ` Neale Banks
2000-12-10 18:18         ` Alan Cox
2000-12-12  2:49           ` Neale Banks
2000-12-12 11:23             ` Neale Banks
2000-12-13  2:01               ` Neale Banks
2000-12-13  2:14                 ` Alan Cox
2000-12-13  4:27                   ` Neale Banks

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).