ACPI: make ACPI use driver model
cover ACPI: make ACPI use driver model
The main purpose of this patch series is to make ACPI use driver model And these are updated patches against 2.6.19.
Patrick has posted patches on rewriting ACPI driver model in November 2005. And recently Shaohua send me a prototype on making ACPI use driver model. This patch series bases on both Patrick and Shaohua's previous work.
Two features are gonna be changed by applying this series of patches.
1. ACPI driver model.
ACPI driver are made to follow Linux driver model.
The main work is to convert the registration interfaces,so that ACPI devices are registered with the global device tree.
Note the new .uevent method mark ACPI drivers by PNPID
instead of by name. Udev script needs to look for "HWID = " or "COMPTID = " to load the right ACPI driver.
2. ACPI sysfs interface.
As a result of using driver model, ACPI devices is added in the /sys/device tree. So _EJ0 is added as a property of ACPI device in device tree. ACPI namespace nodes that used to be shown under /sys/firm/acpi is deleted.
The corresponding userspace script needs to be changed for hot removal.
Note that this is only the first step of ACPI sysfs conversion work The next step is to duplicate ACPI procfs functions in sysfs.
Quoted 7 lines · Zhang Rui
1. ACPI driver model.
ACPI driver are made to follow Linux driver model. The main work is to convert the registration interfaces,so that ACPI devices are registered with the global device tree.
Note the new .uevent method mark ACPI drivers by PNPID
instead of by name. Udev script needs to look for "HWID = " or "COMPTID = " to load the right ACPI driver.
I generally like the direction this is headed.
But I wonder whether it's right to expose the distinction between PNP devices and ACPI devices to userspace.
Assume you had a box where you can run either PNPBIOS firmware or ACPI firmware. Since the box has exactly the same hardware in either case, it would be nice if everything in /sys and udev stayed the same.
Is it possible to extend the PNP model to include ACPI, rather than introducing a new ACPI model alongside the PNP model?
Bjorn
Quoted 14 lines · Bjorn Helgaas
Quoted 7 lines · Zhang Rui
1. ACPI driver model.
ACPI driver are made to follow Linux driver model. The main work is to convert the registration interfaces,so that ACPI devices are registered with the global device tree.
Note the new .uevent method mark ACPI drivers by PNPID
instead of by name. Udev script needs to look for "HWID = " or "COMPTID = " to load the right ACPI driver.I generally like the direction this is headed.
But I wonder whether it's right to expose the distinction between PNP devices and ACPI devices to userspace.
Quoted 7 lines
Assume you had a box where you can run either PNPBIOS firmware or ACPI firmware. Since the box has exactly the same hardware in either case, it would be nice if everything in /sys and udev stayed the same.
Is it possible to extend the PNP model to include ACPI, rather than introducing a new ACPI model alongside the PNP model?
Don't think it's easy. ACPI driver uses some acpi helpers and handle some ACPI specific event like notification/gpe ...
Thanks,
Shaohua
Quoted 14 lines · Bjorn Helgaas
Quoted 7 lines · Zhang Rui
1. ACPI driver model.
ACPI driver are made to follow Linux driver model. The main work is to convert the registration interfaces,so that ACPI devices are registered with the global device tree.
Note the new .uevent method mark ACPI drivers by PNPID
instead of by name. Udev script needs to look for "HWID = " or "COMPTID = " to load the right ACPI driver.I generally like the direction this is headed.
But I wonder whether it's right to expose the distinction between PNP devices and ACPI devices to userspace.
Quoted 7 lines
Assume you had a box where you can run either PNPBIOS firmware or ACPI firmware. Since the box has exactly the same hardware in either case, it would be nice if everything in /sys and udev stayed the same.
Is it possible to extend the PNP model to include ACPI, rather than introducing a new ACPI model alongside the PNP model?
Hmmm, well, I thought we were doing well to get ride of ACPI specific devices names...
The PNPBIOS + ACPI box will never run both PNPBIOS and ACPI at the same time.
The academic answer to your question is no -- sysfs can't be identical whether PNPBIOS or ACPI mode was taken -- because ACPI enumerates devices that PNPBIOS doesn't know about. But your question is valid.
My question is where the "cut point is". At what point do we start pushing this work upstream, and what parts of it?
-Len
[Sorry for the duplicate; I fat-fingered my reply and inadvertently introduced an HTML sub-part, causing linux-acpi to reject it as spam.]
Quoted 9 lines · Len Brown
Quoted 2 lines · Bjorn Helgaas
Is it possible to extend the PNP model to include ACPI, rather than introducing a new ACPI model alongside the PNP model?
Hmmm, well, I thought we were doing well to get ride of ACPI specific devices names...
The PNPBIOS + ACPI box will never run both PNPBIOS and ACPI at the same time.
Right. But should the fact that we use ACPI instead of PNPBIOS make a difference to userland? My intuition says "no." Obviously there might be new devices and new functionality with ACPI, so there might be new files and knobs in sysfs, but if you don't care about those, it'd be nice if all the old PNP stuff just worked.
Quoted 2 lines
My question is where the "cut point is". At what point do we start pushing this work upstream, and what parts of it?
I don't want to delay pushing Zhang's patches upstream. I think they are definitely a step in the right direction.
Bjorn
Quoted 2 lines · Zhang Rui
The main purpose of this patch series is to make ACPI use driver model And these are updated patches against 2.6.19.
Thanks Rui, I've pushed this updated series into the acpi-test branch -- replacing the previous version.
(except patch 14, which was already there via the ibm-acpi update)
-Len