Re: [PATCH virtio] virtio: virtio_console: fix DMA memory allocation for rproc serial
From: Christoph Hellwig
Date: Mon Nov 16 2020 - 11:30:34 EST
On Mon, Nov 16, 2020 at 01:07:28PM +0000, Alexander Lobakin wrote:
> But lots of subsystems like netdev for example uses dev->parent for
> DMA operations. I know that their pointers go directly to the
> platform/PCI/etc. device, but still.
Oh, every drivers is perfectly fine to use ->parent as it suits. The
problem is when we have layered architectures, where this pokes a
massive hole into the layering.
> The only reason behind "fake" DMA devices for rproc is to be able to
> reserve DMA memory through the Device Tree exclusively for only one
> virtio dev like virtio_console or virtio_rpmsg_bus. That's why
> they are present, are coercing DMA caps from physical dev
> representor, and why questinable dma_declare_coherent_memory()
> is still here and doesn't allow to build rproc core as a module.
> I agree that this is not the best model obviously, and we should take
> a look at it.
As far as I can tell the series from Arnaud does the right thing here.