On 10/18/23 03:03, Phillip Susi wrote: > Damien Le Moal <dlemoal@xxxxxxxxxx> writes: > >> That one should be fixable, though it I do not see an elegant method to do it. >> It would be easy with ugly code, e.g. tweaking the scsi device runtime pm state >> from libata... Not great. > > What would be not great about it? libata already takes over the system To have to add code in libata that touches the scsi device PM status is what's not going to be great. Such code should stay in sd.c and scsi_pm.c. But not sure we actually need anything. > suspend/resume from sd. I'm currently testing having libata do just > this right now. I just got ahold of some jumpers today to put the > drives back into PuiS and do some further testing tonight. > >> Never saw that in my tests when enabling runtime pm on the scsi disk only. Which >> is the important point here: there is no propagation of the suspend state down >> to the device parent it seems. > > Last night I again saw the port auto suspend when the scsi disk was > runtime suspended. Tonight I'll test with PuiS, as well as with system > resume while runtime suspended. Maybe I'll even try to get the whole > AHCI controller to auto suspend. It seems like it should once all of > the ports do. With my tests, I never set the ata port power/control to "auto", which may be why I did not see the port being runtime suspended when the scsi disk was runtime suspended. Will try again. >> I am not sure of that, especially with cases of ATA ports with multiple disks >> (e.g. pmp or IDE). > > Good point. I have an eSATA dock with PMP. I'll check tonight if the > children are counted properly. With the device links in place between port and scsi devices, we should be OK. But still need to check that we do not need runtime_get/put calls added. Ideally, we should have the chain: scsi disk -> scsi target -> scsi host -> ata port for runtime suspend, and the reverse for runtime resume. If there is a system suspend/resume between runtime suspend/resume, the port should not be resumed if it is runtime suspended. -- Damien Le Moal Western Digital Research