> Don't tell me this fixes SATA on the xserve G5...

It does.

> Wonder if a "posting read" is necessary here.  If that removes the
> need to increase the delay, it probably is a better solution.

I've tried this diff and I have not been able to reproduce the bogus
SStatus value in a few reboots yet:

Index: pciide.c
===================================================================
RCS file: /OpenBSD/src/sys/dev/pci/pciide.c,v
retrieving revision 1.355
diff -u -p -r1.355 pciide.c
--- pciide.c    18 Oct 2015 20:24:10 -0000      1.355
+++ pciide.c    15 Nov 2015 10:21:36 -0000
@@ -7924,10 +7924,14 @@ svwsata_drv_probe(struct channel_softc *
 
        bus_space_write_4(ss->ba5_st, ss->ba5_sh,
            (channel << 8) + SVWSATA_SCONTROL, scontrol);
+       (void)bus_space_read_4(ss->ba5_st, ss->ba5_sh,
+           (channel << 8) + SVWSATA_SCONTROL);
        delay(50 * 1000);
        scontrol &= ~SControl_DET_INIT;
        bus_space_write_4(ss->ba5_st, ss->ba5_sh,
            (channel << 8) + SVWSATA_SCONTROL, scontrol);
+       (void)bus_space_read_4(ss->ba5_st, ss->ba5_sh,
+           (channel << 8) + SVWSATA_SCONTROL);
        delay(50 * 1000);
 
        sstatus = bus_space_read_4(ss->ba5_st, ss->ba5_sh,

Reply via email to