Subject: apm suspend/resume problem on Inspiron 4000
To: 386 Port NetBSD <port-i386@netbsd.org>
From: Scott Presnell <srp@zgi.com>
List: port-i386
Date: 03/09/2001 08:31:49
Hi Folks,
	I recently installed NetBSD 1.5 on a Dell Inspiron 4000.
With regard to apm functions:

	1) Standby/resume works.
	2) Suspend works but resume hangs if I'm using an enet card
		in the PCMCIA slot and I try to "ifconfig up."

Here is an example from the logs:

39:28 Suspending...
39:28 Suspending done.
39:30 /netbsd: uhci0: interrupt while not operating ignored
(I don't see this until the resume).

But then the status light to enet card goes out and I get a
very high freq "pip," not the manpage suggested two beeps.
The power light to the machine also goes out.

When I hit the power button to resume I get

40:01 Resuming...

(enet card status light still off)
and then it hangs in the "ifconfig up."

If I remove the ifconfig line from resume script, it resumes
to a usable point (with enet connectivity unavailable of course).

I suppose that the BIOS is turning off the power to the PCMCIA card/slots.
I don't see any BIOS options to control this behavior... where should I be
looking to approach solving this problem?

	Thanks for any pointers.

	- Scott


The apm script is almost the same as the example, see below.  at the very end is
the dmesg output.

case $0 in
*suspend)       
        logger 'Suspending...'
        # noise $S/KDE_Window_UnMaximize.wav
        # In case some NFS mounts still exist - we don't want them to hang:
        umount -a    -t nfs
        umount -a -f -t nfs
        ifconfig $if down
        sh /etc/rc.d/dhclient stop
        logger 'Suspending done.'
        ;;

*standby)
        logger 'Going to standby mode ....'
        # noise $S/KDE_Window_UnMaximize.wav
        # In case some NFS mounts still exist - we don't want them to hang:
        umount -a    -t nfs
        umount -a -f -t nfs
        ifconfig $if down
        sh /etc/rc.d/dhclient stop
        logger 'Standby done.'
        ;;

*resume)
        logger Resuming...
        # noise $S/KDE_Startup.wav
        # ifconfig $if up
        # sh /etc/rc.d/dhclient start
        # mount /home
        # mount /data
        logger 'Resuming done.'
        ;;

*line)
        # Running on power line, not battery...
        # noise $S/KDE_Window_DeIconify.wav
        mount -u -o atime,devmtime -a
        atactl wd0 setidle 0
        ;;

*battery)
        # Running on battery...
        # noise $S/KDE_Window_DeIconify.wav
        mount -u -o noatime,nodevmtime -a
        atactl wd0 setidle 5
        ;;

esac

=== dmesg.boot ===

NetBSD 1.5 (TAJO) #0: Thu Mar  8 23:28:21 PST 2001
    root@foobar:/usr/src/sys/arch/i386/compile/TAJO
cpu0: Intel Pentium III (E) (686-class)
total memory = 255 MB
avail memory = 232 MB
using 3296 buffers containing 13184 KB of memory
BIOS32 rev. 0 found at 0xffe90
PCI BIOS rev. 2.1 found at 0xfc13e
pcibios: config mechanism [1][x], special cycles [x][x], last bus 1
PCI IRQ Routing Table rev. 1.0 found at 0xfbd80, size 176 bytes (9 entries)
PCI Interrupt Router at 000:07:0 (Intel 82371MX Mobile PCI I/O IDE Xcelerator (MPIIX))
------------------------------------------
  device vendor product pin PIRQ IRQ stage
