drivers: Disable priority inheritance on all semaphores used for signaling

This commit is contained in:
Gregory Nutt
2016-11-03 11:00:47 -06:00
parent bdde5720ca
commit 4fcbe8e410
20 changed files with 184 additions and 19 deletions
+3 -1
View File
@@ -55,8 +55,9 @@
#include <debug.h>
#include <nuttx/irq.h>
#include <nuttx/net/net.h>
#include <nuttx/clock.h>
#include <nuttx/semaphore.h>
#include <nuttx/net/net.h>
#include <nuttx/net/netdev.h>
#include <nuttx/net/ip.h>
#include <nuttx/net/slip.h>
@@ -965,6 +966,7 @@ int slip_initialize(int intf, FAR const char *devname)
/* Initialize the wait semaphore */
sem_init(&priv->waitsem, 0, 0);
sem_setprotocol(&priv->waitsem, SEM_PRIO_NONE);
/* Put the interface in the down state. This usually amounts to resetting
* the device and/or calling slip_ifdown().
+7 -1
View File
@@ -884,11 +884,17 @@ static int tun_dev_init(FAR struct tun_device_s *priv, FAR struct file *filep,
#endif
priv->dev.d_private = (FAR void *)priv; /* Used to recover private state from dev */
/* Initialize the wait semaphore */
/* Initialize the mutual exlcusion and wait semaphore */
sem_init(&priv->waitsem, 0, 1);
sem_init(&priv->read_wait_sem, 0, 0);
/* The wait semaphore is used for signaling and, hence, should not have
* priority inheritance enabled.
*/
sem_setprotocol(&priv->read_wait_sem, SEM_PRIO_NONE);
/* Create a watchdog for timing polling for and timing of transmisstions */
priv->txpoll = wd_create(); /* Create periodic poll timer */