spi: dw: Wait for idle after TX#6646
Merged
pelwell merged 1 commit intoraspberrypi:rpi-6.6.yfrom Feb 4, 2025
Merged
Conversation
Contributor
Author
|
Updated with a more complete solution, which needs retesting in its current form. Restructuring |
If this is a DMA transfer, and if there is no simultaneous RX transfer, wait for the interface to go idle before reporting that TX is done. Link: https://forums.raspberrypi.com/viewtopic.php?t=383027 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Contributor
|
The maximum time between the tx_busy check passing (==txfifo empty) and the SR_BUSY check passing is one complete wordsize. I think the cpu_relax() should be another invocation of spi_delay_exec() but with delay.value set to just n_bytes * BITS_PER_BYTE - in the case where you have a slow SPI SCLK and a large wordsize, the driver could be spinning for a nontrivial amount of time. |
popcornmix
added a commit
to raspberrypi/firmware
that referenced
this pull request
Feb 4, 2025
See: raspberrypi/linux#6636 kernel: misc: rp1-pio: SM_CONFIG_XFER32 = larger DMA bufs See: raspberrypi/linux#6640 kernel: Handle probe dependencies and hard errors better See: raspberrypi/linux#6645 kernel: spi: dw: Wait for idle after TX See: raspberrypi/linux#6646 See: raspberrypi/linux#6649
popcornmix
added a commit
to raspberrypi/rpi-firmware
that referenced
this pull request
Feb 4, 2025
See: raspberrypi/linux#6636 kernel: misc: rp1-pio: SM_CONFIG_XFER32 = larger DMA bufs See: raspberrypi/linux#6640 kernel: Handle probe dependencies and hard errors better See: raspberrypi/linux#6645 kernel: spi: dw: Wait for idle after TX See: raspberrypi/linux#6646 See: raspberrypi/linux#6649
why-npc
pushed a commit
to why-npc/rpi-firmware
that referenced
this pull request
Feb 13, 2025
See: raspberrypi/linux#6636 kernel: misc: rp1-pio: SM_CONFIG_XFER32 = larger DMA bufs See: raspberrypi/linux#6640 kernel: Handle probe dependencies and hard errors better See: raspberrypi/linux#6645 kernel: spi: dw: Wait for idle after TX See: raspberrypi/linux#6646 See: raspberrypi/linux#6649
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is probably part 1 of a fix for TX only transfers. Part 2 is likely to change dw_spi_dma_transfer to not call dw_spi_wait_tx_done in the event that there is an RX buffer.
Link: https://forums.raspberrypi.com/viewtopic.php?t=383027