On Mon, Jan 13, 2020 at 06:32:00PM -0600, Scott Cheloha wrote:
> These sleeps don't have units, though in practice they are 1 second.
> Just prior in the code I see a delay(9) of 100 microseconds.  Is the
> 100 ticks here a typo?  What is a reasonable sleep duration for this
> hardware?

Both of these are inside loops that terminate when the hardware (actually the
fibrechannel switch the hardware is connected to, in this case) responsds.
The tsleep length is arbitrary, so one second is as good as anything else.

ok jmatthew@

> 
> Index: pci/qle.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/pci/qle.c,v
> retrieving revision 1.48
> diff -u -p -r1.48 qle.c
> --- pci/qle.c 31 Dec 2019 22:57:07 -0000      1.48
> +++ pci/qle.c 14 Jan 2020 00:29:34 -0000
> @@ -1886,7 +1886,8 @@ qle_ct_pass_through(struct qle_softc *sc
>                       if (qle_read_isr(sc, &isr, &info) != 0)
>                               qle_handle_intr(sc, isr, info);
>               } else {
> -                     tsleep(sc->sc_scratch, PRIBIO, "qle_fabric", 100);
> +                     tsleep_nsec(sc->sc_scratch, PRIBIO, "qle_fabric",
> +                         SEC_TO_NSEC(1));
>               }
>       }
>       if (rv == 0)
> @@ -2014,7 +2015,8 @@ qle_fabric_plogx(struct qle_softc *sc, s
>                       if (qle_read_isr(sc, &isr, &info) != 0)
>                               qle_handle_intr(sc, isr, info);
>               } else {
> -                     tsleep(sc->sc_scratch, PRIBIO, "qle_fabric", 100);
> +                     tsleep_nsec(sc->sc_scratch, PRIBIO, "qle_fabric",
> +                         SEC_TO_NSEC(1));
>               }
>       }
>       sc->sc_fabric_pending = 0;

Reply via email to