linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jonathan.cameron@huawei.com>
To: zhangfei <zhangfei.gao@linaro.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Arnd Bergmann <arnd@arndb.de>, Zaibo Xu <xuzaibo@huawei.com>,
	<linux-kernel@vger.kernel.org>,
	Zhou Wang <wangzhou1@hisilicon.com>,
	"Kenneth Lee" <liguozhu@hisilicon.com>,
	<linux-accelerators@lists.ozlabs.org>
Subject: Re: [PATCH 2/2] uacce: add uacce module
Date: Fri, 23 Aug 2019 17:36:03 +0100	[thread overview]
Message-ID: <20190823173603.00001b3d@huawei.com> (raw)
In-Reply-To: <b5d9fe84-abfd-c8ca-d059-e186e1609e06@linaro.org>

On Fri, 23 Aug 2019 17:21:33 +0800
zhangfei <zhangfei.gao@linaro.org> wrote:

> Hi, Jonathan
Hi zhangfei,

> 
> Thanks for your careful review and good suggestion.
> Sorry for late response, I am checking one detail.

I have reviews on patches from years ago that I still haven't replied to ;)

> 
> On 2019/8/16 上午12:54, Jonathan Cameron wrote:
> > On Wed, 14 Aug 2019 17:34:25 +0800
> > Zhangfei Gao <zhangfei.gao@linaro.org> wrote:
> >  
> >> From: Kenneth Lee <liguozhu@hisilicon.com>
> >>
> >> Uacce is the kernel component to support WarpDrive accelerator
> >> framework. It provides register/unregister interface for device drivers
> >> to expose their hardware resource to the user space. The resource is
> >> taken as "queue" in WarpDrive.  
> > It's a bit confusing to have both the term UACCE and WarpDrive in here.
> > I'd just use the uacce name in all comments etc.  
> Yes, make sense
> >  
> >> Uacce create a chrdev for every registration, the queue is allocated to
> >> the process when the chrdev is opened. Then the process can access the
> >> hardware resource by interact with the queue file. By mmap the queue
> >> file space to user space, the process can directly put requests to the
> >> hardware without syscall to the kernel space.
> >>
> >> Uacce also manages unify addresses between the hardware and user space
> >> of the process. So they can share the same virtual address in the
> >> communication.
> >>
> >> Signed-off-by: Kenneth Lee <liguozhu@hisilicon.com>
> >> Signed-off-by: Zaibo Xu <xuzaibo@huawei.com>
> >> Signed-off-by: Zhou Wang <wangzhou1@hisilicon.com>
> >> Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>  
> > I would strip this back to which ever case is of most interest (SVA I guess?)
> > and only think about adding support for the others if necessary at a later date.
> > (or in later patches).  
> Do you mean split the patch and send sva part first?

Either:
1) SVA only in the first series, second series can do other options.
2) Patch N for SVA only, N+1... for other features.

I don't mind which, but I want to be able to see just one case and
review that before taking into account the affect of the more complex cases.


> >> +
> >> +static int uacce_qfr_alloc_pages(struct uacce_qfile_region *qfr)
> >> +{
> >> +	int gfp_mask = GFP_ATOMIC | __GFP_ZERO;  
> > More readable to just have this inline.  
> Yes, all right.
> >  
> >> +	int i, j;
> >> +
...

> >> +static int uacce_set_iommu_domain(struct uacce *uacce)
> >> +{
> >> +	struct iommu_domain *domain;
> >> +	struct iommu_group *group;
> >> +	struct device *dev = uacce->pdev;
> >> +	bool resv_msi;
> >> +	phys_addr_t resv_msi_base = 0;
> >> +	int ret;
> >> +
> >> +	if ((uacce->flags & UACCE_DEV_NOIOMMU) ||
> >> +	    (uacce->flags & UACCE_DEV_PASID))
> >> +		return 0;
> >> +
> >> +	/*
> >> +	 * We don't support multiple register for the same dev in RFC version ,
> >> +	 * will add it in formal version  
> > So this effectively multiple complete uacce interfaces for one device.
> > Is there a known usecase for that?  
> Here is preventing one device with multiple algorithm and register 
> multi-times,
> and without sva, they can not be distinguished.

Isn't that a bug in the device driver?

> >> +	 */
> >> +	ret = class_for_each_device(uacce_class, NULL, uacce->pdev,
> >> +				    uacce_dev_match);
> >> +	if (ret)
> >> +		return ret;
> >> +
> >> +	/* allocate and attach a unmanged domain */

...



  reply	other threads:[~2019-08-23 16:36 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-14  9:34 [PATCH 0/2] A General Accelerator Framework, WarpDrive Zhangfei Gao
2019-08-14  9:34 ` [PATCH 1/2] uacce: Add documents for WarpDrive/uacce Zhangfei Gao
2019-08-14  9:34 ` [PATCH 2/2] uacce: add uacce module Zhangfei Gao
2019-08-15 14:12   ` Greg Kroah-Hartman
     [not found]     ` <5d5a6757.1c69fb81.e0678.2ab2SMTPIN_ADDED_BROKEN@mx.google.com>
2019-08-19 10:22       ` Greg Kroah-Hartman
2019-08-20 12:38         ` zhangfei
2019-08-20 14:31           ` Greg Kroah-Hartman
2019-08-15 14:13   ` Greg Kroah-Hartman
2019-08-20 13:08     ` zhangfei
2019-08-20 16:59       ` Greg Kroah-Hartman
     [not found]         ` <5d5cf0fc.1c69fb81.ec57f.b853SMTPIN_ADDED_BROKEN@mx.google.com>
2019-08-21  9:17           ` Greg Kroah-Hartman
2019-08-21 14:30             ` zhangfei
2019-08-21 16:05               ` Greg Kroah-Hartman
2019-08-26  4:10                 ` Kenneth Lee
2019-08-26  4:29                   ` Greg Kroah-Hartman
2019-08-27 11:42                     ` Kenneth Lee
2019-08-27 18:48                       ` Greg Kroah-Hartman
2019-08-15 14:20   ` Greg Kroah-Hartman
     [not found]     ` <5d5a6f5b.1c69fb81.9d35e.5303SMTPIN_ADDED_BROKEN@mx.google.com>
2019-08-19 10:24       ` Greg Kroah-Hartman
2019-08-20 12:36         ` zhangfei
2019-08-20 14:33           ` Greg Kroah-Hartman
2019-08-24 12:53             ` zhangfei
2019-08-24 15:40               ` Greg Kroah-Hartman
2019-08-15 16:54   ` Jonathan Cameron
2019-08-23  9:21     ` zhangfei
2019-08-23 16:36       ` Jonathan Cameron [this message]
2019-08-23 16:42       ` Jonathan Cameron
2019-08-15 17:04 ` [PATCH 0/2] A General Accelerator Framework, WarpDrive Jerome Glisse
2019-08-20 14:26   ` zhangfei
2019-08-26  4:14   ` Kenneth Lee

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=20190823173603.00001b3d@huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=liguozhu@hisilicon.com \
    --cc=linux-accelerators@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wangzhou1@hisilicon.com \
    --cc=xuzaibo@huawei.com \
    --cc=zhangfei.gao@linaro.org \
    /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).