On 14/01/20(Tue) 18:37, Scott Cheloha wrote:
> Ticks to milliseconds.
> [...]
> @@ -303,16 +304,17 @@ lptpushbytes(struct lpt_softc *sc)
>                       while (NOT_READY()) {
>                               if (++spin < sc->sc_spinmax)
>                                       continue;
> -                             tic = 0;
> +                             msecs = 10;
>                               /* adapt busy-wait algorithm */
>                               sc->sc_spinmax++;
>                               while (NOT_READY_ERR()) {
>                                       /* exponential backoff */
> -                                     tic = tic + tic + 1;
> -                                     if (tic > TIMEOUT)
> -                                             tic = TIMEOUT;
> -                                     error = tsleep((caddr_t)sc,
> -                                         LPTPRI | PCATCH, "lptpsh", tic);
> +                                     msecs = msecs + msecs + 1;

Shouldn't the backoff algorithm be:

        msecs = 0;
        while (/* not ready */) {
                msecs = msecs + msecs + 10;
                ...
        }

Reply via email to