Автор Тема: [Решено] nx6110 - мёртвое зависание на перезагрузке  (Прочитано 6646 раз)

Оффлайн Speccyfighter

  • Мастер
  • ***
  • Сообщений: 10 259
Преамбула.
Ноутбук HP Compaq NX6110 используется чуть больше полгода. И всё шло нормально: suspend-to-ram, powerdown... Пока последнее время не воспользовался перезагрузкой из меню и позже командой reboot/shutdown -r. Результат один:
- после сообщения
reboot: Restarting system
мёртвое зависание ноутбука. Нет реакции ни на что кроме кнопки Power Off/On.
Ни один Линукс на nx6110 не смог уйти после ребута в рестарт и все они полностью вешали ноутбук намертво. Решение проблемы некоторым образом осложнялось тем, что на той же Intel-архитектуре, но существенно свежее, т.е. LGA 1155, рестарт после reboot выполняется нормально.
Дня три сражался и искал решение с перерывами, и таки нашёл.

Разыскал великолепнейшую статью на англоязычном сайте (парень не обидится за полное цитирование со ссылкой на оригинал).

Решение проблемы полного зависания ноутбука на рестарте после разгрузки системы

HOWTO: Fix Linux hang/freeze during reboots and restarts
Aug.04, 2009 in Boot, HOWTO

Purpose: There are some machines on which Linux will freeze, after a restart or a shutdown command is issued, right at the very end of the process forcing you to do a hard reset – press the reset/power button the system or plug the cord which is not good.In this post we will see how you can resolve almost 99% of freeze/hang that occurs during shutdown or reboot.

Why this happens

There are many reasons why this happens – some times it is an BIOS issue or sometimes it’s just that your system has a different kind of hardware setup, for example no keyboard controller, and Linux (the kernel) does not understand how to tackle that situation. Most of the time if it is a BIOS issue it is not very easy to ask your system vendor to give you an immediate BIOS fix that will take care of the issue and hence you have to rely on some kernel parameters that you need to pass to fix the hang/freeze issue.

Let’s say you bought a new machine and you notice that your Linux distribution hangs at the very end of the reboot/shutdown process, upon giving any of the following commands:
# shutdown -r now
# shutdown -h now
# reboot
# halt
# poweroff
# Ctrl+Alt+Del

Solution

In order to fix the issue, you should try one-by-one passing the following parameter to the kernel, in the form of “reboot=<parameter>”, at the time of boot:
    warm =  Don’t set the cold reboot flag
    cold = Set the cold reboot flag
    bios = Reboot by jumping through the BIOS (only for X86_32)
    smp = Reboot by executing reset on BSP or other CPU (only for X86_32)
    triple = Force a triple fault (init)
    kbd = Use the keyboard controller. cold reset (default)
    acpi = Use the RESET_REG in the FADT
    efi = Use efi reset_system runtime service
    pci = Use the so-called “PCI reset register”, CF9
    force = Avoid anything that could hang.

As per my experience, one of the parameters (in blue color above) should be able to resolve your hang (or freeze) issue 90% of the time:
reboot=bios

or
reboot=acpi

Once your system boots you can verify whether the parameter was correctly passed or not by issuing the following command:
# cat /proc/cmdline

Output:
root=/dev/sda ro vga=791 quiet reboot=bios

You can find the list of all the above parameters in the reboot.c file in the Linux kernel source.

By default, the Linux kernel uses the reboot=kbd method i.e. it tries to look for a keyboard controller and issue a reset/shutdown command to it. But there are some systems like some of the Intel Atom processor based  machines that don’t have a keyboard controller and the above fixes are required. If you read the reboot.c file carefully there are some major main stream machines from Dell, Sony, HP, etc. that require the above “reboot=” fix. I guess sometime it is easier to fix the issue by using the kernel parameter rather than fixing in the BIOS.

Also you can also use the first letter (as denoted in the “[]” brackets) of each of the parameter:
reboot=b                 # for reboot=[b]ios
reboot= a                 # for reboot=[a]cpi

and you can pass multiple parameter at the same time and Linux kernel will try in order specified:
reboot=a,b,k,c      # for reboot=acpi,bios,kbd,cold

Happy Reboot=’ing!


Забегая вперёд, как 'опция=параметр' для ядра использовал именно 'reboot=bios'. Почему?
Потому, что команда reboot из FreeDOS запущенного с флешки отрабатывала нормально.
Как и в совсем другой версии DOS, команда reboot отрабатывала тоже нормально.

Собственно заглянуто было для корректировки и уточнения и на:
https://www.kernel.org/doc/Documentation/kernel-parameters.txt

   reboot=      [KNL]
         Format (x86 or x86_64):
            [w[arm] | c[old] | h[ard] | s[oft] | g[pio]] \
            [[,]s[mp]#### \
            [[,]b[ios] | a[cpi] | k[bd] | t[riple] | e[fi] | p[ci]] \
            [[,]f[orce]
         Where reboot_mode is one of warm (soft) or cold (hard) or gpio,
               reboot_type is one of bios, acpi, kbd, triple, efi, or pci,
               reboot_force is either force or not specified,
               reboot_cpu is s[mp]#### with #### being the processor
               to be used for rebooting.

Два подряд пробных и удачных ребута с параметром ядру
reboot=bios
подтвердило, что проблема полностью решена.

Спасибо:
Kushal Koolwal из Индии за обзорную статью
kernel.org за массу опций/параметров к ядру


Кстати, решение на просторах англоязычной сети найдено по запросу
linux hangs on reboot
Первой же ссылкой
« Последнее редактирование: 23.12.2015 09:04:31 от Speccyfighter »

Оффлайн Speccyfighter

  • Мастер
  • ***
  • Сообщений: 10 259
Ковыряясь с зависанием ноутбука nx6110 попутно откопал ещё одну проблему.
Она касается ядер std-def и un-def
# cat /var/log/kernel/warnings|tail -n 19|head -n 8
Nov 27 13:48:25 host-nx kernel: [    6.270460] sr0: scsi3-mmc drive: 24x/24x writer dvd-ram cd/rw xa/form2 cdda tray
Nov 27 13:48:26 host-nx kernel: [    6.378096]  excluding 0x3000-0x30ff 0x3400-0x34ff
Nov 27 13:48:26 host-nx kernel: [    6.382552]  excluding 0xd0000000-0xd003ffff
Nov 27 13:48:26 host-nx kernel: [    6.382581]  excluding 0x40000000-0x43ffffff
Nov 27 13:48:26 host-nx kernel: [    6.632497] ACPI Warning: SystemIO range 0x00001028-0x0000102f conflicts with OpRegion 0x00001000-0x0000103b (\_SB_.C002.C003.C086) (20131218/utaddress-258)
Nov 27 13:48:26 host-nx kernel: [    6.632510] ACPI Warning: SystemIO range 0x00001130-0x0000113f conflicts with OpRegion 0x00001100-0x0000113b (\_SB_.C002.C003.C097) (20131218/utaddress-258)
Nov 27 13:48:26 host-nx kernel: [    6.632517] ACPI Warning: SystemIO range 0x00001100-0x0000112f conflicts with OpRegion 0x00001100-0x0000113b (\_SB_.C002.C003.C097) (20131218/utaddress-258)
Nov 27 13:48:26 host-nx kernel: [    6.632525] lpc_ich: Resource conflict(s) found affecting gpio_ich

но эта проблема де-факто отсутствует в ядре led-ws
# cat /var/log/kernel/warnings|tail -n 3
Nov 27 14:21:56 host-nx kernel: led_core: module license 'unspecified' taints kernel.
Nov 27 14:21:56 host-nx kernel: Disabling lock debugging due to kernel taint
Nov 27 14:21:56 host-nx kernel: sr0: scsi3-mmc drive: 24x/24x writer dvd-ram cd/rw xa/form2 cdda tray

и сразу заработал sensors, а не только 'acpi -t'
$ sensors && acpi -t
acpitz-virtual-0
Adapter: Virtual device
temp1:        +41.0°C  (crit = +102.0°C)
temp2:        +43.0°C  (crit = +103.0°C)
temp3:        +28.8°C  (crit = +102.0°C)
temp4:        +20.0°C  (crit = +110.0°C)

Thermal 0: ok, 20.0 degrees C
Thermal 1: ok, 28.8 degrees C
Thermal 2: ok, 43.0 degrees C
Thermal 3: ok, 41.0 degrees C

Ну само-собой пришлось руками подпереть к led-ws модуль
apt-get install kernel-modules-sound-led-ws
# apt-cache show kernel-modules-sound-led-ws#3.4.96-alt0.M70P.1|grep Descr
Description: The Advanced Linux Sound Architecture modules
которое в std-def и un-def внутри kernel-image-*
« Последнее редактирование: 27.11.2014 15:10:07 от Speccyfighter »

Оффлайн Speccyfighter

  • Мастер
  • ***
  • Сообщений: 10 259
Конечно же прочитал, что отключение проверки может привести к непредсказуемым результатам
Цитировать
https://lkml.org/lkml/2012/10/5/577

You could also try adding "acpi_enforce_resources=lax" or
"acpi_enforce_resources=no" to your kernel parameters to disable the
ACPI conflict checking.  Note this could have other unintended
consequences.
Посмотреть бы, но как-то не хочется.

И надо же было увидеть
Цитировать
https://bugzilla.kernel.org/show_bug.cgi?id=48811#c6

This is an informative message, nothing to be fixed.
Which is why this bug is closed as invalid.
Очень интересно.
А с чего был сделан вывод, что варнинги растут на пустом месте?
$ uname -r
3.14.24-std-def-alt1
# cat /var/log/kernel/warnings|tail -n 8
Nov 27 15:34:54 host-nx kernel: [    6.094268] ACPI Warning: SystemIO range 0x00001028-0x0000102f conflicts with OpRegion 0x00001000-0x0000103b (\_SB_.C002.C003.C086) (20131218/utaddress-258)
Nov 27 15:34:54 host-nx kernel: [    6.094285] ACPI Warning: SystemIO range 0x00001130-0x0000113f conflicts with OpRegion 0x00001100-0x0000113b (\_SB_.C002.C003.C097) (20131218/utaddress-258)
Nov 27 15:34:54 host-nx kernel: [    6.094293] ACPI Warning: SystemIO range 0x00001100-0x0000112f conflicts with OpRegion 0x00001100-0x0000113b (\_SB_.C002.C003.C097) (20131218/utaddress-258)
Nov 27 15:34:54 host-nx kernel: [    6.094301] lpc_ich: Resource conflict(s) found affecting gpio_ich
Nov 27 15:34:54 host-nx kernel: [    6.459891] sr0: scsi3-mmc drive: 24x/24x writer dvd-ram cd/rw xa/form2 cdda tray
Nov 27 15:34:54 host-nx kernel: [    6.674093]  excluding 0x3000-0x30ff 0x3400-0x34ff
Nov 27 15:34:54 host-nx kernel: [    6.678730]  excluding 0xd0000000-0xd003ffff
Nov 27 15:34:54 host-nx kernel: [    6.678758]  excluding 0x40000000-0x43ffffff
$ sensors
No sensors found!
Make sure you loaded all the kernel drivers you need.
Try sensors-detect to find out which these are.
# uname -r
3.4.96-led-ws-alt0.M70P.1
# cat /var/log/kernel/warnings|tail -n 4
Nov 27 16:33:55 host-nx kernel: [ 3558.024092] perf samples too long (2504 > 2500), lowering kernel.perf_event_max_sample_rate to 50000
тут был ребут
Nov 27 16:36:39 host-nx kernel: led_core: module license 'unspecified' taints kernel.
Nov 27 16:36:39 host-nx kernel: Disabling lock debugging due to kernel taint
Nov 27 16:36:39 host-nx kernel: sr0: scsi3-mmc drive: 24x/24x writer dvd-ram cd/rw xa/form2 cdda tray
# sensors
acpitz-virtual-0
Adapter: Virtual device
temp1:        +41.0°C  (crit = +102.0°C)
temp2:        +44.0°C  (crit = +103.0°C)
temp3:        +29.4°C  (crit = +102.0°C)
temp4:        +20.0°C  (crit = +110.0°C)

dango

  • Гость
Кстати, да, видел у себя на нетбуке в логах ядра 3.14 строки с warning. Какие-то конфликты. Отложил разборки и забыл. Спасибо, что напомнили. А особое спасибо вам Speccyfighter за ваши усилия по добыче полезной информации. Проверю при первом удобном случае, что у меня в логах.

Оффлайн Speccyfighter

  • Мастер
  • ***
  • Сообщений: 10 259
И надо же было увидеть
Очень интересно.
А с чего был сделан вывод, что варнинги растут на пустом месте?
Цитировать
https://bugzilla.kernel.org/show_bug.cgi?id=48811#c6

This is an informative message, nothing to be fixed.
Which is why this bug is closed as invalid.

Ядерщик, не мели глупостей. Варнинги acpi могут быть предупреждением и объяснением, почему не поднялся драйвер acpitz-virtual-0, почему не работает sensors, почему не отображается температура процессора и почему отсутствует путь
/sys/class/thermal/thermal_zone*/device/path

См.
lm-sensors mailing list
https://marc.info/?l=lm-sensors&m=121938086228303

What is acpitz-virtual?
https://superuser.com/questions/343930/what-is-acpitz-virtual
lm-sensors acpitz-virtual-0 Adapter: Virtual device temp1: <- What is it?
https://www.linuxquestions.org/questions/linux-hardware-18/lm-sensors-acpitz-virtual-0-adapter-virtual-device-temp1-what-is-it-749701/

Оффлайн Speccyfighter

  • Мастер
  • ***
  • Сообщений: 10 259
Опять про температуру процессора ноутбука HP Compaq nx6110
и сломанный в ядре sensors

Для ноутбука HP Compaq nx6110, sensors в ядре конечно сломаны, о чём варнинги acpi и предупреждают.
Пытаюсь догадаться:
Откуда же тогда acpi client берёт температуру CPU, если sensors сломан на уровне ядра системы?

Смотрю исходный код и вижу это:
$ sed -n '124,151p' ./acpi-1.7/acpi.c
static struct file_list sys_list[] = {
    {"current_now", "current_now"},
    {"power_now", "power_now"},
    {"charge_now", "charge_now"},
    {"energy_now", "energy_now"},
    {"voltage_now", "voltage_now"},
    {"voltage_min_design", "voltage_min_design"},
    {"charge_full", "charge_full"},
    {"energy_full", "energy_full"},
    {"charge_full_design", "charge_full_design"},
    {"energy_full_design", "energy_full_design"},
    {"online", "online"},
    {"status", "charging state"},
    {"type", "type"},
    {"temp", "sys_temp"},
    {"trip_point_0_type", "trip_point_0_type"},
    {"trip_point_0_temp", "trip_point_0_temp"},
    {"trip_point_1_type", "trip_point_1_type"},
    {"trip_point_1_temp", "trip_point_1_temp"},
    {"trip_point_2_type", "trip_point_2_type"},
    {"trip_point_2_temp", "trip_point_2_temp"},
    {"trip_point_3_type", "trip_point_3_type"},
    {"trip_point_3_temp", "trip_point_3_temp"},
    {"trip_point_4_type", "trip_point_4_type"},
    {"trip_point_4_temp", "trip_point_4_temp"},
    {"cur_state", "cur_state"},
    {"max_state", "max_state"}
};

Пытаюсь найти путь:
# find /sys -name "*trip_point*"
/sys/devices/virtual/thermal/thermal_zone0/cdev2_trip_point
/sys/devices/virtual/thermal/thermal_zone0/cdev3_trip_point
/sys/devices/virtual/thermal/thermal_zone0/cdev4_trip_point
/sys/devices/virtual/thermal/thermal_zone0/trip_point_0_temp
/sys/devices/virtual/thermal/thermal_zone0/trip_point_0_type
...
/sys/devices/virtual/thermal/thermal_zone3/trip_point_0_temp
/sys/devices/virtual/thermal/thermal_zone3/trip_point_0_type
/sys/devices/virtual/thermal/thermal_zone3/trip_point_1_temp
/sys/devices/virtual/thermal/thermal_zone3/trip_point_1_type
/sys/devices/virtual/thermal/thermal_zone3/cdev0_trip_point

А вот теперь можно посмотреть температуру процессора и через sed, cat, grep и т.д.:
Последняя строка в каждом выводе, это температура процессора Pentium M 770, -
т.е. Thermal 3 и thermal_zone0
# acpi -t ; grep . /sys/devices/virtual/thermal/thermal_zone{3,2,1,0}/temp
Thermal 0: ok, 40.0 degrees C
Thermal 1: ok, 24.9 degrees C
Thermal 2: ok, 46.0 degrees C
Thermal 3: ok, 47.0 degrees C
/sys/devices/virtual/thermal/thermal_zone3/temp:40000
/sys/devices/virtual/thermal/thermal_zone2/temp:24900
/sys/devices/virtual/thermal/thermal_zone1/temp:46000
/sys/devices/virtual/thermal/thermal_zone0/temp:47000

Или вывести температуру CPU так:
# tcpu=`cat /sys/devices/virtual/thermal/thermal_zone0/temp`; \
> echo "$tcpu/1000"|bc -l|sed 's/^\(....\).*/\1/'
47.0


Или:
$ tcpu=`cat /sys/devices/virtual/thermal/thermal_zone0/temp`; \
> tempcpu=`echo "$tcpu/1000"|bc -l|sed 's/^\(....\).*/\1/'`; \
> echo "CPU Temperature:" $tempcpu
CPU Temperature: 50.0
« Последнее редактирование: 28.09.2017 12:53:21 от Speccyfighter »