linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sherry Sun <sherry.sun@nxp.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: "sudeep.dutt@intel.com" <sudeep.dutt@intel.com>,
	"ashutosh.dixit@intel.com" <ashutosh.dixit@intel.com>,
	"arnd@arndb.de" <arnd@arndb.de>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"wang.yi59@zte.com.cn" <wang.yi59@zte.com.cn>,
	"huang.zijiang@zte.com.cn" <huang.zijiang@zte.com.cn>,
	"rikard.falkeborn@gmail.com" <rikard.falkeborn@gmail.com>,
	"lee.jones@linaro.org" <lee.jones@linaro.org>,
	"mst@redhat.com" <mst@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>
Subject: RE: [PATCH 1/5] misc: vop: change the way of allocating vring for noncoherent platform
Date: Sun, 27 Sep 2020 07:58:29 +0000	[thread overview]
Message-ID: <VI1PR04MB4960DC1E64D65634FE76C7AA92340@VI1PR04MB4960.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20200926075015.GA18592@infradead.org>

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

  reply	other threads:[~2020-09-27  7:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-25  7:26 [PATCH 0/5] Add noncoherent platform support for vop driver Sherry Sun
2020-09-25  7:26 ` [PATCH 1/5] misc: vop: change the way of allocating vring for noncoherent platform Sherry Sun
2020-09-25 12:16   ` Greg KH
2020-09-27  7:06     ` Sherry Sun
2020-09-26  7:50   ` Christoph Hellwig
2020-09-27  7:58     ` Sherry Sun [this message]
2020-09-28  6:09       ` Christoph Hellwig
2020-09-28 10:10         ` Sherry Sun
2020-09-25  7:26 ` [PATCH 2/5] misc: vop: change the way of allocating used ring Sherry Sun
2020-09-25  7:26 ` [PATCH 3/5] misc: vop: simply return the saved dma address instead of virt_to_phys Sherry Sun
2020-09-25 12:17   ` Greg KH
2020-09-27  7:23     ` Sherry Sun
2020-09-25  7:26 ` [PATCH 4/5] misc: vop: set VIRTIO_F_ACCESS_PLATFORM for nocoherent platform Sherry Sun
2020-09-25 12:16   ` Greg KH
2020-09-27  7:20     ` Sherry Sun
2020-09-26  7:51   ` Christoph Hellwig
2020-09-27  8:05     ` Sherry Sun
2020-09-28  6:09       ` Christoph Hellwig
2020-09-28  9:57         ` Sherry Sun
2020-09-25  7:26 ` [PATCH 5/5] misc: vop: mapping kernel memory to user space as noncached Sherry Sun
2020-09-25 11:25 ` [PATCH 0/5] Add noncoherent platform support for vop driver Arnd Bergmann
2020-09-27  5:07   ` Sherry Sun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=VI1PR04MB4960DC1E64D65634FE76C7AA92340@VI1PR04MB4960.eurprd04.prod.outlook.com \
    --to=sherry.sun@nxp.com \
    --cc=arnd@arndb.de \
    --cc=ashutosh.dixit@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@infradead.org \
    --cc=huang.zijiang@zte.com.cn \
    --cc=lee.jones@linaro.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=rikard.falkeborn@gmail.com \
    --cc=sudeep.dutt@intel.com \
    --cc=wang.yi59@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).