------------------------------------------
000:03:0 0x104c 0xac51   A  0x03  11  0    already assigned
000:03:1 0x104c 0xac51   A  0x03  11  0    already assigned
000:07:2 0x8086 0x7112   D  0x03  11  0    already assigned
000:08:0 0x125d 0x1998   A  0x01   5  0    already assigned
000:16:0 0x11c1 0x0448   A  0x03  11  0    already assigned
001:00:0 0x1002 0x4c46   A  0x00  11  0    already assigned
------------------------------------------
PCI bridge 0: primary 0, secondary 1, subordinate 1
PCI bridge 1: primary 0, secondary 2, subordinate 2
PCI bridge 2: primary 0, secondary 3, subordinate 3
PCI bus #3 is the last bus
[System BIOS Setting]-----------------------
  device vendor product
  register space address    size
--------------------------------------------
000:00:0 0x8086 0x7190 
        10h mem  0xe0000000 0x04000000
                [OK]
000:01:0 0x8086 0x7191 
                [OK]
000:03:0 0x104c 0xac51 
        10h mem  0x00000000 0x00001000
                [NG]
000:03:1 0x104c 0xac51 
        10h mem  0x00000000 0x00001000
                [NG]
000:07:0 0x8086 0x7110 
                [OK]
000:07:1 0x8086 0x7111 
        20h port 0x00000860 0x00000010
                [OK]
000:07:2 0x8086 0x7112 
        20h port 0x0000dce0 0x00000020
                [OK]
000:07:3 0x8086 0x7113 
                [OK]
000:08:0 0x125d 0x1998 
        10h port 0x0000d800 0x00000100
        14h mem  0xfbffe000 0x00002000
                [OK]
000:16:0 0x11c1 0x0448 
        10h mem  0xfbffdc00 0x00000100
        14h port 0x0000dcd8 0x00000008
        18h port 0x0000d400 0x00000100
                [OK]
001:00:0 0x1002 0x4c46 
        10h mem  0xe8000000 0x04000000
        14h port 0x0000ec00 0x00000100
        18h mem  0xfdffc000 0x00004000
                [OK]
--------------------------[  2 devices bogus]
 Physical memory end: 0x0ffe9000
 PCI memory mapped I/O space start: 0x10000000
[PCIBIOS fixup stage]-----------------------
  device vendor product
  register space address    size
--------------------------------------------
000:00:0 0x8086 0x7190 
        10h mem  0xe0000000 0x04000000
                [OK]
000:01:0 0x8086 0x7191 
                [OK]
000:03:0 0x104c 0xac51 
        10h mem  0x10000000 0x00001000
                [OK]
000:03:1 0x104c 0xac51 
        10h mem  0x10001000 0x00001000
                [OK]
000:07:0 0x8086 0x7110 
                [OK]
000:07:1 0x8086 0x7111 
        20h port 0x00000860 0x00000010
                [OK]
000:07:2 0x8086 0x7112 
        20h port 0x0000dce0 0x00000020
                [OK]
000:07:3 0x8086 0x7113 
                [OK]
000:08:0 0x125d 0x1998 
        10h port 0x0000d800 0x00000100
        14h mem  0xfbffe000 0x00002000
                [OK]
000:16:0 0x11c1 0x0448 
        10h mem  0xfbffdc00 0x00000100
        14h port 0x0000dcd8 0x00000008
        18h port 0x0000d400 0x00000100
                [OK]
