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>] [thread-next>] [day] [month] [year] [list]
Message-ID: <291807c9-8d1c-56f0-ee39-4d221e18bd1a@ti.com>
Date:   Wed, 19 Apr 2023 13:57:02 +0530
From:   Vaishnav Achath <vaishnav.a@...com>
To:     <dmaengine@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <vkoul@...nel.org>,
        Péter Ujfalusi <peter.ujfalusi@...il.com>
CC:     Vignesh Raghavendra <vigneshr@...com>,
        "J, KEERTHY" <j-keerthy@...com>, <u-kumar1@...com>,
        Jayesh Choudhary <j-choudhary@...com>,
        "Menon, Nishanth" <nm@...com>
Subject: Question: dmaengine: dma_request_chan_by_mask() and DMA controller
 probe order

Hi,

In dma_request_chan_by_mask() , the probe defer logic returns -EPROBE_DEFER if
there are no DMA devices registered yet. But in case of multiple DMA controllers
in an SoC and when only one(or a subset) of the controllers have finished probe
dma_request_chan_by_mask() can return -ENODEV incorrectly since the first DMA
device probed might not support the particular mask requested.

What is the recommended solution to avoid situation like these?

Consider the following scenario for example:

SoC has two DMA controllers, one instance of system DMA, one dedicated for
Camera subsytem which does not support DMA_MEMCPY and has lesser number of channels.

* Camera subsystem DMA is probed first.
* Another peripheral requests dma_request_chan_by_mask(DMA_MEMCPY)
* dmaengine returns -ENODEV for above as the controller with DMA_MEMCPY support
is not ready yet.
* System DMA is probed later but peripheral driver failed to start with DMA.

-- 
Thanks and Regards,
Vaishnav

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