On 7/1/25 6:24 PM, Niklas Cassel wrote: > On Tue, Jul 01, 2025 at 03:48:15PM +0900, Damien Le Moal wrote: >> >> There is a 10ms wait already in sata_link_scr_lpm() but it seems to not always >> be enough. The specs say that transitions out of HIPM "shall not take more than >> 10ms", but hey, we all know how devices always follow the specs, right ? :) > > HIPM / ALPM includes Partial, Slumber and DevSleep. > > 10 ms is for Slumber. Oops. Yes, I meant slumber when I said HIPM... My brain is in lower power state today :) > DevSleep can be much longer than that: > - DevSleep: The Phy logic may be powered down. The exit latency from > this state is no longer than 20 ms, unless otherwise > specified by DETO in the device Identify Device Data log. > > > From PxDEVSLP.DETO: > Device Sleep Exit Timeout (DETO): This field specifies the maximum duration (in > approximate 1ms granularity) from DEVSLP de-assertion until the device is ready to > accept OOB. The nominal value is 20ms while the max value is 255ms depending > on device identification information. > > > So technically it can be 255 ms :) Yep. Hence why the 10ms sleep is sometimes not enough. > Note that we do actually read and save DETO: > https://github.com/torvalds/linux/blob/v6.16-rc4/drivers/ata/libahci.c#L2293-L2295 > > But like you said below, with this patch, we should be able to remove the sleep > if we wanted, so I don't think that we necessarily need to increase it. I definitely do not want to increase it ! -- Damien Le Moal Western Digital Research