NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

re: kern/57407: Fix for kernel freeze with "BSY never cleared, status 0x80" with 1TB Seagate SATA HDD



FWIW, part of testing attempts to read from a failing disk i had written
code to do similar with kernel options.  i vaguely meant to try to convert
it to using some sort of config flags so it's per-device capable, not all
devices, that's why i didn't commit or send for review yet.

you'd use it for your need as:

   options SATA_FORCE_SPD=SControl_SPD_G1


.mrg.


Index: sys/dev/ata/sata_subr.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ata/sata_subr.c,v
retrieving revision 1.24
diff -p -u -r1.24 sata_subr.c
--- sys/dev/ata/sata_subr.c	21 Jun 2018 21:52:15 -0000	1.24
+++ sys/dev/ata/sata_subr.c	14 May 2023 17:12:15 -0000
@@ -93,7 +93,11 @@ sata_reset_interface(struct ata_channel 
 	 * the device. It doesn't hurt for other devices.
 	 */
 	bus_space_write_4(sata_t, scontrol_r, 0, 0);
+#ifdef SATA_FORCE_SPD
+	scontrol = SControl_IPM_NONE | SATA_FORCE_SPD | SControl_DET_INIT;
+#else
 	scontrol = SControl_IPM_NONE | SControl_SPD_ANY | SControl_DET_INIT;
+#endif
 	bus_space_write_4(sata_t, scontrol_r, 0, scontrol);
 
 	ata_delay(chp, 50, "sataup", flags);


Home | Main Index | Thread Index | Old Index