Fixed logical channel allocation scans physical channels in blocks of
eight. When the requested physical channel does not belong to the first
block, d40_allocate_channel() returns -EINVAL instead of checking later
blocks.
Skip nonmatching blocks so controllers with more than eight physical
channels can allocate fixed logical channels from the later blocks.
Fixes: 5cd326fd27da ("dmaengine/ste_dma40: allow fixed physical channel")
Reported-by: sashiko-bot@kernel.org
Closes: https://lore.kernel.org/dmaengine/20260819225008.5F9651F000E9@smtp.kernel.org/ (local)
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
---
drivers/dma/ste_dma40.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 9ba5e57a9923..e0f3f4ac0e3a 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -2111,11 +2111,8 @@ static int d40_allocate_channel(struct d40_chan *d40c, bool *first_phy_user)
if (d40c->dma_cfg.use_fixed_channel) {
i = d40c->dma_cfg.phy_channel;
- if ((i != phy_num) && (i != phy_num + 1)) {
- dev_err(chan2dev(d40c),
- "invalid fixed phy channel %d\n", i);
- return -EINVAL;
- }
+ if (i != phy_num && i != phy_num + 1)
+ continue;
if (d40_alloc_mask_set(&phys[i], is_src, event_line,
is_log, first_phy_user))
--
2.55.0