drivers: sensors: rtio

Inform the executor of a submissions completion with -ENOMEM
if the size of the workq is not big enough.

Signed-off-by: Florian Weber <Florian.Weber@live.de>
This commit is contained in:
Florian Weber 2024-10-15 09:59:38 +02:00 committed by Anas Nashif
parent 60a2d7d7d2
commit 0d9cdf0990
7 changed files with 42 additions and 7 deletions

View file

@ -48,7 +48,12 @@ void akm09918c_submit(const struct device *dev, struct rtio_iodev_sqe *iodev_sqe
{ {
struct rtio_work_req *req = rtio_work_req_alloc(); struct rtio_work_req *req = rtio_work_req_alloc();
__ASSERT_NO_MSG(req); if (req == NULL) {
LOG_ERR("RTIO work item allocation failed. Consider to increase "
"CONFIG_RTIO_WORKQ_POOL_ITEMS.");
rtio_iodev_sqe_err(iodev_sqe, -ENOMEM);
return;
}
rtio_work_req_submit(req, iodev_sqe, akm09918c_submit_sync); rtio_work_req_submit(req, iodev_sqe, akm09918c_submit_sync);
} }

View file

@ -444,7 +444,12 @@ static void bma4xx_submit(const struct device *dev, struct rtio_iodev_sqe *iodev
{ {
struct rtio_work_req *req = rtio_work_req_alloc(); struct rtio_work_req *req = rtio_work_req_alloc();
__ASSERT_NO_MSG(req); if (req == NULL) {
LOG_ERR("RTIO work item allocation failed. Consider to increase "
"CONFIG_RTIO_WORKQ_POOL_ITEMS.");
rtio_iodev_sqe_err(iodev_sqe, -ENOMEM);
return;
}
rtio_work_req_submit(req, iodev_sqe, bma4xx_submit_sync); rtio_work_req_submit(req, iodev_sqe, bma4xx_submit_sync);
} }

View file

@ -76,7 +76,12 @@ void bme280_submit(const struct device *dev, struct rtio_iodev_sqe *iodev_sqe)
{ {
struct rtio_work_req *req = rtio_work_req_alloc(); struct rtio_work_req *req = rtio_work_req_alloc();
__ASSERT_NO_MSG(req); if (req == NULL) {
LOG_ERR("RTIO work item allocation failed. Consider to increase "
"CONFIG_RTIO_WORKQ_POOL_ITEMS.");
rtio_iodev_sqe_err(iodev_sqe, -ENOMEM);
return;
}
rtio_work_req_submit(req, iodev_sqe, bme280_submit_sync); rtio_work_req_submit(req, iodev_sqe, bme280_submit_sync);
} }

View file

@ -265,7 +265,12 @@ static void sensor_submit_fallback(const struct device *dev, struct rtio_iodev_s
{ {
struct rtio_work_req *req = rtio_work_req_alloc(); struct rtio_work_req *req = rtio_work_req_alloc();
__ASSERT_NO_MSG(req); if (req == NULL) {
LOG_ERR("RTIO work item allocation failed. Consider to increase "
"CONFIG_RTIO_WORKQ_POOL_ITEMS.");
rtio_iodev_sqe_err(iodev_sqe, -ENOMEM);
return;
}
rtio_work_req_submit(req, iodev_sqe, sensor_submit_fallback_sync); rtio_work_req_submit(req, iodev_sqe, sensor_submit_fallback_sync);
} }

View file

@ -80,7 +80,12 @@ void mmc56x3_submit(const struct device *dev, struct rtio_iodev_sqe *iodev_sqe)
{ {
struct rtio_work_req *req = rtio_work_req_alloc(); struct rtio_work_req *req = rtio_work_req_alloc();
__ASSERT_NO_MSG(req); if (req == NULL) {
LOG_ERR("RTIO work item allocation failed. Consider to increase "
"CONFIG_RTIO_WORKQ_POOL_ITEMS.");
rtio_iodev_sqe_err(iodev_sqe, -ENOMEM);
return;
}
rtio_work_req_submit(req, iodev_sqe, mmc56x3_submit_sync); rtio_work_req_submit(req, iodev_sqe, mmc56x3_submit_sync);
} }

View file

@ -97,7 +97,12 @@ void icm42688_submit(const struct device *dev, struct rtio_iodev_sqe *iodev_sqe)
{ {
struct rtio_work_req *req = rtio_work_req_alloc(); struct rtio_work_req *req = rtio_work_req_alloc();
__ASSERT_NO_MSG(req); if (req == NULL) {
LOG_ERR("RTIO work item allocation failed. Consider to increase "
"CONFIG_RTIO_WORKQ_POOL_ITEMS.");
rtio_iodev_sqe_err(iodev_sqe, -ENOMEM);
return;
}
rtio_work_req_submit(req, iodev_sqe, icm42688_submit_sync); rtio_work_req_submit(req, iodev_sqe, icm42688_submit_sync);
} }

View file

@ -104,7 +104,12 @@ void spi_rtio_iodev_default_submit(const struct device *dev,
struct rtio_work_req *req = rtio_work_req_alloc(); struct rtio_work_req *req = rtio_work_req_alloc();
__ASSERT_NO_MSG(req); if (req == NULL) {
LOG_ERR("RTIO work item allocation failed. Consider to increase "
"CONFIG_RTIO_WORKQ_POOL_ITEMS.");
rtio_iodev_sqe_err(iodev_sqe, -ENOMEM);
return;
}
rtio_work_req_submit(req, iodev_sqe, spi_rtio_iodev_default_submit_sync); rtio_work_req_submit(req, iodev_sqe, spi_rtio_iodev_default_submit_sync);
} }