Skip to content

Conversation

@pelwell
Copy link
Contributor

@pelwell pelwell commented Oct 14, 2025

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

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>
@pelwell
Copy link
Contributor Author

pelwell commented Oct 16, 2025

Users of RP1 DMA are few and far between, but I've tested this to my satisfaction, so merging.

@pelwell pelwell merged commit 33a79f1 into raspberrypi:rpi-6.12.y Oct 16, 2025
12 checks passed
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
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.

1 participant