From 51dd2cc3adf58fd92b61b6bd191b3719810bc4fe Mon Sep 17 00:00:00 2001 From: Aaron Nyholm Date: Thu, 17 Sep 2026 11:54:23 +1000 Subject: [PATCH] dev/io/iodev.c: Fix lock held while waiting on event iodev lock is now released when waiting on an event. This allows other IOCTL calls to be made while a thread is waiting on an event. --- cpukit/dev/io/iodev.c | 2 ++ cpukit/include/dev/io/iodev.h | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cpukit/dev/io/iodev.c b/cpukit/dev/io/iodev.c index 29df9ad1c7..e066873029 100644 --- a/cpukit/dev/io/iodev.c +++ b/cpukit/dev/io/iodev.c @@ -273,7 +273,9 @@ static int rtems_iodev_event_wait_on( struct rtems_iodev *iodev, void *arg ) rtems_set_errno_and_return_minus_one( ENODEV ); } + rtems_iodev_release( iodev ); status = ( *iodev->event_wait )( iodev, e_args ); + rtems_iodev_obtain( iodev ); return status; } diff --git a/cpukit/include/dev/io/iodev.h b/cpukit/include/dev/io/iodev.h index ad3081dba8..8d998c8186 100644 --- a/cpukit/include/dev/io/iodev.h +++ b/cpukit/include/dev/io/iodev.h @@ -226,7 +226,9 @@ struct rtems_iodev { ); /** - * @brief Call to the device driver to wait on event. + * @brief Call to the device driver to wait on event. The iodev lock is not + * held when event_wait is called to allow other IOCTL calls while waiting + * on an event. * * @param[in] iodev Pointer to iodev device. * @param[in,out] event_args Arguments for wait operation.