在下面的 ASL 代码中,定义了 GED 和 HED。
我对硬件错误发生时流程的理解如下:
GED1
相关,因为 GED1._CRS
。_EVT()
设备的 GED1
方法。_GED1._EVT()
会以 HED0
作为通知值来通知 0x80
。 Device (GED1) {
Name (_HID, "ACPI0013")
Name (_UID, Zero)
Method (_STA) {
Return (0xF)
}
Name (_CRS, ResourceTemplate () {
Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 51 } // Socket 0 GHESv2
Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 243 } // Socket 1 GHESv2
})
Method (_EVT, 1, Serialized) {
Switch (ToInteger (Arg0)) {
Case (51) { // Socket 0 GHESv2
Notify (HED0, 0x80)
}
Case (243) { // Socket 1 GHESv2
Notify (HED0, 0x80)
}
}
}
}
Device (HED0)
{
Name (_HID, EISAID ("PNP0C33"))
Name (_UID, Zero)
}
HED0
值而将 PNP0C33
识别为硬件错误设备。HED0
。Notify (HED0, 0x80)
最终会命中来自drivers/acpi/hed.c的以下代码。static void acpi_hed_notify(struct acpi_device *device, u32 event)
{
blocking_notifier_call_chain(&acpi_hed_notify_list, 0, NULL);
}
HED0
值,Linux 将 drivers/acpi/hed.c 与
PNP0C33
设备相匹配。这是正确的吗?
0x80
中的
Notify (HED0, 0x80)
对应于u32 event
的acpi_hed_notify()
参数。但这个说法根本没有被使用。那么为什么我们需要特定值0x80
呢?
Notify(HED0, 0x80)
如何将信息传递到
drivers/acpi/hed.c中的
acpi_hed_notify()
?
我认为假设
PNP0C33
的
_HID
值用于匹配 hed.c
Linux 驱动程序是正确的。看黄英对PNP0C33支持的评论收到ACPI核心的通知后,转发给所有
通过通知链的监听器。诸如APEI GHES
之类的听众应该 收到通知后检查相应的错误源是否有新事件。
查看
linux/drivers/acpi/apei/ghes.c
,我们看到位于
hed.c
中的队列的侦听器已为 SCI
事件设置:case ACPI_HEST_NOTIFY_SCI:
case ACPI_HEST_NOTIFY_GSIV:
case ACPI_HEST_NOTIFY_GPIO:
mutex_lock(&ghes_list_mutex);
if (list_empty(&ghes_hed))
register_acpi_hed_notifier(&ghes_notifier_hed);
函数
int register_acpi_hed_notifier(struct notifier_block *nb)
确实位于
hed.c
源文件中。因此,当事件到达 hed.c
时,通过调用
blocking_notifier_call_chain
会调用 static int ghes_proc(struct ghes *ghes)
,它会处理所有的 shebang。所以看来event
参数没有被使用,因为所有的处理都是在
ghes
模块中完成的。