[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190308153243.49a31e1e@x1.home>
Date: Fri, 8 Mar 2019 15:32:43 -0700
From: Alex Williamson <alex.williamson@...hat.com>
To: Parav Pandit <parav@...lanox.com>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
michal.lkml@...kovi.net, davem@...emloft.net,
gregkh@...uxfoundation.org, jiri@...lanox.com,
kwankhede@...dia.com, vuhuong@...lanox.com, yuvalav@...lanox.com,
jakub.kicinski@...ronome.com, kvm@...r.kernel.org
Subject: Re: [RFC net-next v1 1/3] vfio/mdev: Inherit dma masks of parent
device
On Fri, 8 Mar 2019 16:07:54 -0600
Parav Pandit <parav@...lanox.com> wrote:
> Inherit dma mask of parent device in child mdev devices, so that
> protocol stack can use right dma mask while doing dma mappings.
>
> Signed-off-by: Parav Pandit <parav@...lanox.com>
> ---
> drivers/vfio/mdev/mdev_core.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/vfio/mdev/mdev_core.c b/drivers/vfio/mdev/mdev_core.c
> index 0212f0e..9b8bdc9 100644
> --- a/drivers/vfio/mdev/mdev_core.c
> +++ b/drivers/vfio/mdev/mdev_core.c
> @@ -315,6 +315,10 @@ int mdev_device_create(struct kobject *kobj, struct device *dev, uuid_le uuid)
> mdev->dev.parent = dev;
> mdev->dev.bus = &mdev_bus_type;
> mdev->dev.release = mdev_device_release;
> + mdev->dev.dma_mask = dev->dma_mask;
> + mdev->dev.dma_parms = dev->dma_parms;
> + mdev->dev.coherent_dma_mask = dev->coherent_dma_mask;
> +
> dev_set_name(&mdev->dev, "%pUl", uuid.b);
>
> ret = device_register(&mdev->dev);
This seems like a rather large assumption and none of the existing mdev
drivers even make use of DMA ops. Why shouldn't this be done in
mdev_parent_ops.create? Thanks,
Alex
Powered by blists - more mailing lists