sysfs-firmware-acpi 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. What: /sys/firmware/acpi/interrupts/
  2. Date: February 2008
  3. Contact: Len Brown <lenb@kernel.org>
  4. Description:
  5. All ACPI interrupts are handled via a single IRQ,
  6. the System Control Interrupt (SCI), which appears
  7. as "acpi" in /proc/interrupts.
  8. However, one of the main functions of ACPI is to make
  9. the platform understand random hardware without
  10. special driver support. So while the SCI handles a few
  11. well known (fixed feature) interrupts sources, such
  12. as the power button, it can also handle a variable
  13. number of a "General Purpose Events" (GPE).
  14. A GPE vectors to a specified handler in AML, which
  15. can do a anything the BIOS writer wants from
  16. OS context. GPE 0x12, for example, would vector
  17. to a level or edge handler called _L12 or _E12.
  18. The handler may do its business and return.
  19. Or the handler may send send a Notify event
  20. to a Linux device driver registered on an ACPI device,
  21. such as a battery, or a processor.
  22. To figure out where all the SCI's are coming from,
  23. /sys/firmware/acpi/interrupts contains a file listing
  24. every possible source, and the count of how many
  25. times it has triggered.
  26. $ cd /sys/firmware/acpi/interrupts
  27. $ grep . *
  28. error: 0
  29. ff_gbl_lock: 0 enable
  30. ff_pmtimer: 0 invalid
  31. ff_pwr_btn: 0 enable
  32. ff_rt_clk: 2 disable
  33. ff_slp_btn: 0 invalid
  34. gpe00: 0 invalid
  35. gpe01: 0 enable
  36. gpe02: 108 enable
  37. gpe03: 0 invalid
  38. gpe04: 0 invalid
  39. gpe05: 0 invalid
  40. gpe06: 0 enable
  41. gpe07: 0 enable
  42. gpe08: 0 invalid
  43. gpe09: 0 invalid
  44. gpe0A: 0 invalid
  45. gpe0B: 0 invalid
  46. gpe0C: 0 invalid
  47. gpe0D: 0 invalid
  48. gpe0E: 0 invalid
  49. gpe0F: 0 invalid
  50. gpe10: 0 invalid
  51. gpe11: 0 invalid
  52. gpe12: 0 invalid
  53. gpe13: 0 invalid
  54. gpe14: 0 invalid
  55. gpe15: 0 invalid
  56. gpe16: 0 invalid
  57. gpe17: 1084 enable
  58. gpe18: 0 enable
  59. gpe19: 0 invalid
  60. gpe1A: 0 invalid
  61. gpe1B: 0 invalid
  62. gpe1C: 0 invalid
  63. gpe1D: 0 invalid
  64. gpe1E: 0 invalid
  65. gpe1F: 0 invalid
  66. gpe_all: 1192
  67. sci: 1194
  68. sci_not: 0
  69. sci - The number of times the ACPI SCI
  70. has been called and claimed an interrupt.
  71. sci_not - The number of times the ACPI SCI
  72. has been called and NOT claimed an interrupt.
  73. gpe_all - count of SCI caused by GPEs.
  74. gpeXX - count for individual GPE source
  75. ff_gbl_lock - Global Lock
  76. ff_pmtimer - PM Timer
  77. ff_pwr_btn - Power Button
  78. ff_rt_clk - Real Time Clock
  79. ff_slp_btn - Sleep Button
  80. error - an interrupt that can't be accounted for above.
  81. invalid: it's either a GPE or a Fixed Event that
  82. doesn't have an event handler.
  83. disable: the GPE/Fixed Event is valid but disabled.
  84. enable: the GPE/Fixed Event is valid and enabled.
  85. Root has permission to clear any of these counters. Eg.
  86. # echo 0 > gpe11
  87. All counters can be cleared by clearing the total "sci":
  88. # echo 0 > sci
  89. None of these counters has an effect on the function
  90. of the system, they are simply statistics.
  91. Besides this, user can also write specific strings to these files
  92. to enable/disable/clear ACPI interrupts in user space, which can be
  93. used to debug some ACPI interrupt storm issues.
  94. Note that only writting to VALID GPE/Fixed Event is allowed,
  95. i.e. user can only change the status of runtime GPE and
  96. Fixed Event with event handler installed.
  97. Let's take power button fixed event for example, please kill acpid
  98. and other user space applications so that the machine won't shutdown
  99. when pressing the power button.
  100. # cat ff_pwr_btn
  101. 0 enabled
  102. # press the power button for 3 times;
  103. # cat ff_pwr_btn
  104. 3 enabled
  105. # echo disable > ff_pwr_btn
  106. # cat ff_pwr_btn
  107. 3 disabled
  108. # press the power button for 3 times;
  109. # cat ff_pwr_btn
  110. 3 disabled
  111. # echo enable > ff_pwr_btn
  112. # cat ff_pwr_btn
  113. 4 enabled
  114. /*
  115. * this is because the status bit is set even if the enable bit is cleared,
  116. * and it triggers an ACPI fixed event when the enable bit is set again
  117. */
  118. # press the power button for 3 times;
  119. # cat ff_pwr_btn
  120. 7 enabled
  121. # echo disable > ff_pwr_btn
  122. # press the power button for 3 times;
  123. # echo clear > ff_pwr_btn /* clear the status bit */
  124. # echo disable > ff_pwr_btn
  125. # cat ff_pwr_btn
  126. 7 enabled