RFC Rework ATA ACPI binding code
Status from this message: Applied to libata/for-3.12.
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest2 patches 12 repliesApplied
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | ata: acpi: remove dead code for ata_acpi_(un)binddrivers/ | +0 | 1 reply | |
| 2/2 | ata: acpi: rework the ata acpi bind supportdrivers/ drivers/ drivers/ +6 more | +106 | 10 replies | |
| 2/2 | ata: acpi: rework the ata acpi bind supportdrivers/ drivers/ drivers/ +6 more | +106 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC PATCH 0/2] Rework ATA ACPI binding code
Binding ACPI handle to SCSI device has several drawbacks, namely:
1 During ATA device initialization time, ACPI handle will be needed
while SCSI devices are not created yet. So each time ACPI handle is needed, instead of retrieving the handle by ACPI_HANDLE macro, a namespace scan is performed to find the handle for the corresponding ATA device. This is inefficient, and also expose a restriction on calling path not holding any lock.
2 The binding to SCSI device tree makes code complex, while in the
meantime doesn't buy us anything. All ACPI handlings are still done in ATA module, not in SCSI.
This patchset does ACPI binding to ATA transport port/devices when the devices are created, so that all later operations that require ACPI handle will simply be a pointer access by the ACPI_HANDLE macro. This simplies code a lot and also removes the restriction of calling thread has to be sleep-able.
With the new binding, when ACPI handle will be needed in a function, ATA transport device should be used like in acpi_pm_device_run_wake etc. When runtime PM API is used, the SCSI device object should be used. In a word, runtime PM is still triggered from SCSI device tree, but all ACPI handling are done in ATA with ATA transport devices.
Tested on an Intel platform, ZPODD and runtime power off of a SATA disk works OK. More testing by other people is needed/appreciated.
Aaron Lu (2):
ata: acpi: remove dead code for ata_acpi_(un)bind
ata: acpi: rework the ata acpi bind support
drivers/ata/libata-acpi.c | 278 ++++++++++++----------------------------- drivers/ata/libata-core.c | 5 - drivers/ata/libata-scsi.c | 13 +- drivers/ata/libata-transport.c | 2 + drivers/ata/libata-zpodd.c | 12 +- drivers/ata/libata.h | 20 +-- drivers/ata/pata_acpi.c | 4 +- drivers/scsi/scsi_lib.c | 22 ---- include/linux/libata.h | 2 - 9 files changed, 106 insertions(+), 252 deletions(-)
Signature · 1 line
1.8.3.2.10.g43d11f4