[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <81c5a532-468c-3316-83d2-b4fa027dbe0e@linaro.org>
Date: Tue, 25 Feb 2020 16:36:49 +0800
From: zhangfei <zhangfei.gao@...aro.org>
To: "Raj, Ashok" <ashok.raj@...ux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Arnd Bergmann <arnd@...db.de>,
Herbert Xu <herbert@...dor.apana.org.au>,
jonathan.cameron@...wei.com, dave.jiang@...el.com,
grant.likely@....com, jean-philippe <jean-philippe@...aro.org>,
Jerome Glisse <jglisse@...hat.com>,
ilias.apalodimas@...aro.org, francois.ozog@...aro.org,
kenneth-lee-2012@...mail.com, Wangzhou <wangzhou1@...ilicon.com>,
"haojian . zhuang" <haojian.zhuang@...aro.org>,
guodong.xu@...aro.org, linux-accelerators@...ts.ozlabs.org,
linux-kernel@...r.kernel.org, linux-crypto@...r.kernel.org,
iommu@...ts.linux-foundation.org,
Kenneth Lee <liguozhu@...ilicon.com>,
Zaibo Xu <xuzaibo@...wei.com>, Ashok Raj <ashok.raj@...el.com>
Subject: Re: [PATCH v12 2/4] uacce: add uacce driver
Hi, Raj
On 2020/2/25 上午2:22, Raj, Ashok wrote:
> Hi Kenneth,
>
> sorry for waking up late on this patchset.
>
> +
> +static int uacce_fops_open(struct inode *inode, struct file *filep)
> +{
> + struct uacce_mm *uacce_mm = NULL;
> + struct uacce_device *uacce;
> + struct uacce_queue *q;
> + int ret = 0;
> +
> + uacce = xa_load(&uacce_xa, iminor(inode));
> + if (!uacce)
> + return -ENODEV;
> +
> + q = kzalloc(sizeof(struct uacce_queue), GFP_KERNEL);
> + if (!q)
> + return -ENOMEM;
> +
> + mutex_lock(&uacce->mm_lock);
> + uacce_mm = uacce_mm_get(uacce, q, current->mm);
> I think having this at open time is a bit unnatural. Since when a process
> does fork, we do not inherit the PASID. Although it inherits the fd
> but cannot use the mmaped address in the child.
>
> If you move this to the mmap time, its more natural. The child could
> do a mmap() get a new PASID + mmio space to work with the hardware.
>
Thanks for the suggestion.
We will consider fork in the next step, may need some time.
Thanks
Powered by blists - more mailing lists