Re: ACPI support on HP laptop

2013-07-11 Thread Riccardo Mottola

Hi,

Otto Moerbeek wrote:

No, it means you must use

./apmd -f start

to start it manually


That works indeed! Once started, even manually, I can then run "apm -A" 
and if the computer was put back into charge, it will automatically 
increase the CPU speed. Fine.


Riccardo



Re: ACPI support on HP laptop

2013-07-11 Thread Riccardo Mottola

Hi,

Peter Hessler wrote:

apm and "sysctl hw"

apm(8) will only give you life estimate when it is on battery, and has had
a chance to measure your actual power consumption.  Give it 30 seconds
or so.


It works, I was accustomed on other implementation that "remaining time" 
gives the charging time when on AC power


I ask, because I am the author of BatMon, the GNUstep battery monitor. 
Thus after getting my own laptop to a more usable state, I will update 
my tool!


Riccardo



Re: ACPI support on HP laptop

2013-07-10 Thread Otto Moerbeek
On Wed, Jul 10, 2013 at 12:55:27PM +0200, Riccardo Mottola wrote:

> Hi Paul,
> 
> Paul Irofti wrote:
> >On Sun, Jul 07, 2013 at 10:42:57PM +0200, Riccardo Mottola wrote:
> >>
> >>$ sysctl hw.setperf
> >>hw.setperf=99
> >What's the setperf value when you boot on battery and you have the CPU
> >set at 600MHz? If it less than 100 try and crank it up and see if the
> >frequency changes. If it works try different apm adjustment modes.
> using the current snapshot kernel, chaning setperf gradually
> increases CPU: For example, 66 makes it run at 1200Mhz according to
> apm, setting it to 99 or 100 makes it run at 1600Mhz, which is
> maximum speed.
> 
> apm -A doesn't work, because apmd isn't running. I think it means I
> have it disabled in rc.conf and can't start it manually, right?
> 
> ./apmd start
> ./apmd: no start without -f, apmd_flags=NO
> 
> 
> Riccardo

No, it means you must use 

./apmd -f start

to start it manually

-Otto



Re: ACPI support on HP laptop

2013-07-10 Thread MERIGHI Marcus
riccardo.mott...@libero.it (Riccardo Mottola), 2013.07.10 (Wed) 12:55 (CEST):
> Paul Irofti wrote:
> >On Sun, Jul 07, 2013 at 10:42:57PM +0200, Riccardo Mottola wrote:
> >>
> >>$ sysctl hw.setperf
> >>hw.setperf=99
> >What's the setperf value when you boot on battery and you have the CPU
> >set at 600MHz? If it less than 100 try and crank it up and see if the
> >frequency changes. If it works try different apm adjustment modes.
> using the current snapshot kernel, chaning setperf gradually
> increases CPU: For example, 66 makes it run at 1200Mhz according to
> apm, setting it to 99 or 100 makes it run at 1600Mhz, which is
> maximum speed.
> 
> apm -A doesn't work, because apmd isn't running. I think it means I
> have it disabled in rc.conf and can't start it manually, right?
> 
> ./apmd start
> ./apmd: no start without -f, apmd_flags=NO

$ echo 'apmd_flags=""' >> /etc/rc.conf.local

or, since you are  talking about apm -A:

$ echo 'apmd_flags="-A"' >> /etc/rc.conf.local

Bye, Marcus



Re: ACPI support on HP laptop

2013-07-10 Thread Riccardo Mottola

Hi Paul,

Paul Irofti wrote:

On Sun, Jul 07, 2013 at 10:42:57PM +0200, Riccardo Mottola wrote:


$ sysctl hw.setperf
hw.setperf=99

What's the setperf value when you boot on battery and you have the CPU
set at 600MHz? If it less than 100 try and crank it up and see if the
frequency changes. If it works try different apm adjustment modes.
using the current snapshot kernel, chaning setperf gradually increases 
CPU: For example, 66 makes it run at 1200Mhz according to apm, setting 
it to 99 or 100 makes it run at 1600Mhz, which is maximum speed.


apm -A doesn't work, because apmd isn't running. I think it means I have 
it disabled in rc.conf and can't start it manually, right?


./apmd start
./apmd: no start without -f, apmd_flags=NO


Riccardo



Re: ACPI support on HP laptop

