Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp6397029ybp; Tue, 15 Oct 2019 14:25:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQ9lT/DuPBirVWGdc3UMTgSuriYh0TGJRcwuuRwHDzXxtcpKhoQcYyPN+54p4WTKfzU15k X-Received: by 2002:a50:af44:: with SMTP id g62mr36035408edd.164.1571174726583; Tue, 15 Oct 2019 14:25:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571174726; cv=none; d=google.com; s=arc-20160816; b=y9p9oXYb6oNFvu1aUawfmoI992l6rsNsl9xfAPfpSBSimZ8Mqf2pJ9GtjD8vXVqVln 8cKnwq3VeA5Xn9KxqzCXxhPdm2jKY2k5UittDbFlS1bFzCyvF14P8NvS8er8t045RxqN +9dLDd33waUVqxYxwyiWCv6SEayNquDerPfrZChfCU2XHmUlwK5GYI/mHxLCZ0N1JBZf jgqzzkMAhzWJg+/At38LgzDjxWngArxMcyDFz0jEfecS2NUQn2GMgnZYah+HjNHCza8s dxDG4LpLCpe36onTIwL+Oy6zcm9F2cPoowwd+8EFi9qwwPeOnucKKn+R0eNBOohqFo5y 9jsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=rX+UizjU3dhbTn4ZHB0Bi3Lj7LGARkICU6GDWo2iFsY=; b=PR1rfF/jPA4+fUAzTbpZ9AnWWbz7rEXp8c6WDdobrxLuZFv13Mke1UrV6dqC+41B5I TDrD8Aa0HCaLiEOLBNx7KamTErWlgWaizkDSqkoqYMXdNOCPHP4NVxhfcidVLKH+X2Ka 3+t2y0k9tnQ2kXyu7Ioq9i+NHUKf2sVDWaPR1cBk5IFgzD5M1ZFDzgClG42K1NitwFLA c2NYDHzr4VFURyALNb2Tr27yqWcTtYKMAnQVi2qcBwDgCtNfhAoqjMPLSK2aRwhBC7Bt xM7J3sNCdAYrkRBcCOj8Yp97x/Qn81oO5Vzmn69wmhjMxEFpustwGb5gyAoNZRPfQpoC rDXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yAT3GUSA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u17si13071471edy.145.2019.10.15.14.25.02; Tue, 15 Oct 2019 14:25:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yAT3GUSA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389044AbfJOSId (ORCPT + 99 others); Tue, 15 Oct 2019 14:08:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:39934 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725820AbfJOSId (ORCPT ); Tue, 15 Oct 2019 14:08:33 -0400 Received: from localhost (unknown [38.98.37.135]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 81CBB2086A; Tue, 15 Oct 2019 18:08:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571162912; bh=2vnG9zvitjyN5YRzL5mKaObhzjkQF1sodt7gWZ0dIcY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=yAT3GUSAolCquTvf0Pp53cAn87OGSGsmXvt3fY4x0HaTP066nxrMrhNi7XLAlokKE NWsDhq+FLeSto9SRMOpINc6fpIPqogRq0L018DXZmvmzfgy4z30ezv6OJoGgL3JTax /P2UHzW5dXogVigVJRFOU5dlh8rj9MaA1vY2KC/Q= Date: Tue, 15 Oct 2019 19:55:55 +0200 From: reg Kroah-Hartman To: zhangfei Cc: Jonathan Cameron , Arnd Bergmann , grant.likely@arm.com, jean-philippe , ilias.apalodimas@linaro.org, francois.ozog@linaro.org, kenneth-lee-2012@foxmail.com, Wangzhou , linux-accelerators@lists.ozlabs.org, linux-kernel@vger.kernel.org, Kenneth Lee , Zaibo Xu Subject: Re: [PATCH v5 2/3] uacce: add uacce driver Message-ID: <20191015175555.GB1072965@kroah.com> References: <1571035735-31882-1-git-send-email-zhangfei.gao@linaro.org> <1571035735-31882-3-git-send-email-zhangfei.gao@linaro.org> <20191014113231.00002967@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 15, 2019 at 03:39:00PM +0800, zhangfei wrote: > Hi, Jonathan > > On 2019/10/14 下午6:32, Jonathan Cameron wrote: > > On Mon, 14 Oct 2019 14:48:54 +0800 > > Zhangfei Gao wrote: > > > > > From: Kenneth Lee > > > > > > Uacce (Unified/User-space-access-intended Accelerator Framework) targets to > > > provide Shared Virtual Addressing (SVA) between accelerators and processes. > > > So accelerator can access any data structure of the main cpu. > > > This differs from the data sharing between cpu and io device, which share > > > data content rather than address. > > > Since unified address, hardware and user space of process can share the > > > same virtual address in the communication. > > > > > > 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. > > > > > > Signed-off-by: Kenneth Lee > > > Signed-off-by: Zaibo Xu > > > Signed-off-by: Zhou Wang > > > Signed-off-by: Zhangfei Gao > > Hi, > > > > Some superficial comments from me. > Thanks for the suggestion. > > > +/* > > > + * While user space releases a queue, all the relatives on the queue > > > + * should be released immediately by this putting. > > This one needs rewording but I'm not quite sure what > > relatives are in this case. > > > + */ > > > +static long uacce_put_queue(struct uacce_queue *q) > > > +{ > > > + struct uacce_device *uacce = q->uacce; > > > + > > > + mutex_lock(&uacce_mutex); > > > + > > > + if ((q->state == UACCE_Q_STARTED) && uacce->ops->stop_queue) > > > + uacce->ops->stop_queue(q); > > > + > > > + if ((q->state == UACCE_Q_INIT || q->state == UACCE_Q_STARTED) && > > > + uacce->ops->put_queue) > > > + uacce->ops->put_queue(q); > > > + > > > + q->state = UACCE_Q_ZOMBIE; > > > + mutex_unlock(&uacce_mutex); > > > + > > > + return 0; > > > +} > > > + > > .. > > > > > + > > > +static ssize_t qfrs_size_show(struct device *dev, > > > + struct device_attribute *attr, char *buf) > > > +{ > > > + struct uacce_device *uacce = to_uacce_device(dev); > > > + unsigned long size; > > > + int i, ret; > > > + > > > + for (i = 0, ret = 0; i < UACCE_QFRT_MAX; i++) { > > > + size = uacce->qf_pg_size[i] << PAGE_SHIFT; > > > + if (i == UACCE_QFRT_SS) > > > + break; > > > + ret += sprintf(buf + ret, "%lu\t", size); > > > + } > > > + ret += sprintf(buf + ret, "%lu\n", size); > > > + > > > + return ret; > > > +} > > This may break the sysfs rule of one thing per file. If you have > > multiple regions, they should probably each have their own file > > to give their size. > Is the rule must be applied? Yes, it always must be followed. Please fix.