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: <20241127-defer-dma-request-chan-v1-1-203db7baf470@redhat.com>
Date: Wed, 27 Nov 2024 09:23:51 +0100
From: Enric Balletbo i Serra <eballetb@...hat.com>
To: Vinod Koul <vkoul@...nel.org>
Cc: dmaengine@...r.kernel.org, linux-kernel@...r.kernel.org, 
 linux-arm-kernel@...ts.infradead.org, u-kumar1@...com, vigneshr@...com, 
 nm@...com, Enric Balletbo i Serra <eballetb@...hat.com>
Subject: [PATCH] dmaengine: dma_request_chan_by_mask() defer probing
 unconditionally

Having no DMA devices registered is not a guarantee that the device
doesn't exist, it could be that is not registered yet, so return
EPROBE_DEFER unconditionally so the caller can wait for the required
DMA device registered.

Signed-off-by: Enric Balletbo i Serra <eballetb@...hat.com>
---
This patch fixes the following error on TI AM69-SK

[    2.854501] cadence-qspi 47040000.spi: error -ENODEV: No Rx DMA available

The DMA device is probed after cadence-qspi driver, so deferring it
solves the problem.
---
 drivers/dma/dmaengine.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
index c1357d7f3dc6ca7899c4d68a039567e73b0f089d..57f07b477a5d9ad8f2656584b8c0d6dffb2ab469 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -889,10 +889,10 @@ struct dma_chan *dma_request_chan_by_mask(const dma_cap_mask_t *mask)
 	chan = __dma_request_channel(mask, NULL, NULL, NULL);
 	if (!chan) {
 		mutex_lock(&dma_list_mutex);
-		if (list_empty(&dma_device_list))
-			chan = ERR_PTR(-EPROBE_DEFER);
-		else
-			chan = ERR_PTR(-ENODEV);
+		/* If the required DMA device is not registered yet,
+		 * return EPROBE_DEFER
+		 */
+		chan = ERR_PTR(-EPROBE_DEFER);
 		mutex_unlock(&dma_list_mutex);
 	}
 

---
base-commit: 43fb83c17ba2d63dfb798f0be7453ed55ca3f9c2
change-id: 20241127-defer-dma-request-chan-4f26c62c8691

Best regards,
-- 
Enric Balletbo i Serra <eballetb@...hat.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