With all due respect, IMHO I disagree with most of MJG's post. It can be easily shown that ACPI is a badly designed solution for Power Management.
Power Management for unreocgnised devices does not need a convoluted inefficient AML, and operating systems to write complex interpreters. MJG correctly states the SMM is bad; well designed hardware with OS support should not need BIOS taking over and SMM mode.
Power Management should be managed for all devices via standard hardware interfaces.
Let's imagine we're back in the 1990s when ACPI was first developed. Back then we have x86 PCs with conventional PCI.
For PCI devices, please refer to the "PCI Bus Power Management Interface Specification". I am presuming this specification provides a standard Power Management mechanism for all PCI devices, and it is possible to manage power for PCI devices that the kernel does not have drivers for.
On x86 computer, I believe PCI bus is used for most devices. I think the only devices not covered are CPU(s), north bridge and south bridge (including standard legacy ISA devices such as PS/2 ports, COM ports and floppy controller). It would not be difficult to implement a standard hardware interface for Power Management of these components. One idea could be extend the PCI Configuration Space Access Mechanism on IO Ports 0xCF8/0xCFC. Bit 31 is enable for PCI, Bit 30 could be enable for PM Config... then read / write PM Config registers as specified.
As an example, turn off PC could be as simple as 5-6 reads/writes to IO Ports 0xCF8/0xCFC if there is a standard hardware interface. Instead I think for ACPI its load multiple ACPI tables and find the correct method and enable ACPI (100s lines of code). Then run AML interpreter (1000s lines of code) to execute the "Turn Off" method.
In summary, the best way to do Power Management is via standard hardware interfaces e.g. PCI Bus Power Management Interface Specification. ACPI is a convoluted over-engineered mess. Let's not forget that MJG seems to be disagreeing with Linus Torvalds. Linus said: "ACPI is a complete design disaster in every way." [https://www.azquotes.com/quote/1218512]
no subject
It can be easily shown that ACPI is a badly designed solution for Power Management.
Power Management for unreocgnised devices does not need a convoluted inefficient AML, and operating systems to write complex interpreters. MJG correctly states the SMM is bad; well designed hardware with OS support should not need BIOS taking over and SMM mode.
Power Management should be managed for all devices via standard hardware interfaces.
Let's imagine we're back in the 1990s when ACPI was first developed. Back then we have x86 PCs with conventional PCI.
For PCI devices, please refer to the "PCI Bus Power Management Interface Specification".
I am presuming this specification provides a standard Power Management mechanism for all PCI devices, and it is possible to manage power for PCI devices that the kernel does not have drivers for.
On x86 computer, I believe PCI bus is used for most devices. I think the only devices not covered are CPU(s), north bridge and south bridge (including standard legacy ISA devices such as PS/2 ports, COM ports and floppy controller). It would not be difficult to implement a standard hardware interface for Power Management of these components. One idea could be extend the PCI Configuration Space Access Mechanism on IO Ports 0xCF8/0xCFC. Bit 31 is enable for PCI, Bit 30 could be enable for PM Config... then read / write PM Config registers as specified.
As an example, turn off PC could be as simple as 5-6 reads/writes to IO Ports 0xCF8/0xCFC if there is a standard hardware interface.
Instead I think for ACPI its load multiple ACPI tables and find the correct method and enable ACPI (100s lines of code). Then run AML interpreter (1000s lines of code) to execute the "Turn Off" method.
In summary, the best way to do Power Management is via standard hardware interfaces e.g. PCI Bus Power Management Interface Specification.
ACPI is a convoluted over-engineered mess.
Let's not forget that MJG seems to be disagreeing with Linus Torvalds. Linus said:
"ACPI is a complete design disaster in every way."
[https://www.azquotes.com/quote/1218512]