Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 May 2014 18:37:52 +0800
From:      Huang Wen Hui <huanghwh@gmail.com>
To:        Stefan Esser <se@freebsd.org>,  "freebsd-stable@freebsd.org" <freebsd-stable@freebsd.org>
Subject:   Re: r266165: powerd hang sytem on MacbookPro 2013
Message-ID:  <CAB8uncZ3ekmejbEZVf41QUOHyzFLT7Zjf=DHk_sP0uBQ2%2BfSkw@mail.gmail.com>
In-Reply-To: <537B1DD7.70206@freebsd.org>
References:  <CAB8uncbQmv%2Beb6n5Gg0M3e5SrQN%2BJrd8-poNznzLfA43X0BMxw@mail.gmail.com> <CAJ-Vmo=b7A3Gap%2B9Z1qiFKbu7ksSioeZTciykB=nMNfvrA_SQQ@mail.gmail.com> <537A0121.6090102@freebsd.org> <CAB8uncYT3--NOVPfXWSJyNR209faGgbkd4UB%2BQPM08d89hvryw@mail.gmail.com> <537B1DD7.70206@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
2014-05-20 17:18 GMT+08:00 Stefan Esser <se@freebsd.org>:

> Am 20.05.2014 08:13, schrieb Huang Wen Hui:
> > 2014-05-19 21:03 GMT+08:00, Colin Percival <cperciva@freebsd.org>:
> >> On 05/18/14 15:43, Adrian Chadd wrote:
> >>> On 18 May 2014 08:32, Huang Wen Hui <huanghwh@gmail.com> wrote:
> >>>> Hi,
> >>>> Before r266165, There is no "dev.cpu.0.freq"  on my  MacbookPro 2013,
> now
> >>>> I
> >>>> got:
> >>>>
> >>>> #sysctl dev.cpu.0.freq
> >>>> dev.cpu.0.freq: 2601
> >>>>
> >>>> but If start powerd, system will quickly hang, both keyboard and
> >>>> ethernet
> >>>> are not respond.
> >>
> >> Well, the good news is that r266165 is working: It makes that sysctl
> >> visible
> >> in situations where it used to be (accidentally) inoperative.  The bad
> news
> >> is that you seem to be running into a problem with the now-functional
> power
> >> management code.
> >>
> >> I suggest disabling powerd in /etc/rc.conf, and manually adjusting the
> >> clock
> >> frequency using dev.cpu.0.freq.  Does it repeatably die at a certain
> point?
> >> Does it die immediately at that point, or after some time?  Do you
> always
> >> get the same hang?
> > OK, I use sysctl dev.cpu.0.freq=xxxx many times, all freq change cause
> > 100% hang, detail:
> > freq 1000, 1200, 1500, 1700, 1900, it hangs after some time.
> > freq 800, 2100, 2600, it hangs immediately, but not 100%.
> > freq 2400, it always hangs immediately, I could not see command sysctl
> > return message.
> >
> > I think I got the same hang, keyboard and ethernet no respond, but no
> > panic message.
>
> While it is not OK, that your system is unstable or crashes
> immediately if you try to manually set the core frequency,
> these frequency adjustments may not be required on your
> system, anyway.
>
> AFAIR, tests showed that frequency changes do not affect
> power consumption as much as higher C states. The reason is,
> that the CPU takes a lot less power at a lower frequency
> (e.g. 1/4 at half effective clock rate), the other components
> have near constant power demand, unless put to sleep.
>
> The effect of reduced CPU power may thus be over compensated
> by keeping RAM and other resources active for a longer time
> (since the calculation will take longer).
>
> Therefore, the advice was to keep the CPU running at nominal
> clock rate, but to enable all features that increase idle
> power savings.
>
> The frequencies in your list let me guess, that throttling
> is enabled on your notebook. That has just been disabled in
> -CURRENT by default, since it causes bad effects (including
> crashes) on modern hardware.
>
> You may want to add the following two lines to your
> /boot/loader.conf:
>
> hint.p4tcc.0.disabled="1"
> hint.acpi_throttle.0.disabled="1"
>
> Regards, STefan
>
I already disable  throttling, this is my /boot/loader.conf:

#boot_verbose="YES"
boot_single="YES"
#kern.msgbufsize=6553600

#Firewire for debug
hw.firewire.phydma_enable=1
hw.firewire.dcons_crom.force_console=1
boot_multicons="YES"
dcons_gdb=1

# openjdk need it in 10.0-release
vm.pmap.pcid_enabled="0"

# SSD quickly no respond without this
hint.ahci.0.msi=0
#hint.ahcich.0.pm_level=5

#coretemp_load="YES"
#if_bge_load="YES"
#cuse4bsd_load="YES"
cpuctl_load="YES"
if_ipheth_load="YES"
nvidia_load="YES"
sem_load="YES"

# save power
hint.p4tcc.0.disabled=1
hint.acpi_throttle.0.disabled=1
hw.pci.do_power_nodriver=3
hw.snd.latency=7

# disable ng_ubt and bluetooth
# remove ng_ubt.ko in /boot/kernel


#disable nvidia audio
hint.hdaa.0.nid4.config="as=0"
hint.hdaa.0.nid5.config="as=0"
hint.hdaa.0.nid6.config="as=0"
hint.hdaa.0.nid7.config="as=0"

# red light in headphone, but this enable sound output
hint.hdaa.1.gpio_config="0=set"

# seq=15 misc=1 enable sound output into headdphone
hint.hdaa.1.nid16.config="as=2 seq=15 conn=Jack device=Headphones misc=1"

#very bad sound quality output, set "as=0" disable it.
hint.hdaa.1.nid18.config="as=0 seq=0 conn=Fixed device=Speaker misc=1"

#This is good quality speaker.
hint.hdaa.1.nid19.config="as=1 seq=2 conn=Fixed device=Speaker misc=1"

hint.hdaa.1.nid24.config="as=4 seq=0 device=Mic conn=jack misc=1 "
hint.hdaa.1.nid28.config="as=4 seq=1 device=Mic conn=Fixed"
hint.hdaa.1.nid33.config="as=3 seq=0 device=SPDIF-out conn=Jack"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAB8uncZ3ekmejbEZVf41QUOHyzFLT7Zjf=DHk_sP0uBQ2%2BfSkw>