--------------------------[  0 devices bogus]
mainbus0 (root)
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o space, memory space enabled
pchb0 at pci0 dev 0 function 0
pchb0: Intel 82443BX Host Bridge/Controller (rev. 0x03)
ppb0 at pci0 dev 1 function 0: Intel 82443BX AGP Interface (rev. 0x03)
pci1 at ppb0 bus 1
pci1: i/o space, memory space enabled
vga1 at pci1 dev 0 function 0: ATI Technologies product 0x4c46 (rev. 0x02)
wsdisplay0 at vga1: console (80x25, vt100 emulation)
cbb0 at pci0 dev 3 function 0: Texas Instruments PCI1420 PCI-CardBus Bridge (rev. 0x00)
cbb1 at pci0 dev 3 function 1: Texas Instruments PCI1420 PCI-CardBus Bridge (rev. 0x00)
pcib0 at pci0 dev 7 function 0
pcib0: Intel 82371AB PCI-to-ISA Bridge (PIIX4) (rev. 0x02)
pciide0 at pci0 dev 7 function 1: Intel 82371AB IDE controller (PIIX4) (rev. 0x01)
pciide0: bus-master DMA support present
pciide0: primary channel wired to compatibility mode
wd0 at pciide0 channel 0 drive 0: <IBM-DJSA-220>
wd0: drive supports 16-sector pio transfers, lba addressing
wd0: 19077 MB, 16383 cyl, 16 head, 63 sec, 512 bytes/sect x 39070080 sectors
wd0: 32-bit data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 4
pciide0: primary channel interrupting at irq 14
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2 (using DMA data transfers)
pciide0: secondary channel wired to compatibility mode
pciide0: secondary channel ignored (disabled)
uhci0 at pci0 dev 7 function 2: Intel 82371AB USB Host Controller (PIIX4) (rev. 0x01)
uhci0: interrupting at irq 11
usb0 at uhci0: USB revision 1.0
uhub0 at usb0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
Intel 82371AB Power Management Controller (PIIX4) (miscellaneous bridge, revision 0x03) at pci0 dev 7 function 3 not configured
ESS Technology Inc Maestro 3 PCI Audio Accelerator (audio multimedia, revision 0x10) at pci0 dev 8 function 0 not configured
AT&T Microelectronics LTMODEM (miscellaneous communications, revision 0x01) at pci0 dev 16 function 0 not configured
cbb0: interrupting at irq 11
cbb0: cacheline 0x8 lattimer 0x20
cbb0: bhlc 0x822008 lscp 0x20020200
cardslot0 at cbb0 slot 0 flags 0
cardbus0 at cardslot0: bus 2 device 0 cacheline 0x8, lattimer 0x20
pcmcia0 at cardslot0
cbb1: interrupting at irq 11
cbb1: cacheline 0x8 lattimer 0x20
cbb1: bhlc 0x822008 lscp 0x20030300
cardslot1 at cbb1 slot 1 flags 0
cardbus1 at cardslot1: bus 3 device 0 cacheline 0x8, lattimer 0x20
pcmcia1 at cardslot1
isa0 at pcib0
com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
pckbc0 at isa0 port 0x60-0x64
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
lpt0 at isa0 port 0x378-0x37b irq 7
pcppi0 at isa0 port 0x61
midi0 at pcppi0: PC speaker
sysbeep0 at pcppi0
isapnp0 at isa0 port 0x279: ISA Plug 'n Play device support
npx0 at isa0 port 0xf0-0xff: using exception 16
fdc0 at isa0 port 0x3f0-0x3f7 irq 6 drq 2
fd0 at fdc0 drive 0: 1.44MB, 80 cyl, 2 head, 18 sec
isapnp0: no ISA Plug 'n Play devices found
apm0 at mainbus0: Power Management spec V1.2
apm0: battery life expectancy: 100%
apm0: A/C state: on
apm0: battery charge state: high
apm0: estimated 5h 18m
biomask ef6d netmask ef6d ttymask ffef
cbb1: bad Vcc request. sock_ctrl 0x30, sock_status 0x30000b20
ex0 at cardbus1 dev 0 function 0: 3Com 3c575CT Ethernet
ex0: interrupting at 11
ex0: MAC address 00:50:da:da:f4:02
tqphy0 at ex0 phy 0: 78Q2120 10/100 media interface, rev. 11
tqphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
boot device: wd0
root on wd0a dumps on wd0b
root file system type: ffs
wsdisplay0: screen 1 added (80x25, vt100 emulation)
wsdisplay0: screen 2 added (80x25, vt100 emulation)
wsdisplay0: screen 3 added (80x25, vt100 emulation)
wsdisplay0: screen 4 added (80x25, vt100 emulation)
wsmux1: connecting to wsdisplay0
stray interrupt 15
stray interrupt 15