2013-07-09 Thread Henning Brauer
* Riccardo Mottola  [2013-07-08 17:09]:
> One of the drawback with this kernel is that I get a delay during boot:
> 
> npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
> fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
> <--- Several seconds delay --->
> mtrr: Pentium Pro MTRR support
> vscsi0 at root
> 
> But I suppose it has nothing to do with APM/ACPI.

that's the floppy memorial minute.

usually disappears when the bios is correctly set to no floppy
present, but that is obviously bios dependent.

-- 
Henning Brauer, h...@bsws.de, henn...@openbsd.org
BS Web Services, http://bsws.de, Full-Service ISP
Secure Hosting, Mail and DNS Services. Dedicated Servers, Root to Fully Managed
Henning Brauer Consulting, http://henningbrauer.com/



Re: ACPI support on HP laptop

2013-07-08 Thread Peter Hessler
On 2013 Jul 08 (Mon) at 15:57:36 +0200 (+0200), Riccardo Mottola wrote:
:Life estimate is always missing, I suppose the whole capacity is not
:reported. Is there a convenient human-readable equivalent of "apm"
:for "acpi"? acpidump isn't it.

apm and "sysctl hw"

apm(8) will only give you life estimate when it is on battery, and has had
a chance to measure your actual power consumption.  Give it 30 seconds
or so.


-- 
Excellent day for putting Slinkies on an escalator.



Re: ACPI support on HP laptop

2013-07-08 Thread Alexey E. Suslikov
Paul Irofti  irofti.net> writes:

> Not sure I follow, does it work when you crank it up?
> What's the setperf value you get when you boot w/o the AC plugged in?
> Without any hacks in your sysctl or whatever.

You're right hw.setperf=100 is enough, however I see

hw.cpuspeed=1597
hw.setperf=99

regardless of how to boot (on AC or on DC).

hw.machine=i386
hw.model=Intel(R) Atom(TM) CPU N270 @ 1.60GHz ("GenuineIntel" 686-class)
hw.ncpu=1
hw.byteorder=1234
hw.pagesize=4096
hw.disknames=wd0:,sd0:370a1b2105a01f22,sd1:,sd2:
hw.diskcount=4
hw.sensors.acpitz0.temp0=56.00 degC (zone temperature)
hw.sensors.acpiac0.indicator0=On (power supply)
hw.sensors.acpibat0.volt0=11.10 VDC (voltage)
hw.sensors.acpibat0.volt1=12.34 VDC (current voltage)
hw.sensors.acpibat0.current0=0.00 A (rate)
hw.sensors.acpibat0.amphour0=1.48 Ah (last full capacity)
hw.sensors.acpibat0.amphour1=0.46 Ah (warning capacity)
hw.sensors.acpibat0.amphour2=0.14 Ah (low capacity)
hw.sensors.acpibat0.amphour3=1.43 Ah (remaining capacity), OK
hw.sensors.acpibat0.raw0=0 (battery idle), OK
hw.sensors.cpu0.temp0=48.00 degC
hw.cpuspeed=1597
hw.setperf=99
hw.vendor=LENOVO
hw.product=Lenovo
hw.version=Lenovo
hw.serialno=FL109120BD4DNNN
hw.uuid=3cf126ad-9bc8-2684-0e5b-00238b82cf76
hw.physmem=1063645184
hw.usermem=1058586624
hw.ncpufound=2
hw.allowpowerdown=1



Re: ACPI support on HP laptop

2013-07-08 Thread Riccardo Mottola

Hi Paul

( still have to verify CPU speed about which I will report back later)

Paul Irofti wrote:

I suppose this is part of the problem:
$ dmesg | grep acpi
acpi at bios0 function 0x0 not configured

This is an APM machine. Not an ACPI one.

A bunch of HP fixes went in. If you feel like experimenting more you can
update to current and disable apm at boot and enable acpi. See what
happens.

I booted a snapshot kernel and indeed there is an improvement. Typing 
APM actually shows:


$ apm
Battery state: high, 100% remaining, unknown life estimate
A/C adapter state: connected
Performance adjustment mode: manual (1595 MHz)

the battery state, regarding percentage, appears to be correct. When I 
booted it was 25% and now it charged up to 100%.


Life estimate is always missing, I suppose the whole capacity is not 
reported. Is there a convenient human-readable equivalent of "apm" for 
"acpi"? acpidump isn't it.



The ACPI reports from dmesg are:

