summaryrefslogtreecommitdiff
path: root/drivers/ata/libata.h
diff options
context:
space:
mode:
authorMarkus Probst <markus.probst@posteo.de>2025-11-04 14:24:33 +0000
committerMartin K. Petersen <martin.petersen@oracle.com>2025-11-08 13:24:55 -0500
commitce6d26b5330c5de4f458143e9675984e367f6a40 (patch)
treed20e66b0875691a54117b0d6e74d5b19e7475a70 /drivers/ata/libata.h
parent8fdfdb1488162c195f3f0af10b7bc2b8b42928c5 (diff)
scsi: ata: Use ACPI methods to power on disks
Some embedded devices have the ability to control whether power is provided to the disks via the SATA power connector or not. If power resources are defined on ATA ports / devices in ACPI, we should try to set the power state to D0 before probing the disk to ensure that any power supply or power gate that may exist is providing power to the disk. An example for such devices would be newer synology NAS devices. Every disk slot has its own SATA power connector. Whether the connector is providing power is controlled via an gpio, which is *off by default*. Also the disk loses power on reboots. Add a new function, ata_acpi_port_power_on(), that will be used to power on the SATA power connector if usable ACPI power resources on the associated ATA port / device are found. It will be called right before probing the port, therefore the disk will be powered on just in time. Signed-off-by: Markus Probst <markus.probst@posteo.de> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Link: https://patch.msgid.link/20251104142413.322347-3-markus.probst@posteo.de Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/ata/libata.h')
-rw-r--r--drivers/ata/libata.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h
index e5b977a8d3e1..8cc7227f2d94 100644
--- a/drivers/ata/libata.h
+++ b/drivers/ata/libata.h
@@ -130,6 +130,7 @@ extern void ata_acpi_on_disable(struct ata_device *dev);
extern void ata_acpi_set_state(struct ata_port *ap, pm_message_t state);
extern void ata_acpi_bind_port(struct ata_port *ap);
extern void ata_acpi_bind_dev(struct ata_device *dev);
+extern void ata_acpi_port_power_on(struct ata_port *ap);
extern acpi_handle ata_dev_acpi_handle(struct ata_device *dev);
#else
static inline void ata_acpi_dissociate(struct ata_host *host) { }
@@ -140,6 +141,7 @@ static inline void ata_acpi_set_state(struct ata_port *ap,
pm_message_t state) { }
static inline void ata_acpi_bind_port(struct ata_port *ap) {}
static inline void ata_acpi_bind_dev(struct ata_device *dev) {}
+static inline void ata_acpi_port_power_on(struct ata_port *ap) {}
#endif
/* libata-scsi.c */