From: Stephen H. <she...@os...> - 2005-02-02 08:16:00
|
On Mon, 31 Jan 2005 23:08:56 -0500 John K Luebs <jk...@lu...> wrote: > Patch has two bug fixes for the Sigmatel stir4200 driver > - Prevent 36 minutes of no receive activity from causing large jiffie > sleep in turnaround_delay > - Ignore skb speed request if it's -1 > > Signed-off-by: John K. Luebs <jk...@lu...> > > --- linux-2.6.11-rc2/drivers/net/irda/stir4200.c.orig 2005-01-21 20:47:31.000000000 -0500 > +++ linux-2.6.11-rc2/drivers/net/irda/stir4200.c 2005-01-31 19:14:38.000000000 -0500 > @@ -671,7 +671,8 @@ static void turnaround_delay(const struc > return; > > do_gettimeofday(&now); > - us -= (now.tv_sec - stir->rx_time.tv_sec) * USEC_PER_SEC; > + if (now.tv_sec - stir->rx_time.tv_sec > 0) > + us -= USEC_PER_SEC; > us -= now.tv_usec - stir->rx_time.tv_usec; > if (us < 10) > return; Doesn't do >1 sec case properly, if it matters? Also not sure whether my original code using gettimeofday is really that great an idea, is it worth the effort to do turnaround times < 1ms? > @@ -787,7 +788,7 @@ static int stir_transmit_thread(void *ar > stir_send(stir, skb); > dev_kfree_skb(skb); > > - if (stir->speed != new_speed) { > + if ((new_speed != -1) && (stir->speed != new_speed)) { > if (fifo_txwait(stir, -1) || > change_speed(stir, new_speed)) > break; > How is new_speed of -1 getting in anyway? why did it get this far... should it just be checked when speed change is detected? |