Gentoo itself is power

16.12.2009

ACPI, DSDT…

Filed under: gentoo, linux — Метки: , — init_6 @ 10:37

Если у вас нет проблем с ACPI т.е. все кнопочки работают и никаких ошибок связанных с ACPI в логах не появляется. Что ж во первых я вас поздравляю закрывайте эту страницу и идите пить к примеру кофе/чай. Во вторых даже отсутствие ошибок в логах и абсолютно полностью работающая система не признак отсутствия ошибок в DSDT так что дальше смотрите сами. В любом случае проверка займет всего пару минут. И как поступить решать не мне.

Собственно у меня с моим ноутбуком AS5730ZG-323G25Mi изначально никаких проблем не было. Но дальше, как это часто бывает, расследую причины одной ошибки решил проверить DSDT.

Для тех кто захочет подковаться в теории: HOWTO: Fix Common ACPI Problems (DSDT, ECDT, etc.) и ACPI/Fix common problems

Далее переходим к практике… Для начала нужен главный инструмент


emerge sys-power/iasl 

Далее нужна сама таблица DSDT. Для новых ядер


cat /sys/firmware/acpi/tables/DSDT > dsdt.dat

Для тех кто в криокамере


cat /proc/acpi/dsdt > dsdt.dat

Ну а теперь все просто как пять копеек


iasl -d dsdt.dat # Дизассемблируем DSDT
iasl -tc dsdt.dsl # Перекомпилируем DSDT

Если после последней операции вы увидили


iasl -tc dsdt.dsl
(cut)
Compilation complete. 0 Errors, 0 Warnings, 0 Remarks, {ЧИСЛО} Optimizations

Я вас поздравляю закрывайте эту страницу и идите пить чай/кофе.

Вот например что увидел я


> iasl -tc acer-aspire-5730zg-bios.v-1.23-orig.dsl

Intel ACPI Component Architecture
ASL Optimizing Compiler version 20091013 [Dec 10 2009]
Copyright (C) 2000 - 2009 Intel Corporation
Supports ACPI Specification Revision 4.0

acer-aspire-5730zg-bios.v-1.23-orig.dsl  4922:                     Method (HKDS, 1, NotSerialized)
Warning  1087 -                          Not all control paths return a value ^  (HKDS)

acer-aspire-5730zg-bios.v-1.23-orig.dsl  5742:                         Name (_HID, "*pnp0c14")
Error    4001 -                                        String must be entirely alphanumeric ^  (*pnp0c14)

acer-aspire-5730zg-bios.v-1.23-orig.dsl  5801:                         Method (_WED, 1, NotSerialized)
Warning  1087 -                              Not all control paths return a value ^  (_WED)

acer-aspire-5730zg-bios.v-1.23-orig.dsl  5801:                         Method (_WED, 1, NotSerialized)
Warning  1080 -                               Reserved method must return a value ^  (_WED)

acer-aspire-5730zg-bios.v-1.23-orig.dsl  6182:                         Method (WMC9, 3, NotSerialized)
Warning  1087 -                              Not all control paths return a value ^  (WMC9)

acer-aspire-5730zg-bios.v-1.23-orig.dsl  6445:                         Method (WRCB, 2, NotSerialized)
Warning  1087 -                              Not all control paths return a value ^  (WRCB)

acer-aspire-5730zg-bios.v-1.23-orig.dsl  6633:                         Method (WMCD, 3, NotSerialized)
Warning  1087 -                              Not all control paths return a value ^  (WMCD)

acer-aspire-5730zg-bios.v-1.23-orig.dsl  7277:                         Method (WMCF, 3, NotSerialized)
Warning  1087 -                              Not all control paths return a value ^  (WMCF)

acer-aspire-5730zg-bios.v-1.23-orig.dsl  7407:                                     Name (_T_0, 0x00)
Remark   5110 -                                               Use of compiler reserved name ^  (_T_0)

acer-aspire-5730zg-bios.v-1.23-orig.dsl  7444:                                         Name (_T_1, 0x00)
Remark   5110 -                                                   Use of compiler reserved name ^  (_T_1)

acer-aspire-5730zg-bios.v-1.23-orig.dsl  7460:                                             Name (_T_2, 0x00)
Remark   5110 -                                                       Use of compiler reserved name ^  (_T_2)

acer-aspire-5730zg-bios.v-1.23-orig.dsl  7518:                                                 Name (_T_3, 0x00)
Remark   5110 -                                                           Use of compiler reserved name ^  (_T_3)

acer-aspire-5730zg-bios.v-1.23-orig.dsl  7562:                                                     Name (_T_4, 0x00)
Remark   5110 -                                                               Use of compiler reserved name ^  (_T_4)

acer-aspire-5730zg-bios.v-1.23-orig.dsl  7604:                                                     Name (_T_5, 0x00)
Remark   5110 -                                                               Use of compiler reserved name ^  (_T_5)

acer-aspire-5730zg-bios.v-1.23-orig.dsl  7684:                         Method (WB15, 6, NotSerialized)
Warning  1087 -                              Not all control paths return a value ^  (WB15)

acer-aspire-5730zg-bios.v-1.23-orig.dsl  7740:                         Name (_HID, "*pnp0c14")
Error    4001 -                                        String must be entirely alphanumeric ^  (*pnp0c14)

ASL Input:  acer-aspire-5730zg-bios.v-1.23-orig.dsl - 10390 lines, 400823 bytes, 4157 keywords
Compilation complete. 2 Errors, 8 Warnings, 6 Remarks, 1110 Optimizations

Не радостно… Сразу следует сказать вот какой момент пишут, что DSDT зависит еще и от версии биоса. Т.е. при обновлении биоса все якобы нужно начинать с начала. Поэтому я сохранял DSDT в acer-aspire-5730zg-bios.v-1.21-orig.dsl, acer-aspire-5730zg-bios.v-1.23-custom.dsl соответственно. Однако в моем случае производитель не внес никаких изменений. Далее я сохранял acer-aspire-5730zg-bios.v-1.23-custom.dsl уже как acer-aspire-5730zg-bios.v-1.23-custom.dsl и все изменения производил уже над ним.

Дальше я пойду по порядку возникновения ошибок.

4922: Method (HKDS, 1, NotSerialized)
Warning 1087 – Not all control paths return a value ^ (HKDS)

На строчке 4922 видим


                    Method (HKDS, 1, NotSerialized) # строка 4922
                    {
(cut)
                        If (LEqual (0x01, DSEN)) {}
                    } # строка 5067

                    Method (_Q19, 0, NotSerialized) # строка 5069 начало нового метода

Так вот собственно решение первой проблемы


                    Method (HKDS, 1, NotSerialized) # строка 4922
                    {
(cut)
                        If (LEqual (0x01, DSEN)) {}
                        Return (0x00) # вставили
                    } # строка 5068

                    Method (_Q19, 0, NotSerialized) # строка 5070 начало нового метода

Далее

5743: Name (_HID, “*pnp0c14″)
Error 4001 – String must be entirely alphanumeric ^ (*pnp0c14)


Name (_HID, "*pnp0c14") # строка 5743

Собственно решение


Name (_HID, "pnp0c14") # строка 5743

Для всех вот этих ошибок

5802: Method (_WED, 1, NotSerialized)
Warning 1087 – Not all control paths return a value ^ (_WED)

5802: Method (_WED, 1, NotSerialized)
Warning 1080 – Reserved method must return a value ^ (_WED)

6183: Method (WMC9, 3, NotSerialized)
Warning 1087 – Not all control paths return a value ^ (WMC9)

6446: Method (WRCB, 2, NotSerialized)
Warning 1087 – Not all control paths return a value ^ (WRCB)

6634: Method (WMCD, 3, NotSerialized)
Warning 1087 – Not all control paths return a value ^ (WMCD)

7278: Method (WMCF, 3, NotSerialized)
Warning 1087 – Not all control paths return a value ^ (WMCF)

Решение будет аналогично первому т.е. до скобки закрытия каждого из описанных методов надо поставить Return (0×00)

Вот эта вереница загадок

7408: Name (_T_0, 0×00)
Remark 5110 – Use of compiler reserved name ^ (_T_0)

7445: Name (_T_1, 0×00)
Remark 5110 – Use of compiler reserved name ^ (_T_1)

7461: Name (_T_2, 0×00)
Remark 5110 – Use of compiler reserved name ^ (_T_2)

