virtio-spi message boundaries

Jakub Jermář <[email protected]> Mon, 28 Jul 2025 11:39:10 +0200
Newsgroups dev.linux.lists.virtio-dev
Message-ID <[email protected]>
Hello,

the current virtio-spi draft mentions the concept of SPI messages in
several places, for example:

  cs_change_supported indicates if the device supports to toggle
  chipselect after each transfer in one message: 0: unsupported,
  chipselect will be kept in active state throughout the message
  transaction; 1: supported.
  Note: Message here contains a sequence of SPI transfers.

and also:

  Note: Just as one message contains a sequence of transfers, one
  transfer may contain a sequence of words.

These wordings appeared in the virtio-spi device specification patch v5
and have remained in the specification draft ever since. I was, however,
unable to find any discussion that preceded their introduction into the
spec (as far as the concept of messages themselves is concerned).

Now, I was wondering how does the virtio-spi device figure out which SPI
transfers belong to the same SPI message. SPI messages are important
wrt. to correct toggling of the chip select line but the spec is quite
vague on how to find their boundaries.

I could imagine, for example, that an SPI message is formed by chaining
the respective virtio-spi transfers of a message together so that a
message is determined by the head descriptor of the first transfer. But
this is not stated anywhere. I was hoping to be able to infer this from
the proposed virtio-spi Linux driver, but it does not seem to handle
messages at all in its latest version.

Has anyone figured this out already?

Cheers,
Jakub