Skip to content

Fix a bug in the Aspeed SPI driver to support full-duplex operations. - #603

Open
chander-nexthop wants to merge 1 commit into
sonic-net:masterfrom
nexthop-ai:chander.spi-driver-fix
Open

Fix a bug in the Aspeed SPI driver to support full-duplex operations.#603
chander-nexthop wants to merge 1 commit into
sonic-net:masterfrom
nexthop-ai:chander.spi-driver-fix

Conversation

@chander-nexthop

Copy link
Copy Markdown
Contributor

The aspeed-txrx controller only latched MISO during its TX loop when tx_buf == rx_buf, and otherwise issued a separate post-transfer ioread8_rep burst that returns zeros. spidev always hands the driver distinct tx/rx bounce buffers, so userspace SPI_IOC_MESSAGE full-duplex reads (e.g. the FPGA register bridge) always read back zeros.

Add patches-sonic/aspeed-spi-txrx-fix-full-duplex-capture.patch to capture RX during the TX loop whenever an rx buffer is present and restrict the separate read burst to pure reads, and register it in the series after aspeed-ast2700-support.patch. Behaviour is unchanged for write-only, read-only, and shared-buffer full-duplex (e.g. the TPM) transfers.

We have given this patch to Aspeed too and they have agreed to take it in their repository in a future release. Till that happens we will need this patch.

tx_buf == rx_buf, and otherwise issued a separate post-transfer
ioread8_rep burst that returns zeros. spidev always hands the driver
distinct tx/rx bounce buffers, so userspace SPI_IOC_MESSAGE full-duplex
reads (e.g. the FPGA register bridge) always read back zeros.

Add patches-sonic/aspeed-spi-txrx-fix-full-duplex-capture.patch to
capture RX during the TX loop whenever an rx buffer is present and
restrict the separate read burst to pure reads, and register it in the
series after aspeed-ast2700-support.patch. Behaviour is unchanged for
write-only, read-only, and shared-buffer full-duplex (e.g. the TPM)
transfers.

Signed-off-by: Chandrasekaran Swaminathan <chander@nexthop.ai>
@chander-nexthop
chander-nexthop requested a review from a team as a code owner July 27, 2026 07:14
@mssonicbld

Copy link
Copy Markdown

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants