Dear Linux folks,
Trying to decrease Linux’ overall boot time, tracing
`sata_link_resume()` with ftrace, it calls `sata_link_debounce()` also
in `drivers/ata/libata-sata.c`
if ((rc = sata_link_debounce(link, params, deadline)))
return rc;
which runs a while loop, and takes the parameters defined in arrays at
the top of the file.
/* debounce timing parameters in msecs { interval, duration,
timeout } */
const unsigned long sata_deb_timing_normal[] = { 5,
100, 2000 };
EXPORT_SYMBOL_GPL(sata_deb_timing_normal);
const unsigned long sata_deb_timing_hotplug[] = { 25,
500, 2000 };
EXPORT_SYMBOL_GPL(sata_deb_timing_hotplug);
const unsigned long sata_deb_timing_long[] = { 100,
2000, 5000 };
EXPORT_SYMBOL_GPL(sata_deb_timing_long);
const unsigned long sata_deb_timing_normal[] = { 5, 100,
2000 };
So the duration is set to 100 ms, which is quite a long time on current
systems. At least on the Asus F2A85-M PRO that does not seem to be
necessary. The motivation for adding these delays seems to be again
broken controllers:
Make sure SStatus of @link reaches stable state, determined by
holding the same value where DET is not 1 for @duration polled every
@interval, before @timeout. Timeout constraints the beginning of the
stable state. Because DET gets stuck at 1 on some controllers after
hot unplugging, this functions waits until timeout then returns 0 if
DET is stable at 1.
As I neither know the SATA standard nor the Linux code well, do you have
a suggestion how to improve that on controllers not needing such a long
delay? Make the duration value configurable on Linux’ command line?
Kind regards,
Paul