dmaengine: ste_dma40: Search all blocks for fixed logical channels

Fixed logical channel allocation scans physical channels in blocks
determined by the event-group layout. 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 multiple physical-channel
blocks can allocate fixed logical channels from the later blocks.

Fixes: 5cd326fd27 ("dmaengine/ste_dma40: allow fixed physical channel")
Reported-by: sashiko-bot@kernel.org
Closes: https://lore.kernel.org/dmaengine/20260819225008.5F9651F000E9@smtp.kernel.org/
Assisted-by: LLM
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20261006-dma40-fixes-v8-1-b0aadf804793@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
Linus Walleij 2026-10-06 00:40:17 +02:00 committed by Vinod Koul
parent 38d97b1122
commit 15728ab23d

View File

@ -2128,11 +2128,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(dmaengine_chan_dev(&d40c->chan),
"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))