Re: [PATCH v6 04/23] scsi: sd: Differentiate system and runtime start/stop management

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/22/23 17:29, Damien Le Moal wrote:
  static const struct dev_pm_ops sd_pm_ops = {
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index b9230b6add04..b7df1e6da969 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -193,7 +193,8 @@ struct scsi_device {
  	unsigned use_192_bytes_for_3f:1; /* ask for 192 bytes from page 0x3f */
  	unsigned no_start_on_add:1;	/* do not issue start on add */
  	unsigned allow_restart:1; /* issue START_UNIT in error handler */
-	unsigned manage_start_stop:1;	/* Let HLD (sd) manage start/stop */
+	unsigned manage_system_start_stop:1; /* Let HLD (sd) manage system start/stop */
+	unsigned manage_runtime_start_stop:1; /* Let HLD (sd) manage runtime start/stop */
  	unsigned no_start_on_resume:1; /* Do not issue START_STOP_UNIT on resume */
  	unsigned start_stop_pwr_cond:1;	/* Set power cond. in START_STOP_UNIT */
  	unsigned no_uld_attach:1; /* disable connecting to upper level drivers */

This is probably a good opportunity to change 'manage_system_start_stop' and
'manage_runtime_start_stop' from bitfields into booleans. Although unlikely, a
user could try to change both attributes from different threads. If this happens,
because bitfield changes are not atomic, this could cause one of the two updates
to be lost.

Thanks,

Bart.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux