#1736 closed defect (worksforme)

Termios transmit starvation

Reported by: Sebastian Huber Owned by: Joel Sherrill
Priority: normal Milestone: 4.11
Component: score Version: 4.11
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description (last modified by Sebastian Huber)

A workaround for this problem is to disable the preemption around rtems_termios_dequeue_characters().

Index: ./libcsupport/src/termios.c
===================================================================
RCS file: /usr1/CVS/rtems/cpukit/libcsupport/src/termios.c,v
retrieving revision 1.64
diff -u -r1.64 termios.c
--- ./libcsupport/src/termios.c 10 Aug 2010 22:15:32 -0000 1.64
+++ ./libcsupport/src/termios.c 8 Feb 2011 11:37:06 -0000
@@ -1311,6 +1311,15 @@

  • wake up any pending writer task */

rtems_semaphore_release (tty->rawOutBuf.Semaphore);

+
+ /*
+ * FIXME: Here we have a race condition. In case this function is not
+ * invoked with preemption disabled (e.g. interrupt context) the release
+ * may interrupt us here and let the waiting task run. We may enter the
+ * rob_wait state again. Later in this function we loose this
+ * information, because we simply overwrite the state. This leads to
+ * transmit starvation.
+ */

}


if (newTail == tty->rawOutBuf.Head) {

Change History (3)

comment:1 Changed on Feb 8, 2011 at 10:39:57 AM by Sebastian Huber

A workaround for this problem is to disable the preemption around rtems_termios_dequeue_characters().

Index: ./libcsupport/src/termios.c
===================================================================
RCS file: /usr1/CVS/rtems/cpukit/libcsupport/src/termios.c,v
retrieving revision 1.64
diff -u -r1.64 termios.c
--- ./libcsupport/src/termios.c 10 Aug 2010 22:15:32 -0000 1.64
+++ ./libcsupport/src/termios.c 8 Feb 2011 11:37:06 -0000
@@ -1311,6 +1311,15 @@

  • wake up any pending writer task */

rtems_semaphore_release (tty->rawOutBuf.Semaphore);

+
+ /*
+ * FIXME: Here we have a race condition. In case this function is not
+ * invoked with preemption disabled (e.g. interrupt context) the release
+ * may interrupt us here and let the waiting task run. We may enter the
+ * rob_wait state again. Later in this function we loose this
+ * information, because we simply overwrite the state. This leads to
+ * transmit starvation.
+ */

}


if (newTail == tty->rawOutBuf.Head) {

comment:2 Changed on Nov 24, 2014 at 6:58:28 PM by Gedare Bloom

Version: HEAD4.11

Replace Version=HEAD with Version=4.11 for the tickets with Milestone >= 4.11

comment:3 Changed on Dec 18, 2014 at 9:36:00 AM by Sebastian Huber

Description: modified (diff)
Resolution: worksforme
Status: newclosed

After a review I don't think this problem exists.

Note: See TracTickets for help on using tickets.