From: Niklas Cassel <cassel@kernel.org>
To: Markus Probst <markus.probst@posteo.de>
Cc: Damien Le Moal <dlemoal@kernel.org>,
"James E . J . Bottomley" <James.Bottomley@hansenpartnership.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] ata: Use ACPI methods to power on ata ports
Date: Thu, 9 Oct 2025 13:59:30 +0200 [thread overview]
Message-ID: <aOejov5d_TlVkueH@ryzen> (raw)
In-Reply-To: <20251009112433.108643-3-markus.probst@posteo.de>
On Thu, Oct 09, 2025 at 11:24:49AM +0000, Markus Probst wrote:
> Some embedded devices, including many Synology NAS devices, have the
> ability to control whether a ATA port has power or not.
In V1, you mentioned that it was to control the SATA power supply,
now you mention the ATA port. I am confused.
If it is for the ATA port, then SATA already has support for this,
using PxSCTL.
How does this ACPI way to control power interact with the regular
way to control power for a port using PxSCTL?
>
> Add a new function, ata_acpi_dev_manage_restart(), that will be used to
> determine if a disk should be stopped before restarting the system. If a
> usable ACPI power resource has been found, it is assumed that the disk
> will lose power after a restart and should be stopped to avoid a power
> failure. Also add a new function, ata_acpi_port_set_power_state(), that
> will be used to power on an ata port if usable ACPI power resources are
> found. It will be called right before probing the port, therefore the port
> will be powered on just in time.
>
> Signed-off-by: Markus Probst <markus.probst@posteo.de>
> ---
> drivers/ata/libata-acpi.c | 70 +++++++++++++++++++++++++++++++++++++++
> drivers/ata/libata-core.c | 2 ++
> drivers/ata/libata-scsi.c | 1 +
> drivers/ata/libata.h | 4 +++
> 4 files changed, 77 insertions(+)
>
> diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c
> index f2140fc06ba0..bba5ef49f055 100644
> --- a/drivers/ata/libata-acpi.c
> +++ b/drivers/ata/libata-acpi.c
> @@ -245,6 +245,76 @@ void ata_acpi_bind_dev(struct ata_device *dev)
> ata_acpi_dev_uevent);
> }
>
> +/**
> + * ata_acpi_dev_manage_restart - if the disk should be stopped (spin down) on
> + * system restart.
> + * @dev: target ATA device
> + *
> + * RETURNS:
> + * true if the disk should be stopped, otherwise false
> + */
> +bool ata_acpi_dev_manage_restart(struct ata_device *dev)
> +{
> + // If the device is power manageable and we assume the disk loses power
> + // on reboot.
Like Damien mentioned earlier, please no C++ style comments.
Kind regards,
Niklas
next prev parent reply other threads:[~2025-10-09 11:59 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-05 19:05 [PATCH 0/2] Support power resources in ata ports Markus Probst
2025-10-05 19:06 ` [PATCH 1/2] Add manage_restart device attribute to scsi_disk Markus Probst
2025-10-05 19:06 ` [PATCH 2/2] Power on ata ports defined in ACPI before probing ports Markus Probst
2025-10-06 1:09 ` Damien Le Moal
2025-10-09 11:07 ` Markus Probst
2025-10-06 15:07 ` Niklas Cassel
2025-10-06 15:50 ` Markus Probst
2025-10-09 11:41 ` Niklas Cassel
2025-10-06 0:58 ` [PATCH 1/2] Add manage_restart device attribute to scsi_disk Damien Le Moal
2025-10-06 12:11 ` Markus Probst
2025-10-09 11:24 ` [PATCH v2 0/2] Support power resources defined in acpi on ata Markus Probst
2025-10-09 11:24 ` [PATCH v2 2/2] ata: Use ACPI methods to power on ata ports Markus Probst
2025-10-09 11:59 ` Niklas Cassel [this message]
2025-10-09 12:03 ` Niklas Cassel
2025-10-09 13:48 ` Markus Probst
2025-10-10 15:52 ` kernel test robot
2025-10-09 11:24 ` [PATCH v2 1/2] scsi: sd: Add manage_restart device attribute to scsi_disk Markus Probst
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aOejov5d_TlVkueH@ryzen \
--to=cassel@kernel.org \
--cc=James.Bottomley@hansenpartnership.com \
--cc=dlemoal@kernel.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=markus.probst@posteo.de \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox