From cfa9e7afb7fe4e51b86b22be595dfe4c0615fa54 Mon Sep 17 00:00:00 2001 From: ppisa Date: Tue, 3 Feb 2009 04:06:55 +0100 Subject: [PATCH] Eliminated busy loop in the USB can sources and thread priority increased. Signed-off-by: ppisa --- lincan/src/usbcan.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lincan/src/usbcan.c b/lincan/src/usbcan.c index 01d2f90..429167c 100644 --- a/lincan/src/usbcan.c +++ b/lincan/src/usbcan.c @@ -1213,6 +1213,12 @@ int usbcan_kthread(void *data) INIT_LIST_HEAD(&dev->tx_pend_list); INIT_LIST_HEAD(&dev->tx_ready_list); + if (1) { + struct sched_param param = { .sched_priority = 1 }; + sched_setscheduler(current, SCHED_FIFO, ¶m); + } + + /* Prepare receive urbs */ for (i=0;iflags); + + mb(); + while(!list_empty(&dev->rx_ready_list)) { struct usbcan_message *m; m = list_first_entry(&dev->rx_ready_list, typeof(*m), list_node); -- 2.39.2