lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20251210193011.567210-2-stavinsky@gmail.com>
Date: Wed, 10 Dec 2025 23:30:12 +0400
From: "Anton D. Stavinskii" <stavinsky@...il.com>
To: Vinod Koul <vkoul@...nel.org>
Cc: dmaengine@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	inochiama@...il.com,
	"Anton D. Stavinskii" <stavinsky@...il.com>
Subject: [PATCH] dmaengine: cv1800b-dmamux: fix channel allocation order

The dmamux builds the free_maps list using llist_add(), which inserts
new nodes at the head. Using increasing channel indices causes the
first allocation to use DMA channel 7 while the DMA engine hands out
channel 0, leading to mismatched routing.

Reverse the channel index order so the first allocation gets channel 0.

Fixes: db7d07b5add4d ("dmaengine: add driver for Sophgo CV18XX/SG200X dmamux")
Signed-off-by: Anton D. Stavinskii <stavinsky@...il.com>
---
 drivers/dma/cv1800b-dmamux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/cv1800b-dmamux.c b/drivers/dma/cv1800b-dmamux.c
index e900d6595617..825e1614051d 100644
--- a/drivers/dma/cv1800b-dmamux.c
+++ b/drivers/dma/cv1800b-dmamux.c
@@ -214,7 +214,7 @@ static int cv1800_dmamux_probe(struct platform_device *pdev)
 		}
 
 		init_llist_node(&tmp->node);
-		tmp->channel = i;
+		tmp->channel = MAX_DMA_CH_ID - i;
 		llist_add(&tmp->node, &data->free_maps);
 	}
 
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