Improve the RP1 DMA channel allocation scheme#7089
Merged
pelwell merged 3 commits intoraspberrypi:rpi-6.12.yfrom Oct 16, 2025
Merged
Improve the RP1 DMA channel allocation scheme#7089pelwell merged 3 commits intoraspberrypi:rpi-6.12.yfrom
pelwell merged 3 commits intoraspberrypi:rpi-6.12.yfrom
Conversation
Simplify and improve the channel selection scheme by removing the concept of excluded channels. Requesting more channels than are available is a configuration error, but otherwise it is better to get a non-ideal channel than no channel at all. Give each channel a score based on how well it matches the client's requirements, then attempt to claim them in order of decreasing score. A channel which possesses a required flag is scored more highly than one that doesn't, but not having a trait that isn't wanted also contributes to a channel's score, just less so. By walking the list until the end, even channels that don't match at all will be allocated if there is enough demand. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Use the simplified channel property declaration scheme, where the DMA driver finds the best match based on positive matches with no hard exclusions. N.B. The new scheme should give the same results with old and new DTB, with the old property name still be accepted for backwards-compatibility. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Although the PIO throughput benefits from larger burst sizes, only the first two DMA channels support a burst size of 8 - the others are capped at 4. To avoid misconfiguring the PIO hardware, retrieve the actual max_burst value from the DMA channel's capabilities. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Contributor
Author
|
Users of RP1 DMA are few and far between, but I've tested this to my satisfaction, so merging. |
popcornmix
added a commit
to raspberrypi/rpi-firmware
that referenced
this pull request
Oct 17, 2025
kernel: Add config settings and i2c-sensor support for the TMP117 See: raspberrypi/linux#7083 kernel: Upstream patches for TC358743 colour swap See: raspberrypi/linux#7070 kernel: media: ov9282: Add external trigger mode support See: raspberrypi/linux#6954 kernel: Improve the RP1 DMA channel allocation scheme See: raspberrypi/linux#7089
popcornmix
added a commit
to raspberrypi/firmware
that referenced
this pull request
Oct 17, 2025
kernel: Add config settings and i2c-sensor support for the TMP117 See: raspberrypi/linux#7083 kernel: Upstream patches for TC358743 colour swap See: raspberrypi/linux#7070 kernel: media: ov9282: Add external trigger mode support See: raspberrypi/linux#6954 kernel: Improve the RP1 DMA channel allocation scheme See: raspberrypi/linux#7089
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.
As well as being bugged (#7078), the previous RP1 DMA channel allocation scheme would not make optimal use of the channels in the event that many were required. The new scheme gives each channel a score as to how well it matches the client's requirements, but when availability is low even low-scoring channels are eventually allocated.
Despite the improved functionality, the DT declaration is simpler. The driver should also behave the same with old-style DTBs.
See: #7078