Bug 146436 - [cpufreq] [panic] Panic when changing profile to economy
Summary: [cpufreq] [panic] Panic when changing profile to economy
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 11.0-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-acpi (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-09 18:50 UTC by David Demelier
Modified: 2018-05-29 09:21 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Demelier 2010-05-09 18:50:04 UTC
When changing the power profile to economy with these settings in /etc/rc.conf : 

performance_cx_lowest="HIGH"
performance_cpu_freq=${performance_cx_lowest}
economy_cx_lowest="LOW"
economy_cpu_freq=${economy_cx_lowest}

Because I wasn't capable to make a kernel dump, it just doesn't work. So I took a picture of the kernel panic and the small backtrace. Here is the mail discuss.

http://lists.freebsd.org/pipermail/freebsd-stable/2010-May/056600.html

At the beginning I thought it was a AC cable problem but not, it's only the profile state that make the panic.

How-To-Repeat: Change profile to economy with these settings : 

performance_cx_lowest="HIGH"
performance_cpu_freq=${performance_cx_lowest}
economy_cx_lowest="LOW"
economy_cpu_freq=${economy_cx_lowest}
Comment 1 cyril.elkaim 2017-01-02 10:02:56 UTC
Hi,

I have the same bug with my netbook (a compaq mini 1000) when I pull the plug. The machine runs on battery for 10-12 minutes then reboot almost every time. I was able to get a trace in the log during the reboot following the crash. My machine runs the latest FreeBSD 11 with all the patches applied.

Hope this may help,

Cyril Elkaim

Jan  1 21:50:01 citron power_profile: changed to 'economy'
Jan  1 22:12:28 citron syslogd: kernel boot file is /boot/kernel/kernel
Jan  1 22:12:28 citron kernel: panic: worklist_remove: 0xc7480e00 allocindir(0x5) not on list
Jan  1 22:12:28 citron kernel: cpuid = 0
Jan  1 22:12:28 citron kernel: KDB: stack backtrace:
Jan  1 22:12:28 citron kernel: #0 0xc0d6594f at kdb_backtrace+0x4f
Jan  1 22:12:28 citron kernel: #1 0xc0d15515 at vpanic+0x115
Jan  1 22:12:28 citron kernel: #2 0xc0d153fb at panic+0x1b
Jan  1 22:12:28 citron kernel: #3 0xc104f966 at softdep_disk_write_complete+0x18c6
Jan  1 22:12:28 citron kernel: #4 0xc0ddab76 at bufdone_finish+0x26
Jan  1 22:12:28 citron kernel: #5 0xc0ddaa12 at bufdone+0x62
Jan  1 22:12:28 citron kernel: #6 0xc0de41d8 at cluster_callback+0x58
Jan  1 22:12:28 citron kernel: #7 0xc0ddaa08 at bufdone+0x58
Jan  1 22:12:28 citron kernel: #8 0xc0c446d1 at g_vfs_done+0x351
Jan  1 22:12:28 citron kernel: #9 0xc0c3fe61 at g_io_deliver+0x311
Jan  1 22:12:28 citron kernel: #10 0xc0c43bfc at g_std_done+0x6c
Jan  1 22:12:28 citron kernel: #11 0xc0c3fe61 at g_io_deliver+0x311
Jan  1 22:12:28 citron kernel: #12 0xc0c3c957 at g_disk_done+0x1d7
Jan  1 22:12:28 citron kernel: #13 0xc0508f34 at adadone+0x11b4
Jan  1 22:12:28 citron kernel: #14 0xc04daa90 at xpt_done_process+0x910
Jan  1 22:12:28 citron kernel: #15 0xc04dd5b4 at xpt_done_td+0x1a4
Jan  1 22:12:28 citron kernel: #16 0xc0cc2e81 at fork_exit+0x71
Jan  1 22:12:28 citron kernel: Copyright (c) 1992-2016 The FreeBSD Project.
Jan  1 22:12:28 citron kernel: Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
Jan  1 22:12:28 citron kernel: The Regents of the University of California. All rights reserved.
Jan  1 22:12:28 citron kernel: FreeBSD is a registered trademark of The FreeBSD Foundation.
Jan  1 22:12:28 citron kernel: FreeBSD 11.0-RELEASE-p1 #0 r306420: Thu Sep 29 03:40:55 UTC 2016
Jan  1 22:12:28 citron kernel: root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC i386
Jan  1 22:12:28 citron kernel: FreeBSD clang version 3.8.0 (tags/RELEASE_380/final 262564) (based on LLVM 3.8.0)
Jan  1 22:12:28 citron kernel: VT(vga): resolution 640x480
Jan  1 22:12:28 citron kernel: CPU: Intel(R) Atom(TM) CPU N270   @ 1.60GHz (1596.04-MHz 686-class CPU)
Jan  1 22:12:28 citron kernel: Origin="GenuineIntel"  Id=0x106c2  Family=0x6  Model=0x1c  Stepping=2
Jan  1 22:12:28 citron kernel: Features=0xbfe9fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
Jan  1 22:12:28 citron kernel: Features2=0x40c39d<SSE3,DTES64,MON,DS_CPL,EST,TM2,SSSE3,xTPR,PDCM,MOVBE>
Jan  1 22:12:28 citron kernel: AMD Features=0x100000<NX>
Jan  1 22:12:28 citron kernel: AMD Features2=0x1<LAHF>
Jan  1 22:12:28 citron kernel: TSC: P-state invariant, performance statistics
Jan  1 22:12:28 citron kernel: real memory  = 2147483648 (2048 MB)
Jan  1 22:12:28 citron kernel: avail memory = 2068348928 (1972 MB)
Jan  1 22:12:28 citron kernel: Event timer "LAPIC" quality 400
Jan  1 22:12:28 citron kernel: ACPI APIC Table: <110708 APIC1432>
Jan  1 22:12:28 citron kernel: FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
Jan  1 22:12:28 citron kernel: FreeBSD/SMP: 1 package(s) x 2 hardware threads
Jan  1 22:12:28 citron kernel: random: unblocking device.
Jan  1 22:12:28 citron kernel: ioapic0: Changing APIC ID to 2
Jan  1 22:12:28 citron kernel: ioapic0 <Version 2.0> irqs 0-23 on motherboard
Jan  1 22:12:28 citron kernel: random: entropy device external interface
Jan  1 22:12:28 citron kernel: kbd1 at kbdmux0
Jan  1 22:12:28 citron kernel: module_register_init: MOD_LOAD (vesa, 0xc1295360, 0) error 19
Jan  1 22:12:28 citron kernel: vtvga0: <VT VGA driver> on motherboard
Jan  1 22:12:28 citron kernel: cryptosoft0: <software crypto> on motherboard
Jan  1 22:12:28 citron kernel: acpi0: <110708 RSDT1432> on motherboard
Jan  1 22:12:28 citron kernel: acpi0: Power Button (fixed)
Jan  1 22:12:28 citron kernel: cpu0: <ACPI CPU> on acpi0
Jan  1 22:12:28 citron kernel: cpu1: <ACPI CPU> on acpi0
Jan  1 22:12:28 citron kernel: attimer0: <AT timer> port 0x40-0x43 irq 0 on acpi0
Jan  1 22:12:28 citron kernel: Timecounter "i8254" frequency 1193182 Hz quality 0
Jan  1 22:12:28 citron kernel: Event timer "i8254" frequency 1193182 Hz quality 100
Jan  1 22:12:28 citron kernel: atrtc0: <AT realtime clock> port 0x70-0x71 irq 8 on acpi0
Jan  1 22:12:28 citron kernel: Event timer "RTC" frequency 32768 Hz quality 0
Jan  1 22:12:28 citron kernel: Timecounter "ACPI-fast" frequency 3579545 Hz quality 900
Jan  1 22:12:28 citron kernel: acpi_timer0: <24-bit timer at 3.579545MHz> port 0x808-0x80b on acpi0
Jan  1 22:12:28 citron kernel: acpi_ec0: <Embedded Controller: GPE 0x17> port 0x62,0x66 on acpi0
Jan  1 22:12:28 citron kernel: pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
Jan  1 22:12:28 citron kernel: pci0: <ACPI PCI bus> on pcib0
Jan  1 22:12:28 citron kernel: vgapci0: <VGA-compatible display> port 0xdc80-0xdc87 mem 0xfe980000-0xfe9fffff,0xd0000000-0xdfffffff,0xfe940000-0xfe97ffff irq 16 at device 2.0 on pci0
Jan  1 22:12:28 citron kernel: agp0: <Intel 945GME SVGA controller> on vgapci0
Jan  1 22:12:28 citron kernel: agp0: aperture size is 256M, detected 7932k stolen memory
Jan  1 22:12:28 citron kernel: vgapci0: Boot video device
Jan  1 22:12:28 citron kernel: vgapci1: <VGA-compatible display> mem 0xfe880000-0xfe8fffff at device 2.1 on pci0
Jan  1 22:12:28 citron kernel: hdac0: <Intel 82801G HDA Controller> mem 0xfe938000-0xfe93bfff irq 16 at device 27.0 on pci0
Jan  1 22:12:28 citron kernel: pcib1: <ACPI PCI-PCI bridge> irq 16 at device 28.0 on pci0
Jan  1 22:12:28 citron kernel: pcib1: [GIANT-LOCKED]
Jan  1 22:12:28 citron kernel: pci1: <ACPI PCI bus> on pcib1
Jan  1 22:12:28 citron kernel: siba_bwn0: <Broadcom BCM4312 802.11b/g Wireless> mem 0xfeafc000-0xfeafffff irq 16 at device 0.0 on pci1
Jan  1 22:12:28 citron kernel: bwn0 on siba_bwn0
Jan  1 22:12:28 citron kernel: bwn0: WLAN (chipid 0x4312 rev 15) PHY (analog 6 type 5 rev 1) RADIO (manuf 0x17f ver 0x2062 rev 2)
Jan  1 22:12:28 citron kernel: bwn0: DMA (64 bits)
Jan  1 22:12:28 citron kernel: bwn0: Using 1 MSI messages
Jan  1 22:12:28 citron kernel: pcib2: <ACPI PCI-PCI bridge> irq 17 at device 28.1 on pci0
Jan  1 22:12:28 citron kernel: pcib2: [GIANT-LOCKED]
Jan  1 22:12:28 citron kernel: uhci0: <Intel 82801G (ICH7) USB controller USB-A> port 0xdc00-0xdc1f irq 23 at device 29.0 on pci0
Jan  1 22:12:28 citron kernel: uhci0: LegSup = 0x3f00
Jan  1 22:12:28 citron kernel: usbus0 on uhci0
Jan  1 22:12:28 citron kernel: uhci1: <Intel 82801G (ICH7) USB controller USB-B> port 0xd880-0xd89f irq 19 at device 29.1 on pci0
Jan  1 22:12:28 citron kernel: uhci1: LegSup = 0x2f00
Jan  1 22:12:28 citron kernel: usbus1 on uhci1
Jan  1 22:12:28 citron kernel: uhci2: <Intel 82801G (ICH7) USB controller USB-C> port 0xd800-0xd81f irq 18 at device 29.2 on pci0
Jan  1 22:12:28 citron kernel: uhci2: LegSup = 0x2f00
Jan  1 22:12:28 citron kernel: usbus2 on uhci2
Jan  1 22:12:28 citron kernel: uhci3: <Intel 82801G (ICH7) USB controller USB-D> port 0xd480-0xd49f irq 16 at device 29.3 on pci0
Jan  1 22:12:28 citron kernel: uhci3: LegSup = 0x2f00
Jan  1 22:12:28 citron kernel: usbus3 on uhci3
Jan  1 22:12:28 citron kernel: ehci0: <Intel 82801GB/R (ICH7) USB 2.0 controller> mem 0xfe937c00-0xfe937fff irq 23 at device 29.7 on pci0
Jan  1 22:12:28 citron kernel: usbus4: EHCI version 1.0
Jan  1 22:12:28 citron kernel: usbus4 on ehci0
Jan  1 22:12:28 citron kernel: pcib3: <ACPI PCI-PCI bridge> at device 30.0 on pci0
Jan  1 22:12:28 citron kernel: pci2: <ACPI PCI bus> on pcib3
Jan  1 22:12:28 citron kernel: isab0: <PCI-ISA bridge> at device 31.0 on pci0
Jan  1 22:12:28 citron kernel: isa0: <ISA bus> on isab0
Jan  1 22:12:28 citron kernel: atapci0: <Intel ICH7 UDMA100 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xffa0-0xffaf at device 31.1 on pci0
Jan  1 22:12:28 citron kernel: ata0: <ATA channel> at channel 0 on atapci0
Jan  1 22:12:28 citron kernel: acpi_button0: <Sleep Button> on acpi0
Jan  1 22:12:28 citron kernel: acpi_button1: <Power Button> on acpi0
Jan  1 22:12:28 citron kernel: acpi_tz0: <Thermal Zone> on acpi0
Jan  1 22:12:28 citron kernel: acpi_lid0: <Control Method Lid Switch> on acpi0
Jan  1 22:12:28 citron kernel: atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
Jan  1 22:12:28 citron kernel: atkbd0: <AT Keyboard> irq 1 on atkbdc0
Jan  1 22:12:28 citron kernel: kbd0 at atkbd0
Jan  1 22:12:28 citron kernel: atkbd0: [GIANT-LOCKED]
Jan  1 22:12:28 citron kernel: psm0: <PS/2 Mouse> irq 12 on atkbdc0
Jan  1 22:12:28 citron kernel: psm0: [GIANT-LOCKED]
Jan  1 22:12:28 citron kernel: psm0: model Generic PS/2 mouse, device ID 0
Jan  1 22:12:28 citron kernel: battery0: <ACPI Control Method Battery> on acpi0
Jan  1 22:12:28 citron kernel: acpi_acad0: <AC Adapter> on acpi0
Jan  1 22:12:28 citron kernel: pmtimer0 on isa0
Jan  1 22:12:28 citron kernel: orm0: <ISA Option ROMs> at iomem 0xcf000-0xcffff,0xd0000-0xd0fff pnpid ORM0000 on isa0
Jan  1 22:12:28 citron kernel: ppc0: parallel port not found.
Jan  1 22:12:28 citron kernel: est0: <Enhanced SpeedStep Frequency Control> on cpu0
Jan  1 22:12:28 citron kernel: est1: <Enhanced SpeedStep Frequency Control> on cpu1
Jan  1 22:12:28 citron kernel: Timecounters tick every 1.000 msec
Jan  1 22:12:28 citron kernel: nvme cam probe device init
Jan  1 22:12:28 citron kernel: hdacc0: <IDT 92HD75B3 HDA CODEC> at cad 0 on hdac0
Jan  1 22:12:28 citron kernel: hdaa0: <IDT 92HD75B3 Audio Function Group> at nid 1 on hdacc0
Jan  1 22:12:28 citron kernel: pcm0: <IDT 92HD75B3 (Analog 2.0+HP/2.0)> at nid 13,10 and 11,14 on hdaa0
Jan  1 22:12:28 citron kernel: usbus0: 12Mbps Full Speed USB v1.0
Jan  1 22:12:28 citron kernel: usbus1: 12Mbps Full Speed USB v1.0
Jan  1 22:12:28 citron kernel: ugen0.1: <Intel> at usbus0
Jan  1 22:12:28 citron kernel: uhub0: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus0
Jan  1 22:12:28 citron kernel: ugen1.1: <Intel> at usbus1
Jan  1 22:12:28 citron kernel: uhub1: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus1
Jan  1 22:12:28 citron kernel: usbus2: 12Mbps Full Speed USB v1.0
Jan  1 22:12:28 citron kernel: usbus3: 12Mbps Full Speed USB v1.0
Jan  1 22:12:28 citron kernel: usbus4: 480Mbps High Speed USB v2.0
Jan  1 22:12:28 citron kernel: ugen2.1: <Intel> at usbus2
Jan  1 22:12:28 citron kernel: uhub2: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus2
Jan  1 22:12:28 citron kernel: ugen3.1: <Intel> at usbus3
Jan  1 22:12:28 citron kernel: uhub3: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus3
Jan  1 22:12:28 citron kernel: ugen4.1: <Intel> at usbus4
Jan  1 22:12:28 citron kernel: uhub4: <Intel EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus4
Jan  1 22:12:28 citron kernel: ada0 at ata0 bus 0 scbus0 target 0 lun 0
Jan  1 22:12:28 citron kernel: ada0: <TOSHIBA MK6028GAL BN101C> ATA-7 device
Jan  1 22:12:28 citron kernel: ada0: Serial Number Y8E5S80ZS
Jan  1 22:12:28 citron kernel: ada0: 100.000MB/s transfers (UDMA5, PIO 8192bytes)
Jan  1 22:12:28 citron kernel: ada0: 57231MB (117210240 512 byte sectors)
Jan  1 22:12:28 citron kernel: SMP: AP CPU #1 Launched!
Jan  1 22:12:28 citron kernel: Timecounter "TSC" frequency 1596036900 Hz quality 1000
Jan  1 22:12:28 citron kernel: Trying to mount root from ufs:/dev/ada0p2 [rw]...
Jan  1 22:12:28 citron kernel: uhub0: 2 ports with 2 removable, self powered
Jan  1 22:12:28 citron kernel: uhub1: 2 ports with 2 removable, self powered
Jan  1 22:12:28 citron kernel: uhub2: 2 ports with 2 removable, self powered
Jan  1 22:12:28 citron kernel: uhub3: 2 ports with 2 removable, self powered
Jan  1 22:12:28 citron kernel: WARNING: / was not properly dismounted
Jan  1 22:12:28 citron kernel: WARNING: /: mount pending error: blocks 80 files 1
Jan  1 22:12:28 citron kernel: uhub4: 8 ports with 8 removable, self powered
Jan  1 22:12:28 citron kernel: ugen4.2: <importek> at usbus4
Jan  1 22:12:28 citron kernel: ugen1.2: <Broadcom Corp> at usbus1
Jan  1 22:12:28 citron kernel: ubt0: <Broadcom Corp Bluetooth 2.1 module, class 224/1, rev 2.00/6.07, addr 2> on usbus1
Jan  1 22:12:28 citron kernel: ugen4.3: <Generic> at usbus4
Jan  1 22:12:28 citron kernel: umass0: <Generic Mass Storage Device, class 0/0, rev 2.00/1.05, addr 3> on usbus4
Jan  1 22:12:28 citron kernel: umass0:  SCSI over Bulk-Only; quirks = 0x4001
Jan  1 22:12:28 citron kernel: umass0:1:0: Attached to scbus1
Jan  1 22:12:28 citron kernel: da0 at umass-sim0 bus 0 scbus1 target 0 lun 0
Jan  1 22:12:28 citron kernel: da0: <Single Flash Reader 1.00> Removable Direct Access SCSI device
Jan  1 22:12:28 citron kernel: da0: Serial Number 058F63356336
Jan  1 22:12:28 citron kernel: da0: 40.000MB/s transfers
Jan  1 22:12:28 citron kernel: da0: Attempt to query device size failed: NOT READY, Medium not present
Jan  1 22:12:28 citron kernel: da0: quirks=0x2<NO_6_BYTE>
Jan  1 22:12:28 citron kernel: wlan0: Ethernet address: 00:23:4e:c1:ec:a7
Jan  1 22:12:28 citron kernel: bwn0: ucode fw: ucode15
Jan  1 22:12:28 citron kernel: bwn0: firmware version (rev 478 patch 104 date 0x8701 time 0x657)
Jan  1 22:12:28 citron kernel: bwn0: ucode fw: ucode15
Jan  1 22:12:28 citron kernel: bwn0: firmware version (rev 478 patch 104 date 0x8701 time 0x657)
Jan  1 22:12:28 citron kernel: bwn0: ucode fw: ucode15
Jan  1 22:12:28 citron kernel: bwn0: firmware version (rev 478 patch 104 date 0x8701 time 0x657)
Jan  1 22:12:28 citron kernel: bwn0: ucode fw: ucode15
Jan  1 22:12:28 citron kernel: bwn0: firmware version (rev 478 patch 104 date 0x8701 time 0x657)
Jan  1 22:12:28 citron kernel: bwn0: ucode fw: ucode15
Jan  1 22:12:28 citron kernel: bwn0: firmware version (rev 478 patch 104 date 0x8701 time 0x657)
Jan  1 22:12:28 citron kernel: wlan0: link state changed to UP
Jan  1 22:12:28 citron kernel: bwn0: need multicast update callback
Jan  1 22:12:28 citron kernel: bwn0: RX decryption attempted (old 0 keyidx 0x2)
Jan  1 22:12:28 citron kernel: bwn0: need multicast update callback
Jan  1 22:12:28 citron kernel: bwn0: need multicast update callback
Jan  1 22:12:28 citron kernel: bwn0: RX decryption attempted (old 0 keyidx 0x2)
Jan  1 22:12:28 citron last message repeated 9 times
Comment 2 Hiren Panchasara freebsd_committer freebsd_triage 2017-01-02 20:07:24 UTC
This may not be the same bug as original report. Hopefully someone on acpi@ can help.
Comment 3 Ian Smith 2017-01-03 08:52:51 UTC
(In reply to Hiren Panchasara from comment #2)

The original bug was apparently solved as noted in this post and subsequent comments in that thread by jhb@.  I guess it should have been closed earlier:

https://lists.freebsd.org/pipermail/freebsd-stable/2010-June/057234.html

The new report likely needs some further info like rc.conf settings  for {performance|economy}_{cx_lowest|cpu_freq},  related sysctls when running with
 and without AC power,  whether powerd is running, etc, but yes I expect it's
 an unrelated issue to the old one, not panicing immediately like the first.
Comment 4 cyril.elkaim 2017-01-03 10:55:26 UTC
Hello,

What kind of information do you need? I'm willing to help because the machine crash every time I plug it off :)

It's running the following processes:

   3  -  DL    0:00,00 [crypto returns]
   4  -  DL    0:00,08 [cam]
   5  -  DL    0:00,00 [sctp_iterator]
   6  -  DL    0:00,17 [rand_harvestq]
   7  -  DL    0:00,00 [soaiod1]
   8  -  DL    0:00,00 [soaiod2]
   9  -  DL    0:00,00 [soaiod3]
  10  -  DL    0:00,00 [audit]
  11  -  RL   24:49,02 [idle]
  12  -  WL    0:03,11 [intr]
  13  -  DL    0:00,00 [ng_queue]
  14  -  DL    0:00,04 [geom]
  15  -  DL    0:01,25 [usb]
  16  -  DL    0:00,04 [acpi_thermal]
  17  -  DL    0:00,01 [acpi_cooling0]
  18  -  DL    0:00,00 [soaiod4]
  19  -  DL    0:00,03 [pagedaemon]
  20  -  DL    0:00,00 [vmdaemon]
  21  -  DL    0:00,00 [pagezero]
  22  -  DL    0:00,05 [bufdaemon]
  23  -  DL    0:00,01 [bufspacedaemon]
  24  -  DL    0:00,06 [syncer]
  25  -  DL    0:00,01 [vnlru]
 327  -  Ss    0:00,01 /usr/sbin/wpa_supplicant -s -B -i wlan0 -c /etc/wpa_supplicant.conf -D bsd -P /var/run/wpa_supplicant/wlan0.pid
 339  -  Is    0:00,01 dhclient: wlan0 [priv] (dhclient)
 418  -  Is    0:00,00 dhclient: wlan0 (dhclient)
 665  -  Is    0:00,00 /sbin/devd
 708  -  Is    0:00,10 /usr/sbin/unbound -c /var/unbound/unbound.conf
 744  -  Ss    0:00,03 /usr/sbin/syslogd -s
 896  -  Ss    0:00,23 /usr/sbin/ntpd -c /etc/ntp.conf -p /var/run/ntpd.pid -f /var/db/ntpd.drift
 899  -  Ss    0:00,20 /usr/sbin/powerd
 920  -  Is    0:00,00 postgres: checkpointer process    (postgres)
 921  -  Ss    0:00,04 postgres: writer process    (postgres)
 922  -  Ss    0:00,01 postgres: wal writer process    (postgres)
 923  -  Ss    0:00,02 postgres: autovacuum launcher process    (postgres)
 924  -  Ss    0:00,05 postgres: stats collector process    (postgres)
 968  -  Is    0:00,01 /usr/sbin/sshd
 973  -  Ss    0:00,05 /usr/local/sbin/httpd -DNOHTTPACCEPT
 976  -  I     0:00,00 /usr/local/sbin/httpd -DNOHTTPACCEPT
 977  -  S     0:00,01 /usr/local/sbin/httpd -DNOHTTPACCEPT
 979  -  I     0:00,00 /usr/local/sbin/httpd -DNOHTTPACCEPT
 980  -  I     0:00,00 /usr/local/sbin/httpd -DNOHTTPACCEPT
 981  -  I     0:00,00 /usr/local/sbin/httpd -DNOHTTPACCEPT
 991  -  Is    0:00,01 /usr/sbin/cron -s
1007  -  Is    0:00,01 /usr/sbin/moused -p /dev/psm0 -t auto
1065  -  Is    0:00,00 ssh-agent -a /home/cyril/tmp/ssh-cyril.agent
1100  -  Is    0:00,12 sshd: cyril [priv] (sshd)
1103  -  S     0:00,04 sshd: cyril@pts/0 (sshd)
 917 v0- S     0:00,11 /usr/local/bin/postgres -D /var/db/postgresql/data
1053 v0  Is+   0:00,01 /usr/libexec/getty Pc ttyv0
1107 v1  Is+   0:00,00 /usr/libexec/getty Pc ttyv1
1055 v2  Is+   0:00,01 /usr/libexec/getty Pc ttyv2
1056 v3  Is+   0:00,00 /usr/libexec/getty Pc ttyv3
1057 v4  Is+   0:00,01 /usr/libexec/getty Pc ttyv4
1058 v5  Is+   0:00,01 /usr/libexec/getty Pc ttyv5
1059 v6  Is+   0:00,01 /usr/libexec/getty Pc ttyv6
1060 v7  Is+   0:00,01 /usr/libexec/getty Pc ttyv7
1104  0  Ss    0:00,55 -zsh (zsh)
1118  0  R+    0:00,01 ps ax

==================================================================

List of loaded kernel modules:

~/ kldstat
Id Refs Address    Size     Name
 1   38 0xc0400000 1a96c50  kernel
 2    1 0xc1e98000 3de94    if_bwn.ko
 3    2 0xc1ed6000 b144     siba_bwn.ko
 4    1 0xc1ee2000 186f4    if_run.ko
 5    1 0xc1efb000 2dbf0    bwn_v4_lp_ucode.ko
 6    1 0xc1f29000 5a98     sem.ko
 7    1 0xc1f2f000 78bc     ng_ubt.ko
 8    2 0xc1f37000 c634     ng_hci.ko
 9    4 0xc1f44000 2d70     ng_bluetooth.ko
10    6 0xc1f47000 fb4c     netgraph.ko
11    1 0xc1f57000 3af4     runfw.ko
12    1 0xc79d8000 4000     fdescfs.ko
13    1 0xc7be8000 10000    ng_l2cap.ko
14    1 0xc7e0c000 21000    ng_btsocket.ko


===================================================================

Content of /etc/rc.conf:

~/ cat /etc/rc.conf
#
# machine setup
#

hostname="citron"
keymap="fr"

#
# network
#

wlans_bwn0="wlan0"
ifconfig_wlan0="WPA SYNCDHCP"

#
# base system configuration
#

local_unbound_enable="YES"
moused_enable="YES"
ntpd_enable="YES"
powerd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="NO"

#
# services
#

sshd_enable="YES"

# using SSMTP instead
sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"

apache24_enable="YES"

postgresql_enable="YES"
postgresql_data="/var/db/postgresql/data"
postgresql_initdb_flags="--encoding=utf-8 --lc-collate=C"

========================================================================

Which sysctl values do you need, the list is huge !

Thanks,

Cyril Elkaim
Comment 5 Ian Smith 2017-01-04 11:41:39 UTC
(In reply to cyril.elkaim from comment #4)

The first thing I'd do is make sure that your compaq mini 1000 isn't just
 running out of battery.  The gap between going to 'economy' and reboot
above is about 22 minutes, but unless the battery is more recent than say
three years or so, that could be the case?  If you resume more or less
immediately after suspend, does it normally resume correctly?

I'd try running something like this in a script, in background, before
switching to battery: % sh /somewhere/myscript &

#!/bin/sh
while true; do
 date; acpiconf -i0 | egrep 'State|Remain|Present' >> /somewhere/logfile
 sleep 60   # perhaps
done

If that shows any problem, post full 'acpiconf -i0' output here.

If that's ok, then as per https://wiki.freebsd.org/DebuggingSuspendResume
you could try unloading anything not immediately needed before suspending,
  I'd first try unloading (or not loading in the first place):

a) everything to do with bluetooth, and therefore all netgraph modules.
b) if you can do without for a while, everything to do with wireless.
c) anything else you can do without during testing, including Xorg.

