On 10/16/23 01:14, Phillip Susi wrote: > For SCSI disks that are runtime suspended, it looks like they skip > waking the disk on system resume, leaving them in runtime suspend. > After these patches, it looks like libata always wakes up the disk, but > I don't see any calls to pm_runtime_disable/set_active/enable to mark > the scsi disk as active after the system resume. That should result in > a disk that is spinning, but runtime pm thinks is not, and so will not > put it into suspend after the inactivity timeout. Yes, correct, but this does not create any issues in practice beside the undesired disk spinup. Fixing that is not trivial because using runtime suspend/resume on the SCSI disk is just that, it will affect *only* the SCSI disk and not the ATA device and its port. In other words, a runtime suspend of the SCSI disk will spin down the drive but it will not runtime suspend the ATA port. So if you suspend the system, on resume, the ATA port will not be runtime suspended and so it will be resumed. The SCSI disk will not be resumed, but the ATA port resume will have spun up the disk, which we do not really want in that case. I am looking into this. Again, that is not a trivial fix. The other thing to notice here is that ATA port runtime suspend/resume is in fact broken: it does not track accesses to the device(s) connected to the port. And given that more than one device may be connected to a port, we need PM runtime reference counting to be done for this to work correctly. That is missing. Solutions are: fix everything or simply do not support ATA port runtime suspend/resume (i.e. remove code doing it). I am leaning toward the latter as it seems that no one actually noticed these issues because no one is actually using ATA port runtime suspend/resume... -- Damien Le Moal Western Digital Research