[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250414212125.4b3e6f33@windsurf>
Date: Mon, 14 Apr 2025 21:21:25 +0200
From: Thomas Petazzoni <thomas.petazzoni@...tlin.com>
To: Andrew Davis <afd@...com>
Cc: Christoph Hellwig <hch@...radead.org>, Bastien Curutchet
<bastien.curutchet@...tlin.com>, Sumit Semwal <sumit.semwal@...aro.org>,
Christian König <christian.koenig@....com>, Greg
Kroah-Hartman <gregkh@...uxfoundation.org>, <linux-media@...r.kernel.org>,
<dri-devel@...ts.freedesktop.org>, <linaro-mm-sig@...ts.linaro.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 0/3] uio/dma-buf: Give UIO users access to DMA
addresses.
Hello Andrew,
On Mon, 14 Apr 2025 12:08:44 -0500
Andrew Davis <afd@...com> wrote:
> "UIO is a broken legacy mess, so let's add more broken things
> to it as broken + broken => still broken, so no harm done", am I
> getting that right?
Who says UIO is a "broken legacy mess"? Only you says so. I don't see
any indication anywhere in the kernel tree suggesting that UIO is
considered a broken legacy mess.
Keep in mind that when you're running code as root, you can load a
kernel module, which can do anything on the system security-wise. So
letting UIO expose MMIO registers of devices to userspace applications
running as root is not any worse than that.
> If your FPGA IP can do DMA then you should not be using UIO in
> the first place, see UIO docs:
>
> > Please note that UIO is not an universal driver interface. Devices that
> > are already handled well by other kernel subsystems (like networking or
> > serial or USB) are no candidates for an UIO driver.
>
> The DMA subsystem already handles DMA devices, so write a DMA driver.
My FPGA IP block is not a DMA controller that would fit the dmaengine
kernel subsystem. It's a weird custom device that doesn't fit in any
existing subsystem, and that happens to do "peripheral DMA" (i.e the IP
block is DMA-capable itself, without relying on a separate DMA
controller). So this (very valid) recommendation from the UIO
documentation doesn't apply to my device.
Best regards,
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
Powered by blists - more mailing lists