lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9f63d117-2bb2-453f-8c93-0cc3ea5c90ca@kernel.org>
Date: Tue, 28 Oct 2025 12:53:34 +0900
From: Damien Le Moal <dlemoal@...nel.org>
To: Markus Probst <markus.probst@...teo.de>, Niklas Cassel
 <cassel@...nel.org>,
 "James E.J. Bottomley" <James.Bottomley@...senPartnership.com>,
 "Martin K. Petersen" <martin.petersen@...cle.com>
Cc: linux-ide@...r.kernel.org, linux-scsi@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 1/3] scsi: sd: Add manage_restart device attribute to
 scsi_disk

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@...teo.de>

One nit below.

With that fixed, looks OK to me.

Reviewed-by: Damien Le Moal <dlemoal@...nel.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