7519: Name (_T_3, 0×00)
Remark 5110 – Use of compiler reserved name ^ (_T_3)

7563: Name (_T_4, 0×00)
Remark 5110 – Use of compiler reserved name ^ (_T_4)

7605: Name (_T_5, 0×00)
Remark 5110 – Use of compiler reserved name ^ (_T_5)

распутывается вообще банально. Компилятор пытается нам сказать, что вместо _T_0, _T_1, _T_2, _T_3, _T_4, _T_5 использовать T_0, T_1, T_2, T_3, T_4, T_5.

Далее

7685: Method (WB15, 6, NotSerialized)
Warning 1087 – Not all control paths return a value ^ (WB15)

Это мы уже проходили… Опять же вставить Return (0×00)

И наконец то

7741: Name (_HID, “*pnp0c14″)
Error 4001 – String must be entirely alphanumeric ^ (*pnp0c14)

И это уже было… убираем звёздочку.

И вот он финальный аккорд


> iasl -tc acer-aspire-5730zg-bios.v-1.23-custom.dsl

Intel ACPI Component Architecture
ASL Optimizing Compiler version 20091013 [Dec 10 2009]
Copyright (C) 2000 - 2009 Intel Corporation
Supports ACPI Specification Revision 4.0

ASL Input:  acer-aspire-5730zg-bios.v-1.23-custom.dsl - 10397 lines, 398866 bytes, 4164 keywords
AML Output: dsdt.aml - 41022 bytes, 897 named objects, 3267 executable opcodes

Compilation complete. 0 Errors, 0 Warnings, 0 Remarks, 1117 Optimizations

Ну вот собственно и что из этого? Это не конец… это только начало.


cp /path/to/acer-aspire-5730zg-bios.v-1.23-custom.hex /usr/src/dsdt_table.h

Как советует руководство

First in kernel config, disable “Select only drivers that don’t need compile-time external firmware”

Т.е. Выключаем “Select only drivers that don’t need compile-time external firmware”

Device Drivers —>
Generic Driver Options —>
[ ] Select only drivers that don’t need compile-time external firmware
[ ] Prevent firmware from being built

Then enable the custom DSDT options in the kernel, and provide a path to the hex dsdt table that you compiled.

Включаем измененную DSDT

Power management options (ACPI, APM) —>
ACPI (Advanced Configuration and Power Interface) Support —>
[*] Include Custom DSDT
(/usr/src/dsdt_table.h) Custom DSDT Table file to include

Ну и дальше

Recompile your kernel, copy the bzImage, and modify your grub.conf to point to the new kernel.

В руководствах, кроме компилирования ядра с DSDT, рассмотрены несколько путей решения и как поступать определять вам.

Если что:

acer-aspire-5730zg-bios.v-1.21-orig.dsl.gz
acer-aspire-5730zg-bios.v-1.23-orig.dsl.gz
acer-aspire-5730zg-bios.v-1.23-custom.dsl.gz

Только поменяйте gz1.odt на gz

