Skip to content

spi_rtio: Transaction OPs not working for Default handler #85896

@ubieda

Description

@ubieda

Describe the bug

SPI RTIO default handler does not properly execute multi-transaction OPs (e.g: write + read in a single transfer).

Expected behavior

The expectation is to perform a single SPI transfer without de-asserting CS line.
What is currently happening is that the CS line is de-asserted at the end of each OP, resetting the state for the second or third operations.

Impact

In-tree Sensor drivers depend on this behavior, for instance:

  • ICM42688:
    rtio_sqe_prep_tiny_write(write_fifo_addr, spi_iodev, RTIO_PRIO_NORM, &reg_addr, 1, NULL);
    write_fifo_addr->flags = RTIO_SQE_TRANSACTION;
    rtio_sqe_prep_read(read_fifo_data, spi_iodev, RTIO_PRIO_NORM, read_buf, read_len,
    iodev_sqe);
  • ADXL's:
    rtio_sqe_prep_tiny_write(write_fifo_addr, data->iodev, RTIO_PRIO_NORM, &reg_addr,
    1, NULL);
    write_fifo_addr->flags = RTIO_SQE_TRANSACTION;
    rtio_sqe_prep_read(read_fifo_data, data->iodev, RTIO_PRIO_NORM,
    read_buf + data->fifo_total_bytes,
    SAMPLE_SIZE, current_sqe);
  • LSM6DSV:
    rtio_sqe_prep_tiny_write(write_fifo_dout_addr, iodev, RTIO_PRIO_NORM, &reg, 1, NULL);
    write_fifo_dout_addr->flags = RTIO_SQE_TRANSACTION;
    rtio_sqe_prep_read(read_fifo_dout_reg, iodev, RTIO_PRIO_NORM,
    read_buf, buf_avail, lsm6dsv16x->streaming_sqe);

Additional context

A similar fix was already applied to i2c_rtio_default: #79890.

Metadata

Metadata

Assignees

Labels

area: RTIOarea: SPISPI busbugThe issue is a bug, or the PR is fixing a bugpriority: lowLow impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions