[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <g6x4jAuAkaB51kwCXU4GlGyCGilkEvRhguvwfPkrA@cp3-web-024.plabs.ch>
Date: Mon, 16 Nov 2020 16:43:49 +0000
From: Alexander Lobakin <alobakin@...me>
To: Christoph Hellwig <hch@...radead.org>
Cc: Alexander Lobakin <alobakin@...me>,
Ohad Ben-Cohen <ohad@...ery.com>,
Mathieu Poirier <mathieu.poirier@...aro.org>,
Arnd Bergmann <arnd@...db.de>, Amit Shah <amit@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Arnaud Pouliquen <arnaud.pouliquen@...com>,
linux-kernel@...r.kernel.org, stable@...r.kernel.org,
Bjorn Andersson <bjorn.andersson@...aro.org>,
linux-remoteproc@...r.kernel.org, Suman Anna <s-anna@...com>,
"Michael S. Tsirkin" <mst@...hat.com>,
virtualization@...ts.linux-foundation.org
Subject: Re: [PATCH virtio] virtio: virtio_console: fix DMA memory allocation for rproc serial
From: Christoph Hellwig <hch@...radead.org>
Date: Mon, 16 Nov 2020 16:27:44 +0000
> On Mon, Nov 16, 2020 at 04:51:49AM -0500, Michael S. Tsirkin wrote:
>> On Mon, Nov 16, 2020 at 09:19:50AM +0000, Christoph Hellwig wrote:
>>> I just noticed this showing up in Linus' tree and I'm not happy.
>>>
>>> This whole model of the DMA subdevices in remoteproc is simply broken.
>>>
>>> We really need to change the virtio code pass an expicit DMA device (
>>> similar to what e.g. the USB and RDMA code does),
>>
>> Could you point me at an example or two please?
>
> Take a look at the ib_dma_* helper in include/rdma/ib_verbs.h and
> dma_device member in struct ib_device for the best example.
Oh, best example indeed. I did really love these helpers and kinda
wish there were such for Ethernet and wireless networking. They'd
allow to keep the code more readable and clean and prevent from
several sorts of silly mistakes.
This could be done in e.g. 4 steps:
- introduce such helpers for netdev/mac80211;
- add checkpatch warnings to discourage usage of old methods like
SET_NETDEV_DEV() and direct dereferencing of netdev->dev.parent;
- slowly convert existing drivers to the new model;
- remove the old way entirely along with checkpatch remnants.
I could take this if there'll be enough votes :)
Al
Powered by blists - more mailing lists