Skip to content

Commit f64009b

Browse files
ubiedafabiobaltieri
authored andcommitted
afbr-s50: Accept requests if the on-going SQE has been cancelled
Considering the app may have cancelled all the requests as an error handling strategy, this driver needs to support recovering from such case. Signed-off-by: Luis Ubieda <[email protected]>
1 parent 00055d1 commit f64009b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/sensor/broadcom/afbr_s50/afbr_s50.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ static void afbr_s50_submit_single_shot(const struct device *dev,
190190
struct afbr_s50_data *data = dev->data;
191191

192192
/** If there's an op in process, reject ignore requests */
193-
if (data->rtio.iodev_sqe != NULL) {
193+
if (data->rtio.iodev_sqe != NULL &&
194+
FIELD_GET(RTIO_SQE_CANCELED, data->rtio.iodev_sqe->sqe.flags) == 0) {
194195
LOG_WRN("Operation in progress. Rejecting request");
195196

196197
rtio_iodev_sqe_err(iodev_sqe, -EBUSY);
@@ -215,7 +216,8 @@ static void afbr_s50_submit_streaming(const struct device *dev,
215216
const struct sensor_read_config *read_cfg = iodev_sqe->sqe.iodev->data;
216217

217218
/** If there's an op in process, reject ignore requests */
218-
if (data->rtio.iodev_sqe != NULL) {
219+
if (data->rtio.iodev_sqe != NULL &&
220+
FIELD_GET(RTIO_SQE_CANCELED, data->rtio.iodev_sqe->sqe.flags) == 0) {
219221
LOG_WRN("Operation in progress");
220222

221223
rtio_iodev_sqe_err(iodev_sqe, -EBUSY);

0 commit comments

Comments
 (0)