Lars Michael Jogback wrote: >> Can you please try the attached patch and see whether anything is >> different? > > Yes, it made it working. Heh... Okay, that's unexpected. > You don't think it has something todo with the spin-up time? > > The spin-up time on these disks is quite long: > smartctl -a /dev/sdn | grep Spin_Up_Time > 3 Spin_Up_Time 0x0007 068 068 011 Pre-fail Always - 10240 Maybe but I don't know. Spin up is usually waited upon by device readiness wait after SRST which libata does every time it probes or resets a device behind PMP. The drive is bringing link down briefly after SRST is complete. It doesn't make much sense. Maybe some quirkiness in the firmware? Can you please try the attached patch? If it doesn't work, please increment the constant 200LU by 100 each time and find out where it starts to work. Thanks. -- tejun
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 0cd3ad4..7f1a469 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -3799,10 +3799,17 @@ int sata_link_hardreset(struct ata_link *link, const unsigned long *timing, int sata_std_hardreset(struct ata_link *link, unsigned int *class, unsigned long deadline) { - const unsigned long *timing = sata_ehc_deb_timing(&link->eh_context); + const unsigned long *t = sata_ehc_deb_timing(&link->eh_context); + unsigned long timing[3] = { t[0], t[1], t[2] }; bool online; int rc; + ata_link_printk(link, KERN_INFO, "XXX0 hardreset debounce %lu %lu %lu\n", + timing[0], timing[1], timing[2]); + timing[1] = max(timing[1], 200LU); + ata_link_printk(link, KERN_INFO, "XXX1 hardreset debounce %lu %lu %lu\n", + timing[0], timing[1], timing[2]); + /* do hardreset */ rc = sata_link_hardreset(link, timing, deadline, &online, NULL); return online ? -EAGAIN : rc;