mirror of
https://github.com/apache/nuttx.git
synced 2026-06-08 01:42:58 +08:00
drivers: Disable priority inheritance on all semaphores used for signaling
This commit is contained in:
@@ -71,6 +71,7 @@
|
||||
#include <nuttx/spi/spi.h>
|
||||
#include <nuttx/wqueue.h>
|
||||
|
||||
#include <nuttx/semaphore.h>
|
||||
#include <nuttx/input/touchscreen.h>
|
||||
#include <nuttx/input/ads7843e.h>
|
||||
|
||||
@@ -1184,9 +1185,17 @@ int ads7843e_register(FAR struct spi_dev_s *spi,
|
||||
priv->threshx = INVALID_THRESHOLD; /* Initialize thresholding logic */
|
||||
priv->threshy = INVALID_THRESHOLD; /* Initialize thresholding logic */
|
||||
|
||||
/* Initialize semaphores */
|
||||
|
||||
sem_init(&priv->devsem, 0, 1); /* Initialize device structure semaphore */
|
||||
sem_init(&priv->waitsem, 0, 0); /* Initialize pen event wait semaphore */
|
||||
|
||||
/* The pen event semaphore is used for signaling and, hence, should not
|
||||
* have priority inheritance enabled.
|
||||
*/
|
||||
|
||||
sem_setprotocol(&priv->waitsem, SEM_PRIO_NONE);
|
||||
|
||||
/* Make sure that interrupts are disabled */
|
||||
|
||||
config->clear(config);
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
#include <nuttx/fs/fs.h>
|
||||
#include <nuttx/spi/spi.h>
|
||||
|
||||
#include <nuttx/semaphore.h>
|
||||
#include <nuttx/input/touchscreen.h>
|
||||
#include <nuttx/input/max11802.h>
|
||||
|
||||
@@ -1187,9 +1188,17 @@ int max11802_register(FAR struct spi_dev_s *spi,
|
||||
priv->threshx = INVALID_THRESHOLD; /* Initialize thresholding logic */
|
||||
priv->threshy = INVALID_THRESHOLD; /* Initialize thresholding logic */
|
||||
|
||||
/* Initialize semaphores */
|
||||
|
||||
sem_init(&priv->devsem, 0, 1); /* Initialize device structure semaphore */
|
||||
sem_init(&priv->waitsem, 0, 0); /* Initialize pen event wait semaphore */
|
||||
|
||||
/* The pen event semaphore is used for signaling and, hence, should not
|
||||
* have priority inheritance enabled.
|
||||
*/
|
||||
|
||||
sem_setprotocol(&priv->waitsem, SEM_PRIO_NONE);
|
||||
|
||||
/* Make sure that interrupts are disabled */
|
||||
|
||||
config->clear(config);
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
#include <nuttx/i2c/i2c_master.h>
|
||||
#include <nuttx/wqueue.h>
|
||||
|
||||
#include <nuttx/semaphore.h>
|
||||
#include <nuttx/input/touchscreen.h>
|
||||
#include <nuttx/input/mxt.h>
|
||||
|
||||
@@ -1884,9 +1885,17 @@ int mxt_register(FAR struct i2c_master_s *i2c,
|
||||
priv->i2c = i2c; /* Save the SPI device handle */
|
||||
priv->lower = lower; /* Save the board configuration */
|
||||
|
||||
/* Initialize semaphores */
|
||||
|
||||
sem_init(&priv->devsem, 0, 1); /* Initialize device semaphore */
|
||||
sem_init(&priv->waitsem, 0, 0); /* Initialize event wait semaphore */
|
||||
|
||||
/* The event wait semaphore is used for signaling and, hence, should not
|
||||
* have priority inheritance enabled.
|
||||
*/
|
||||
|
||||
sem_setprotocol(&priv->waitsem, SEM_PRIO_NONE);
|
||||
|
||||
/* Make sure that interrupts are disabled */
|
||||
|
||||
MXT_CLEAR(lower);
|
||||
|
||||
Reference in New Issue
Block a user