Комментарии (6) »

  1. Здоровски, отче! :) Для меня несколько не актуально, но на всякий пожарный, возьму-ка я это дело на заметку… ;)

    комментарий от the_Shadow — 16.12.2009 @ 11:41

  2. [...] об acpi. На сей раз разговор пойдет об оптимизации dsdt. Начало было там и касалось собственно исправления ошибок. Теперь же [...]

    Уведомление от Оптимизация dsdt « Gentoo itself is power — 17.06.2011 @ 20:34

  3. Мир вашему дому))

    У меня такой вопрос:
    Ноутбук Samsung R460, на котором стояла виста 32х битная при покупке. Всё прекрасно работало (учитывая что это винда…). Процессор T5800 (Instruction Set – 64-bit). При загрузке с любого лайфсиди 64 бит (генту, дебиан, федора, и др.. ) комп уходит в ребут. Ставили вин 7 64 бит. Работает, но до установки видеодрайвера (nvidia 9200M). После установки винда хочет перегрузиться и не поднимается. уходит в ребут как и линукс.. Может ли быть это связано с ацпи??

    комментарий от Neznaechko Irkutsk — 22.10.2011 @ 13:49

    • Это не просто может быть связано с acpi… вполне вероятно что это непосредственно иллюстрирует возможные последствия от кривого acpi/dsdt ;)

      В частности чтобы подтвердить/опровергнуть свое предположение насчет acpi/dsdt в случае с minimall install cd gentoo достаточно внимательно прочитать README.txt обращая особое внимание на опции отключающие acpi:

      cat README.txt

      This lists the possible command line options that can be used to tweak the boot
      process of this CD. This lists the Gentoo-specific options, along with a few
      options that are built-in to the kernel, but that have been proven very useful
      to our users. Also, all options that start with “do” have a “no” inverse, that
      does the opposite. For example, “doscsi” enables SCSI support in the initial
      ramdisk boot, while “noscsi” disables it.

      Hardware options:
      acpi=on This loads support for ACPI and also causes the acpid daemon to
      be started by the CD on boot. This is only needed if your
      system requires ACPI to function properly. This is not
      required for Hyperthreading support.
      acpi=off Completely disables ACPI. This is useful on some older systems
      and is also a requirement for using APM. This will disable any
      Hyperthreading support of your processor.
      console=X This sets up serial console access for the CD. The first
      option is the device, usually ttyS0 on x86, followed by any
      connection options, which are comma separated. The default
      options are 9600,8,n,1.
      dmraid=X This allows for passing options to the device-mapper RAID
      subsystem. Options should be encapsulated in quotes.
      doapm This loads APM driver support. This requires you to also use
      acpi=off.
      dopcmcia This loads support for PCMCIA and Cardbus hardware and also
      causes the pcmcia cardmgr to be started by the CD on boot.
      This is only required when booting from PCMCIA/Cardbus devices.
      doscsi This loads support for most SCSI controllers. This is also a
      requirement for booting most USB devices, as they use the SCSI
      subsystem of the kernel.
      hda=stroke This allows you to partition the whole hard disk even when your
      BIOS is unable to handle large disks. This option is only used
      on machines with an older BIOS. Replace hda with the device
      that is requiring this option.
      ide=nodma This forces the disabling of DMA in the kernel and is required
      by some IDE chipsets and also by some CDROM drives. If your
      system is having trouble reading from your IDE CDROM, try this
      option. This also disables the default hdparm settings from
      being executed.
      noapic This disables the Advanced Programmable Interrupt Controller
      that is present on newer motherboards. It has been known to
      cause some problems on older hardware.
      nodetect This disables all of the autodetection done by the CD,
      including device autodetection and DHCP probing. This is
      useful for doing debugging of a failing CD or driver.
      nodhcp This disables DHCP probing on detected network cards. This is
      useful on networks with only static addresses.
      nodmraid Disables support for device-mapper RAID, such as that used for
      on-board IDE/SATA RAID controllers.
      nofirewire This disables the loading of Firewire modules. This should
      only be necessary if your Firewire hardware is causing
      a problem with booting the CD.
      nogpm This diables gpm console mouse support.
      nohotplug This disables the loading of the hotplug and coldplug init
      scripts at boot. This is useful for doing debugging of a
      failing CD or driver.
      nokeymap This disables the keymap selection used to select non-US
      keyboard layouts.
      nolapic This disables the local APIC on Uniprocessor kernels.
      nosata This disables the loading of Serial ATA modules. This is used
      if your system is having problems with the SATA subsystem.
      nosmp This disables SMP, or Symmetric Multiprocessing, on SMP-enabled
      kernels. This is useful for debugging SMP-related issues with
      certain drivers and motherboards.
      nosound This disables sound support and volume setting. This is useful
      for systems where sound support causes problems.
      nousb This disables the autoloading of USB modules. This is useful
      for debugging USB issues.
      slowusb This adds some extra pauses into the boot process for slow
      USB CDROMs, like in the IBM BladeCenter.
      Volume/Device Management:
      doevms This enables support for IBM’s pluggable EVMS, or Enterprise
      Volume Management System. This is not safe to use with lvm2.
      dolvm This enables support for Linux’s Logical Volume Management.
      This is not safe to use with evms2.
      Other options:
      debug Enables debugging code. This might get messy, as it displays
      a lot of data to the screen.
      docache This caches the entire runtime portion of the CD into RAM,
      which allows you to umount /mnt/cdrom and mount another CDROM.
      This option requires that you have at least twice as much
      available RAM as the size of the CD.
      doload=X This causes the initial ramdisk to load any module listed, as
      well as dependencies. Replace X with the module name.
      Multiple modules can be specified by a comma-separated list.
      dosshd Starts sshd on boot, which is useful for unattended installs.
      passwd=foo Sets whatever follows the equals as the root password, which
      is required for dosshd since we scramble the root password.
      noload=X This causes the initial ramdisk to skip the loading of a
      specific module that may be causing a problem. Syntax matches
      that of doload.
      nonfs Disables the starting of portmap/nfsmount on boot.
      nox This causes an X-enabled LiveCD to not automatically start X,
      but rather, to drop to the command line instead.
      scandelay This causes the CD to pause for 10 seconds during certain
      portions the boot process to allow for devices that are slow to
      initialize to be ready for use.
      scandelay=X This allows you to specify a given delay, in seconds, to be
      added to certain portions of the boot process to allow for
      devices that are slow to initialize to be ready for use.
      Replace X with the number of seconds to pause.

      Этот файл кстати есть и на самом live cd.

      А затем нужно просто загрузится к примеру с параметром acpi=off

      комментарий от init_6 — 22.10.2011 @ 14:14

      • Когда пытался понять,в чем же дело (а было это позопрошлем летом) понятия не имел о дсдт и о том что производители могут делать ошибки в нем. А теперь пытаюсь заставить коррктно работать свою настольную систему под маком (тоесть она работает, но не совсем корректно). Как я понял – железо в дсдт не совсем правильно описано. Исправляю и становится легче жить )) Вот,сейчас, например, искал информацию на тему и вспомнил о ноуте.
        вот что думает компилятор о нативном дсдт:

        Intel ACPI Component Architecture
        ASL Optimizing Compiler version 20100528 [Oct 15 2010]
        Copyright (c) 2000 – 2010 Intel Corporation
        Supports ACPI Specification Revision 4.0a

        /media/Win7/r460_dsdt/d2 1124: 0×00000000, // Length
        Error 4122 – Invalid combination of Length and Min/Max fixed flags ^

        /media/Win7/r460_dsdt/d2 1131: 0×00000000, // Length
        Error 4122 – Invalid combination of Length and Min/Max fixed flags ^

        /media/Win7/r460_dsdt/d2 2950: Or (TMOR, TMPV)
        Warning 1106 – Result is not used, operator has no effect ^

        ASL Input: /media/Win7/r460_dsdt/d2 – 6946 lines, 241144 bytes, 3226 keywords
        Compilation complete. 2 Errors, 1 Warnings, 0 Remarks, 8 Optimizations

        После такой наглости как то начинаешь думать о самсунге не очень. На асусовской плате была тоько одна ошибка. ))

        комментарий от Neznaechko Irkutsk — 23.10.2011 @ 00:08

      • На самом деле все гораздо проще. Производители зачастую пользуются продуктами одной известной компании из города Редмонда. Но прикол заключается в том, что ПО той компании создает (если касаться именно нашего разговора) прошивки биоса которые собственно не вполне соответствуют официальным спецификациям. Т.е. оно вреде бы как и похоже на правду но при детальном рассмотрении это вовсе не так.

        Ошибку специально нагенерированную производителем железа как то и ошибкой называть неохота. К тому же по понятиям той самой фирмы из Редмонда и не ошибка это вовсе. Производители железа идут на это из-за желания получить красивую наклейку “совместимо с ну ты понял” ;)

        Вообще идеальным решением была бы поддержка coreboot со стороны производителей железа. Но они на это не пойдут по понятным причинам… Поэтому все в наших руках. И да кстати именно поэтому я иногда завидую владельцам к примеру OLPC у них подобные проблемы просто не могут появится.

        комментарий от init_6 — 23.10.2011 @ 07:41


RSS-лента комментариев к этой записи. URI для обратной ссылки

Добавить комментарий

Fill in your details below or click an icon to log in:

Логотип WordPress.com

You are commenting using your WordPress.com account. Log Out / Изменить )

Фотография Twitter

You are commenting using your Twitter account. Log Out / Изменить )

Фотография Facebook

You are commenting using your Facebook account. Log Out / Изменить )

Connecting to %s

Theme: Silver is the New Black. Блог на WordPress.com.

Follow

Get every new post delivered to your Inbox.