ACPI subsytem initialization

Many other modules might trigger ACPI device registration. This means the the basic ACPI subsystem has to be up and available before much of the Hardware is usable. Hence, we can see that the ACPI subsystem gets registered here. What I am not certain of is when does this code get called?

To back up a bit, I was reading the ACPI Kernel documentation and saw that something needs to scan the ACPI namespace for devices. Yes, I was starting in the middle.

I’m going to go with the working assumption that the table is like the “Classes” or “Powertypes” and indicate the kinds of devices we might have, and that is used to trigger the scan to match what we actually see. This understanding might be wrong. Just making my current assumptions explicit.

So, I figured I would look for the code that does the scanning, and try to figure out where in the kernel initialization this code gets called. The scanning code seems to be here. Or at least the Linux specific bindings to the ACPICA scanning code. We can see that there are scan handlers added to a list. I figure registering the scan handlers has to happen fairly early on in the initialization process. So, I follow that to the subsystem initialization call at the top and end up at acpi_init, which is registered as the subsys_initcall.

What is an init_call? So we can see that the ACPI init will be called during the subsys stage: just after arch and just before fs…followed by device.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.