lkml.org 
[lkml]   [2020]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH 1/5] misc: vop: change the way of allocating vring for noncoherent platform
Date
Hi Christoph,

> > +#include <linux/dma-noncoherent.h>
>
> This header must not be included in drivers.
>
> >
> > + if (dev_is_dma_coherent(vop_dev(vdev)))
>
> And this API must not be used in drivers either.

Thanks for your reply.
Can you explain why we cannot use the API and header above in drivers?
And do you know if there are any APIs that could replace this to check the device hardware dma coherent support?

>
> > + vdev->vvr[i].vrh.vring.used =
> > + (void __force *)vpdev->hw_ops->remap(
>
> And you must not use __force casts without a comment explanation why
> they are safe.

Here is the original code, I moved the original code into the if() without change it.
But I think this is because vpdev->hw_ops->remap() return type is void __iomem *, but vring.used need type void *.
Maybe this is a workaround for Intel MIC platform, as it reassigns the used ring on the EP side.

Regards
Sherry

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