sysfs-firmware-acpi 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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 - The total number of times the ACPI SCI
  69. has claimed an interrupt.
  70. gpe_all - count of SCI caused by GPEs.
  71. gpeXX - count for individual GPE source
  72. ff_gbl_lock - Global Lock
  73. ff_pmtimer - PM Timer
  74. ff_pwr_btn - Power Button
  75. ff_rt_clk - Real Time Clock
  76. ff_slp_btn - Sleep Button
  77. error - an interrupt that can't be accounted for above.
  78. invalid: it's either a GPE or a Fixed Event that
  79. doesn't have an event handler.
  80. disable: the GPE/Fixed Event is valid but disabled.
  81. enable: the GPE/Fixed Event is valid and enabled.
  82. Root has permission to clear any of these counters. Eg.
  83. # echo 0 > gpe11
  84. All counters can be cleared by clearing the total "sci":
  85. # echo 0 > sci
  86. None of these counters has an effect on the function
  87. of the system, they are simply statistics.
  88. Besides this, user can also write specific strings to these files
  89. to enable/disable/clear ACPI interrupts in user space, which can be
  90. used to debug some ACPI interrupt storm issues.
  91. Note that only writting to VALID GPE/Fixed Event is allowed,
  92. i.e. user can only change the status of runtime GPE and
  93. Fixed Event with event handler installed.
  94. Let's take power button fixed event for example, please kill acpid
  95. and other user space applications so that the machine won't shutdown
  96. when pressing the power button.
  97. # cat ff_pwr_btn
  98. 0 enabled
  99. # press the power button for 3 times;
  100. # cat ff_pwr_btn
  101. 3 enabled
  102. # echo disable > ff_pwr_btn
  103. # cat ff_pwr_btn
  104. 3 disabled
  105. # press the power button for 3 times;
  106. # cat ff_pwr_btn
  107. 3 disabled
  108. # echo enable > ff_pwr_btn
  109. # cat ff_pwr_btn
  110. 4 enabled
  111. /*
  112. * this is because the status bit is set even if the enable bit is cleared,
  113. * and it triggers an ACPI fixed event when the enable bit is set again
  114. */
  115. # press the power button for 3 times;
  116. # cat ff_pwr_btn
  117. 7 enabled
  118. # echo disable > ff_pwr_btn
  119. # press the power button for 3 times;
  120. # echo clear > ff_pwr_btn /* clear the status bit */
  121. # echo disable > ff_pwr_btn
  122. # cat ff_pwr_btn
  123. 7 enabled