We need to load firmware onto the device.  It seems we need to poll
for completion in two phases.

So, poll at 10ms intervals in each case.  We can make it faster later
if need be.

ok?

Index: pci/if_tht.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_tht.c,v
retrieving revision 1.141
diff -u -p -r1.141 if_tht.c
--- pci/if_tht.c        9 Jan 2020 14:35:19 -0000       1.141
+++ pci/if_tht.c        17 Jan 2020 01:40:50 -0000
@@ -1682,7 +1682,8 @@ tht_fw_load(struct tht_softc *sc)
        buf = fw;
        while (fwlen > 0) {
                while (tht_fifo_writable(sc, &sc->sc_txt) <= THT_FIFO_GAP) {
-                       if (tsleep(sc, PCATCH, "thtfw", 1) == EINTR)
+                       if (tsleep_nsec(sc, PCATCH, "thtfw",
+                           MSEC_TO_NSEC(10)) == EINTR)
                                goto err;
                }
 
@@ -1703,7 +1704,8 @@ tht_fw_load(struct tht_softc *sc)
                        break;
                }
 
-               if (tsleep(sc, PCATCH, "thtinit", 1) == EINTR)
+               if (tsleep_nsec(sc, PCATCH, "thtinit",
+                   MSEC_TO_NSEC(10)) == EINTR)
                        goto err;
        }
        timeout_del(&ticker);

Reply via email to