If none of that makes any  difference, we can dig deeper into sysctls etc.

I'm no expert at any of this .. hopefully others will offer suggestions.
Comment 6 Ian Smith 2017-01-04 12:02:37 UTC
(In reply to cyril.elkaim from comment #4)

Argh, sorry; timestamps matter.  That should be:

 date >> /somewhere/logfile
 acpiconf -i0 | egrep 'State|Remain|Present' >> /somewhere/logfile
Comment 7 cyril.elkaim 2017-01-05 10:10:12 UTC
Hi,

The battery is OK, it's a relatively new one and it lasts 2 hours approximately. The machine reboots automatically, on the battery, when this happens and stays stable during the duration of the battery (~2hours).

I will try your script and will report results as soon as possible.

I will take your advice to unload as many services as possible between switching to the battery mode. BTW that never happens in the other side, from unplugged to plugged.

Thanks,

Cyril Elkaim
Comment 8 cyril.elkaim 2017-01-05 10:14:22 UTC
Sorry I forgot to post a new trace, here it is:

When watching the messages I remove the plug and this it what happen:
 
Jan  5 10:54:50 citron kernel: e1000phy0: detached
Jan  5 10:54:50 citron kernel: miibus0: detached
Jan  5 10:54:50 citron kernel: msk0: phy write timeout
Jan  5 10:54:50 citron kernel: msk0: detached
Jan  5 10:54:50 citron kernel: mskc0: detached
Jan  5 10:54:50 citron kernel: pci2: detached
Jan  5 10:54:50 citron power_profile: changed to 'economy'
Jan  5 11:00:27 citron syslogd: kernel boot file is /boot/kernel/kernel
Jan  5 11:00:27 citron kernel: panic: softdep_sync_buf: Unknown type ???
Jan  5 11:00:27 citron kernel: cpuid = 0
Jan  5 11:00:27 citron kernel: KDB: stack backtrace:
Jan  5 11:00:27 citron kernel: #0 0xc0d6594f at kdb_backtrace+0x4f
Jan  5 11:00:27 citron kernel: #1 0xc0d15515 at vpanic+0x115
Jan  5 11:00:27 citron kernel: #2 0xc0d153fb at panic+0x1b
Jan  5 11:00:27 citron kernel: #3 0xc106586b at softdep_sync_buf+0x16eb
Jan  5 11:00:27 citron kernel: #4 0xc1077241 at ffs_syncvnode+0x3a1
Jan  5 11:00:27 citron kernel: #5 0xc1076056 at ffs_fsync+0x26
Jan  5 11:00:27 citron kernel: #6 0xc1362b49 at VOP_FSYNC_APV+0x69
Jan  5 11:00:27 citron kernel: #7 0xc0e00a44 at sched_sync+0x3d4
Jan  5 11:00:27 citron kernel: #8 0xc0cc2e81 at fork_exit+0x71
Jan  5 11:00:27 citron kernel: Copyright (c) 1992-2016 The FreeBSD Project.
Jan  5 11:00:27 citron kernel: Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
Comment 9 Ian Smith 2017-01-05 11:07:57 UTC
(In reply to cyril.elkaim from comment #7)

Sounds like the battery is ok and has nothing to do with it, so don't worry
about the script.  Sorry for the wild goose chase ..

From your second reboot panic message, all I can say is it smells more like
a disk / ffs / softdep issue, about which I know _nothing_.

I don't think I can contribute anything further, but I suspect the new panic
message should help identify the problem to those who know about such things.

cheers, Ian
Comment 10 Eitan Adler freebsd_committer freebsd_triage 2018-05-28 19:47:38 UTC
batch change:

For bugs that match the following
-  Status Is In progress 
AND
- Untouched since 2018-01-01.
AND
- Affects Base System OR Documentation

DO:

Reset to open status.


Note:
I did a quick pass but if you are getting this email it might be worthwhile to double check to see if this bug ought to be closed.
Comment 11 Andriy Gapon freebsd_committer freebsd_triage 2018-05-29 09:21:42 UTC
Per comment #3.