From: Damien Le Moal <dlemoal@kernel.org>
To: Markus Probst <markus.probst@posteo.de>,
Niklas Cassel <cassel@kernel.org>,
"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 1/3] scsi: sd: Add manage_restart device attribute to scsi_disk
Date: Tue, 28 Oct 2025 12:53:34 +0900 [thread overview]
Message-ID: <9f63d117-2bb2-453f-8c93-0cc3ea5c90ca@kernel.org> (raw)
In-Reply-To: <20251027202339.1043723-2-markus.probst@posteo.de>
On 10/28/25 5:23 AM, Markus Probst wrote:
> In addition to the already existing manage_shutdown,
> manage_system_start_stop and manage_runtime_start_stop device
> scsi_disk attributes, add manage_restart, which allows the high-level
> device driver (sd) to manage the device power state for SYSTEM_RESTART if
> set to 1.
>
> This attribute is necessary for the following commit "ata: stop disk on
> restart if ACPI power resources are found" to avoid a potential disk power
> failure in the case the SATA power connector does not retain the power
> state after a restart.
>
> Signed-off-by: Markus Probst <markus.probst@posteo.de>
One nit below.
With that fixed, looks OK to me.
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
> +static ssize_t manage_restart_show(struct device *dev,
> + struct device_attribute *attr, char *buf)
> +{
> + struct scsi_disk *sdkp = to_scsi_disk(dev);
> + struct scsi_device *sdp = sdkp->device;
> +
> + return sysfs_emit(buf, "%u\n", sdp->manage_restart);
> +}
> +
> +
One extra blank line not needed here.
> +static ssize_t manage_restart_store(struct device *dev,
> + struct device_attribute *attr,
> + const char *buf, size_t count)
> +{
> + struct scsi_disk *sdkp = to_scsi_disk(dev);
> + struct scsi_device *sdp = sdkp->device;
> + bool v;
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2025-10-28 3:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-27 20:23 [PATCH v5 0/3] Support power resources defined in acpi on ata Markus Probst
2025-10-27 20:23 ` [PATCH v5 2/3] ata: stop disk on restart if ACPI power resources are found Markus Probst
2025-10-28 3:53 ` Damien Le Moal
2025-10-27 20:23 ` [PATCH v5 1/3] scsi: sd: Add manage_restart device attribute to scsi_disk Markus Probst
2025-10-28 3:53 ` Damien Le Moal [this message]
2025-10-27 20:23 ` [PATCH v5 3/3] ata: Use ACPI methods to power on disks Markus Probst
2025-10-28 3:58 ` Damien Le Moal
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=9f63d117-2bb2-453f-8c93-0cc3ea5c90ca@kernel.org \
--to=dlemoal@kernel.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=cassel@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
all inboxes | Powered by JetHome®