lkml.org 
[lkml]   [2020]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH 4/5] misc: vop: set VIRTIO_F_ACCESS_PLATFORM for nocoherent platform
Date
Hi Greg,

> -----Original Message-----
> From: Greg KH <gregkh@linuxfoundation.org>
> Sent: 2020年9月25日 20:17
> To: Sherry Sun <sherry.sun@nxp.com>
> Cc: sudeep.dutt@intel.com; ashutosh.dixit@intel.com; arnd@arndb.de;
> wang.yi59@zte.com.cn; huang.zijiang@zte.com.cn;
> rikard.falkeborn@gmail.com; lee.jones@linaro.org; mst@redhat.com; linux-
> kernel@vger.kernel.org; dl-linux-imx <linux-imx@nxp.com>
> Subject: Re: [PATCH 4/5] misc: vop: set VIRTIO_F_ACCESS_PLATFORM for
> nocoherent platform
>
> On Fri, Sep 25, 2020 at 03:26:29PM +0800, Sherry Sun wrote:
> > Set VIRTIO_F_ACCESS_PLATFORM feature for nocoherent platform, since it
> > needs the DMA API for virtio.
> >
> > Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
> > Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
> > ---
> > drivers/misc/mic/vop/vop_main.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/misc/mic/vop/vop_main.c
> > b/drivers/misc/mic/vop/vop_main.c index d3645122c983..d609f0dc6124
> > 100644
> > --- a/drivers/misc/mic/vop/vop_main.c
> > +++ b/drivers/misc/mic/vop/vop_main.c
> > @@ -125,6 +125,9 @@ static void vop_transport_features(struct
> virtio_device *vdev)
> > * creates virtio rings on preallocated memory.
> > */
> > __virtio_clear_bit(vdev, VIRTIO_F_RING_PACKED);
> > +
> > + if (!dev_is_dma_coherent(vdev->dev.parent))
> > + __virtio_set_bit(vdev, VIRTIO_F_ACCESS_PLATFORM);
>
> Why look at the parent and not the device itself?

That's a good question, here use vdev->dev.parent to get the vop device instead of virtio device, which can keep consistent with other dev_is_dma_coherent check.

Thanks
Sherry
\
 
 \ /
  Last update: 2020-09-27 09:20    [W:0.139 / U:7.920 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site