bios0: vendor Hewlett-Packard version "68BDD Ver. F.14" date 06/23/2005
bios0: Hewlett-Packard HP Compaq nc6000 (DU447EA#ABZ)
acpi0 at bios0: rev 0
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP SSDT
acpi0: wakeup devices C056(S5)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpiprt0 at acpi0: bus 1 (C045)
acpiprt1 at acpi0: bus 2 (C056)
acpiprt2 at acpi0: bus 0 (C044)
acpiec0 at acpi0
acpicpu0 at acpi0: C3, C2, C1, PSS
acpipwrres0 at acpi0: C16D
acpipwrres1 at acpi0: C13D
acpipwrres2 at acpi0: C184
acpipwrres3 at acpi0: C18B
acpipwrres4 at acpi0: C195
acpipwrres5 at acpi0: C0E6
acpipwrres6 at acpi0: C20B
acpipwrres7 at acpi0: C20C
acpipwrres8 at acpi0: C20D
acpipwrres9 at acpi0: C20E
acpitz0 at acpi0: critical temperature is 103 degC
acpitz1 at acpi0: critical temperature is 115 degC
acpitz2 at acpi0: critical temperature is 103 degC
acpibat0 at acpi0: C137 model "Primary" serial 01767 2008/09/18 type 
LIon oem "Hewlett-Packard"

acpibat1 at acpi0: C136 not present
acpiac0 at acpi0: AC unit online
acpibtn0 at acpi0: C139
acpibtn1 at acpi0: C138
acpivideo0 at acpi0: C0CF


One of the drawback with this kernel is that I get a delay during boot:

npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
<--- Several seconds delay --->
mtrr: Pentium Pro MTRR support
vscsi0 at root

But I suppose it has nothing to do with APM/ACPI.


Thank you,

Riccardo



Re: ACPI support on HP laptop

2013-07-08 Thread Alexey E. Suslikov
Paul Irofti  irofti.net> writes:

> > Dunno if it really matters, I always do
> > 
> > hw.setperf=0
> > hw.setperf=100
> > 
> > in my sysctl.conf on my old Intel Atom (because it
> > still boots at 99).
> 
> Not sure I follow, does it work when you crank it up?
> What's the setperf value you get when you boot w/o the AC plugged in?
> Without any hacks in your sysctl or whatever.

I'll try and report back.

Just curious, what is the difference between boot-time setperf
calculations (which leads to 99) and post-boot sysctl juggling
(which successfully cranks to 100 in most cases)?

For me, it looks like boot-time and post-boot use different
assumptions and/or algorithms.

Why boot-time setperf code can't do same ?->0->100 transition
without making (wrong) complex assumptions?



Re: ACPI support on HP laptop

2013-07-08 Thread Paul Irofti
On Mon, Jul 08, 2013 at 08:15:51AM +, Alexey E. Suslikov wrote:
> Paul Irofti  irofti.net> writes:
> 
> > > $ sysctl hw.setperf
> > > hw.setperf=99
> > 
> > What's the setperf value when you boot on battery and you have the CPU
> > set at 600MHz? If it less than 100 try and crank it up and see if the
> > frequency changes. If it works try different apm adjustment modes.
> 
> Dunno if it really matters, I always do
> 
> hw.setperf=0
> hw.setperf=100
> 
> in my sysctl.conf on my old Intel Atom (because it
> still boots at 99).

Not sure I follow, does it work when you crank it up?
What's the setperf value you get when you boot w/o the AC plugged in?
Without any hacks in your sysctl or whatever.



Re: ACPI support on HP laptop

2013-07-08 Thread Alexey E. Suslikov
Paul Irofti  irofti.net> writes:

> > $ sysctl hw.setperf
> > hw.setperf=99
> 
> What's the setperf value when you boot on battery and you have the CPU
> set at 600MHz? If it less than 100 try and crank it up and see if the
> frequency changes. If it works try different apm adjustment modes.

Dunno if it really matters, I always do

hw.setperf=0
hw.setperf=100

in my sysctl.conf on my old Intel Atom (because it
still boots at 99).



Re: ACPI support on HP laptop

2013-07-08 Thread Paul Irofti
On Sun, Jul 07, 2013 at 10:42:57PM +0200, Riccardo Mottola wrote:
> Hi Paul,
> 
> Paul Irofti wrote:
> >>A/C adapter state: not connected
> >Does this change if the A/C is plugged in? Was it really unplugged when
> >you ran apm? That might explain the low frequency CPU setting.
> Yes. The laptop was unplugged. APM information about AC adapter
> status is correct.
> 
> If I boot the laptop when it is connected to AC power, it will boot
> at full CPU frequency and stay high. However if booted while on
> battery it remains low.
> >>Performance adjustment mode: manual (599 MHz)
> >>
> >>Interesting is that the CPU is not running at full speed, which is 1600Mhz.
> >What's your setperf set to? (sysctl hw.setperf)
> Right now, on battery but booted while on AC power, I do get:
> 
> $ sysctl hw.setperf
> hw.setperf=99

What's the setperf value when you boot on battery and you have the CPU
set at 600MHz? If it less than 100 try and crank it up and see if the
frequency changes. If it works try different apm adjustment modes.



Re: ACPI support on HP laptop

2013-07-07 Thread Riccardo Mottola

Hi Paul,

Paul Irofti wrote:

A/C adapter state: not connected

Does this change if the A/C is plugged in? Was it really unplugged when
you ran apm? That might explain the low frequency CPU setting.
Yes. The laptop was unplugged. APM information about AC adapter status 
is correct.


If I boot the laptop when it is connected to AC power, it will boot at 
full CPU frequency and stay high. However if booted while on battery it 
remains low.

Performance adjustment mode: manual (599 MHz)

Interesting is that the CPU is not running at full speed, which is 1600Mhz.

What's your setperf set to? (sysctl hw.setperf)

Right now, on battery but booted while on AC power, I do get:

$ sysctl hw.setperf
hw.setperf=99


I suppose this is part of the problem:
$ dmesg | grep acpi
acpi at bios0 function 0x0 not configured

This is an APM machine. Not an ACPI one.

Centrino machines are to my knowledge already ACPI machines.
I did not try, but Linux supports ACPI exactly on this machine.

A bunch of HP fixes went in. If you feel like experimenting more you can
update to current and disable apm at boot and enable acpi. See what
happens.


I will try a current snapshot kernel.

Riccardo



Re: ACPI support on HP laptop

2013-07-07 Thread Paul Irofti
> A/C adapter state: not connected

Does this change if the A/C is plugged in? Was it really unplugged when
you ran apm? That might explain the low frequency CPU setting.

> Performance adjustment mode: manual (599 MHz)
> 
> Interesting is that the CPU is not running at full speed, which is 1600Mhz.

What's your setperf set to? (sysctl hw.setperf)

> I suppose this is part of the problem:
> $ dmesg | grep acpi
> acpi at bios0 function 0x0 not configured

This is an APM machine. Not an ACPI one.

A bunch of HP fixes went in. If you feel like experimenting more you can
update to current and disable apm at boot and enable acpi. See what
happens.

> OpenBSD 5.2 (GENERIC) #278: Wed Aug  1 10:04:16 MDT 2012
> dera...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC
> cpu0: Intel(R) Pentium(R) M processor 1.60GHz ("GenuineIntel"
> 686-class) 599 MHz
> cpu0: 
> FPU,V86,DE,PSE,TSC,MSR,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,TM,SBF,EST,TM2
> real mem  = 536211456 (511MB)
> avail mem = 516587520 (492MB)
> mainbus0 at root
> bios0 at mainbus0: AT/286+ BIOS, date 06/23/05, BIOS32 rev. 0 @
> 0xf, SMBIOS rev. 2.3 @ 0xfa1ee (31 entries)
> bios0: vendor Hewlett-Packard version "68BDD Ver. F.14" date 06/23/2005
> bios0: Hewlett-Packard HP Compaq nc6000 (DU447EA#ABZ)
> apm0 at bios0: Power Management spec V1.2 (BIOS managing devices)
> acpi at bios0 function 0x0 not configured
> pcibios0 at bios0: rev 2.1 @ 0xf/0x2000
> 
> pcibios0: PCI IRQ Routing Table rev 1.0 @ 0xf0840/160 (8 entries)
> pcibios0: bad IRQ table checksum
> pcibios0: PCI IRQ Routing Table rev 1.0 @ 0xf6360/160 (8 entries)
> pcibios0: PCI Exclusive IRQs: 5 10 11
> pcibios0: PCI Interrupt Router at 000:31:0 ("Intel 82801DBM LPC" rev 0x00)
> pcibios0: PCI bus #5 is the last bus
> bios0: ROM list: 0xc/0x1
> cpu0 at mainbus0: (uniprocessor)
> cpu0: Enhanced SpeedStep 599 MHz: speeds: 1600, 1400, 1200, 1000,
> 800, 600 MHz
> pci0 at mainbus0 bus 0: configuration mode 1 (bios)
> pchb0 at pci0 dev 0 function 0 "Intel 82855PM Host" rev 0x03
> intelagp0 at pchb0
> agp0 at intelagp0: aperture at 0xb000, size 0x1000
> ppb0 at pci0 dev 1 function 0 "Intel 82855PM AGP" rev 0x03
> pci1 at ppb0 bus 1
> vga1 at pci1 dev 0 function 0 "ATI Radeon Mobility M10" rev 0x00
> wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
> wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
> radeondrm0 at vga1: irq 10
> drm0 at radeondrm0
> uhci0 at pci0 dev 29 function 0 "Intel 82801DB USB" rev 0x03: irq 10
> uhci1 at pci0 dev 29 function 1 "Intel 82801DB USB" rev 0x03: irq 10
> uhci2 at pci0 dev 29 function 2 "Intel 82801DB USB" rev 0x03: irq 10
> ehci0 at pci0 dev 29 function 7 "Intel 82801DB USB" rev 0x03: irq 10
> usb0 at ehci0: USB revision 2.0
> uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
> ppb1 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0x83
> pci2 at ppb1 bus 2
> ath0 at pci2 dev 4 function 0 "Atheros AR5212" rev 0x01: irq 11
> ath0: AR5213 5.6 phy 4.1 rf5111 1.7 rf2111 2.3, WOR0W, address
> 00:12:79:3d:3d:9c
> cbb0 at pci2 dev 6 function 0 "O2 Micro OZ711E0 CardBus" rev 0x00: irq 10
> cbb1 at pci2 dev 6 function 1 "O2 Micro OZ711E0 CardBus" rev 0x00: irq 10
> "O2 Micro OZ711Mx Misc" rev 0x00 at pci2 dev 6 function 2 not configured
> cbb2 at pci2 dev 6 function 3 "O2 Micro OZ711E0 CardBus" rev 0x00: irq 10
> bge0 at pci2 dev 14 function 0 "Broadcom BCM5705M Alt" rev 0x03,
> BCM5705 A3 (0x3003): irq 11, address 00:08:02:e9:14:06
> 
> brgphy0 at bge0 phy 1: BCM5705 10/100/1000baseT PHY, rev. 2
> cardslot0 at cbb0 slot 0 flags 0
> cardbus0 at cardslot0: bus 3 device 0 cacheline 0x0, lattimer 0x20
> pcmcia0 at cardslot0
> cardslot1 at cbb1 slot 1 flags 0
> cardbus1 at cardslot1: bus 4 device 0 cacheline 0x0, lattimer 0x20
> pcmcia1 at cardslot1
> cardslot2 at cbb2 slot 2 flags 0
> cardbus2 at cardslot2: bus 5 device 0 cacheline 0x0, lattimer 0x20
> pcmcia2 at cardslot2
> ichpcib0 at pci0 dev 31 function 0 "Intel 82801DBM LPC" rev 0x03:
> 24-bit timer at 3579545Hz
> pciide0 at pci0 dev 31 function 1 "Intel 82801DBM IDE" rev 0x03:
> DMA, channel 0 configured to compatibility, channel 1 configured to
> compatibility
> wd0 at pciide0 channel 0 drive 0: 
> wd0: 16-sector PIO, LBA, 5729MB, 11733120 sectors
> wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 4
> atapiscsi0 at pciide0 channel 1 drive 0
> scsibus0 at atapiscsi0: 2 targets
> cd0 at scsibus0 targ 0 lun 0:  ATAPI 5/cdrom
> removable
> cd0(pciide0:1:0): using PIO mode 4, DMA mode 2
> auich0 at pci0 dev 31 function 5 "Intel 82801DB AC97" rev 0x03: irq
> 11, ICH4 AC97
> ac97: codec id 0x41445374 (Analog Devices AD1981B)
> ac97: codec features headphone, 20 bit DAC, No 3D Stereo
> audio0 at auich0
> "Intel 82801DB Modem" rev 0x03 at pci0 dev 31 function 6 not configured
> usb1 at uhci0: USB revision 1.0
> uhub1 at usb1 "Intel UHCI root hub" rev 1.00/1.00 addr 1
> usb2 at uhci1: USB revision 1.0
> uhub2 at usb2 "Intel UHCI root hub" rev 1.