From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751446AbdLUGM2 (ORCPT ); Thu, 21 Dec 2017 01:12:28 -0500 Received: from mga07.intel.com ([134.134.136.100]:63887 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750782AbdLUGMY (ORCPT ); Thu, 21 Dec 2017 01:12:24 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,434,1508828400"; d="scan'208";a="188864802" Date: Thu, 21 Dec 2017 14:02:27 +0800 From: Wu Hao To: Alan Tull Cc: Moritz Fischer , linux-fpga@vger.kernel.org, linux-kernel , linux-api@vger.kernel.org, "Kang, Luwei" , "Zhang, Yi Z" , Enno Luebbers , Xiao Guangrong Subject: Re: [PATCH v3 01/21] docs: fpga: add a document for Intel FPGA driver overview Message-ID: <20171221060227.GA4861@hao-dev> References: <1511764948-20972-1-git-send-email-hao.wu@intel.com> <1511764948-20972-2-git-send-email-hao.wu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 20, 2017 at 04:31:15PM -0600, Alan Tull wrote: > On Mon, Nov 27, 2017 at 12:42 AM, Wu Hao wrote: > > + > > +PORT > > +==== > > +A port represents the interface between the static FPGA fabric (the "blue > > +bitstream") and a partially reconfigurable region containing an AFU (the "green > > +bitstream"). It controls the communication from SW to the accelerator and > > +exposes features such as reset and debug. > > Hi Hao, > > If I remember correctly, reset means that the accelerator gets reset > and this is something that is desirable to do between jobs. I've > asked for some documentation about the port reset function, partly > because the idea of being able to reset hardware from userspace > somehow scares me. So please find a good logical place to explain > what a port reset does and how it is safe for userspace to request it > at some arbitrary time and how it won't crash the kernel. We > discussed this in v2, I grepped v3 for it, maybe I missed it, but I > don't see it in v3. My understanding is that disabling and reenabling > the port bridge causes the accelerator in its FPGA region to get > reset. Hi Alan Yes, that's correct. Some descriptions are added in Patch#18[1] when introduced the reset ioctl. I will add some descriptions in the doc as well. [1]https://marc.info/?l=linux-fpga&m=151176566714744&w=2 @@ -50,6 +53,20 @@ #define FPGA_CHECK_EXTENSION _IO(FPGA_MAGIC, FPGA_BASE + 1) +/* IOCTLs for AFU file descriptor */ + +/** + * FPGA_PORT_RESET - _IO(FPGA_MAGIC, PORT_BASE + 0) + * + * Reset the FPGA Port and its AFU. No parameters are supported. + * Userspace can do Port reset at any time, e.g during DMA or PR. But + * it should never cause any system level issue, only functional failure + * (e.g DMA or PR operation failure) and be recoverable from the failure. + * Return: 0 on success, -errno of failure + */ + +#define FPGA_PORT_RESET _IO(FPGA_MAGIC, PORT_BASE + 0) + Thanks Hao > > Alan > > > + > > +A PCIe device may have several ports and each port can be released from PF by > > +FPGA_FME_PORT_RELEASE ioctl on FME, and exposed through a VF via PCIe sriov > > +sysfs interface. > > + > -- > To unsubscribe from this list: send the line "unsubscribe linux-fpga" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html