]> rtime.felk.cvut.cz Git - linux-lin.git/blobdiff - sllin/sllin.c
sllin: Don't fiddle with netdev queue and skb in slave receive mode
[linux-lin.git] / sllin / sllin.c
index 457788ce4a8088501488e9d5e99f0115b9aa9fb9..c922b848b7706d2e0929ac2d23889beea6e35c8e 100644 (file)
@@ -949,7 +949,16 @@ static enum hrtimer_restart sllin_rx_timeout_handler(struct hrtimer *hrtimer)
 {
        struct sllin *sl = container_of(hrtimer, struct sllin, rx_timer);
 
-       if (sl->lin_master) {
+       /*
+        * Signal timeout when:
+        * master: We did not receive as much characters as expected
+        * slave: * we did not receive any data bytes at all
+        *        * we know the length and didn't receive enough
+        */
+       if ((sl->lin_master) ||
+                       (sl->rx_cnt <= SLLIN_BUFF_DATA) ||
+                       ((!sl->rx_len_unknown) &&
+                       (sl->rx_cnt < sl->rx_expect))) {
                sllin_report_error(sl, LIN_ERR_RX_TIMEOUT);
                set_bit(SLF_TMOUTEVENT, &sl->flags);
        } else {
@@ -1232,8 +1241,6 @@ slstate_response_wait:
                                        sllin_send_tx_buff(sl);
                                }
 
-                               kfree_skb(sl->tx_req_skb);
-                               netif_wake_queue(sl->dev);
                                hrtimer_start(&sl->rx_timer,
                                        ktime_add(ktime_get(), sl->rx_timer_timeout),
                                        HRTIMER_MODE_ABS);