Received: by 10.223.176.5 with SMTP id f5csp315304wra; Mon, 5 Feb 2018 22:46:37 -0800 (PST) X-Google-Smtp-Source: AH8x2244EEFcBjoL5beEqkARTWHsISBkqegpyI5u04YqgPtkhakCaDUd74DksrVW7+aaOOK7uM1H X-Received: by 10.99.117.87 with SMTP id f23mr1169642pgn.453.1517899597098; Mon, 05 Feb 2018 22:46:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517899597; cv=none; d=google.com; s=arc-20160816; b=HaUy4K64Rdn0LA+NOO6YmaoN0mtKJKo34kK0o5M3CQR3wZb1Wz4eFzhKcFeeebG+Jl PbYN0PTkI1/C3uNpnb9Nj+aPgVI9nwmOtmIS/yHSeE1Utr3BmzipgbMklQJNf81EL5gS ecfbBqlhK03JujjBAeXl9CK8e7uPtqjCCjrTq9P0ppN6J5Oqey/G952xs4MsKIp3xNFz kP2m9vmlfev8Jdbgy/vVvEUQAlx7AKv8mdk4/4hk2K7OXz9TOld+f5wMZeV9PM2AqzDn +u6zuhc9vvYfSaMWNhXV8/NBbwGsbSr/O0g+1IpBmzfSrb4oiv4OYhhEBu6y8ud5xD1u ViVw== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=QrOY+p/G7bE1b2H2Gr1Zesnh27meCTb5zFp7Fmx7iZ8=; b=ucjDsGPefJoex1whtSicXT/CgFokF79JxjcqmB+rt5enF/zchCg/tyiQSa7133MZnR xl/Rwx52XyHD5ziEZZa0+GVUhqqK1kJlRe8KZPU9OSasVlvbhYx3hs2KJXwwH6oFR8Gd jyJM3/4lVF+wo/0Cafrt2zeoZFYVRsYmYlKv8mlhj2ocOdsbtCP6MmRY+qelRWeb3afs dBi5wDBYHnQ6Zw/s9AwcU2nufaYFRZBkEbIIjI1iP8dTS0CgQVZcJfbri3xa3UbwWBBS YdcY2/h2fN3d/6/0Be2UpUvFJE2IMVMfgSoeGBEtS1zntsNP59fPPnQkSmi1ArtOgEg0 39YQ== ARC-Authentication-Results: i=1; mx.google.com; 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 ay8-v6si559369plb.614.2018.02.05.22.46.22; Mon, 05 Feb 2018 22:46:37 -0800 (PST) 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; 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 S1752246AbeBFGob (ORCPT + 99 others); Tue, 6 Feb 2018 01:44:31 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:40895 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751914AbeBFGoY (ORCPT ); Tue, 6 Feb 2018 01:44:24 -0500 Received: by mail-wm0-f67.google.com with SMTP id v123so1538791wmd.5 for ; Mon, 05 Feb 2018 22:44:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=QrOY+p/G7bE1b2H2Gr1Zesnh27meCTb5zFp7Fmx7iZ8=; b=HrRb4PPKZWb3uSdEqbdX2ktrLFbOpVXlxCYFJRMRlp0hiXnMyKmKRBpyH47GpYNoIg RprPus6+xnfjnu2UH1DSgJqT7RXpO2Qr0sqSbMrN13+Kg9iwcvBH5MM+OJN0FPMyxz6f 3r5WODpvOFFYIGbghpE4r3RixksApFL7vQNsfce+y1aw8GvXLqLWjtwrxvY+oYtPGC1/ FE62/G/G/myvQuv5lswqtJCwTqzn8Y16v85xq1ml2Oj6i87lB4qEgl3Flmy5+S7XwDrp O4B7O/Iw1jMw5xQtdGj3bW85CWro4+bLjPle9cZZkDpBY9ZAhRkLQknCU2aFTpZye4CU geLw== X-Gm-Message-State: APf1xPCgqkPmGiUWBXbbaXP3RuxiALagMknD2NZpBwCw5988LFPWPUDl fojbrP+5fx2hxmH1QT2X3O7Igg== X-Received: by 10.80.171.78 with SMTP id t14mr2397967edc.170.1517899462397; Mon, 05 Feb 2018 22:44:22 -0800 (PST) Received: from localhost ([88.128.80.16]) by smtp.gmail.com with ESMTPSA id z2sm9711241edc.50.2018.02.05.22.44.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 05 Feb 2018 22:44:21 -0800 (PST) Date: Tue, 6 Feb 2018 07:44:21 +0100 From: Moritz Fischer To: Alan Tull Cc: Wu Hao , Moritz Fischer , "Luebbers, Enno" , linux-fpga@vger.kernel.org, linux-kernel , linux-api@vger.kernel.org, "Kang, Luwei" , "Zhang, Yi Z" , Tim Whisonant , Shiva Rao , Christopher Rauer , Xiao Guangrong Subject: Re: [PATCH v3 14/21] fpga: dfl: add fpga manager platform driver for FME Message-ID: <20180206064421.awx26yvsqk4gmqby@derp-derp.local> References: <1511764948-20972-1-git-send-email-hao.wu@intel.com> <1511764948-20972-15-git-send-email-hao.wu@intel.com> <20180202094213.GB17015@hao-dev> <20180203002626.GA51125@eluebber-mac02.jf.intel.com> <20180203104124.luniynyrr6iwxozd@derp-derp.local> <20180204100546.GB26184@hao-dev> <20180206021756.GA3971@hao-dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171027 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 05, 2018 at 10:25:27PM -0600, Alan Tull wrote: > On Mon, Feb 5, 2018 at 8:17 PM, Wu Hao wrote: > > On Mon, Feb 05, 2018 at 11:21:52AM -0600, Alan Tull wrote: > >> On Sun, Feb 4, 2018 at 4:05 AM, Wu Hao wrote: > >> > On Sat, Feb 03, 2018 at 11:41:24AM +0100, Moritz Fischer wrote: > >> >> Hi Hao, > >> >> > >> >> On Fri, Feb 02, 2018 at 04:26:26PM -0800, Luebbers, Enno wrote: > >> >> > Hi Hao, Alan, > >> >> > > >> >> > On Fri, Feb 02, 2018 at 05:42:13PM +0800, Wu Hao wrote: > >> >> > > On Thu, Feb 01, 2018 at 04:00:36PM -0600, Alan Tull wrote: > >> >> > > > On Mon, Nov 27, 2017 at 12:42 AM, Wu Hao wrote: > >> >> > > > > >> >> > > > Hi Hao, > >> >> > > > > >> >> > > > A few comments below. Besides that, looks good. > >> >> > > > > >> >> > > > > This patch adds fpga manager driver for FPGA Management Engine (FME). It > >> >> > > > > implements fpga_manager_ops for FPGA Partial Reconfiguration function. > >> >> > > > > > >> >> > > > > Signed-off-by: Tim Whisonant > >> >> > > > > Signed-off-by: Enno Luebbers > >> >> > > > > Signed-off-by: Shiva Rao > >> >> > > > > Signed-off-by: Christopher Rauer > >> >> > > > > Signed-off-by: Kang Luwei > >> >> > > > > Signed-off-by: Xiao Guangrong > >> >> > > > > Signed-off-by: Wu Hao > >> >> > > > > ---- > >> >> > > > > v3: rename driver to dfl-fpga-fme-mgr > >> >> > > > > implemented status callback for fpga manager > >> >> > > > > rebased due to fpga api changes > >> >> > > > > --- > >> >> > > > > .../ABI/testing/sysfs-platform-fpga-dfl-fme-mgr | 8 + > >> >> > > > > drivers/fpga/Kconfig | 6 + > >> >> > > > > drivers/fpga/Makefile | 1 + > >> >> > > > > drivers/fpga/fpga-dfl-fme-mgr.c | 318 +++++++++++++++++++++ > >> >> > > > > drivers/fpga/fpga-dfl.h | 39 ++- > >> >> > > > > 5 files changed, 371 insertions(+), 1 deletion(-) > >> >> > > > > create mode 100644 Documentation/ABI/testing/sysfs-platform-fpga-dfl-fme-mgr > >> >> > > > > create mode 100644 drivers/fpga/fpga-dfl-fme-mgr.c > >> >> > > > > > >> >> > > > > diff --git a/Documentation/ABI/testing/sysfs-platform-fpga-dfl-fme-mgr b/Documentation/ABI/testing/sysfs-platform-fpga-dfl-fme-mgr > >> >> > > > > new file mode 100644 > >> >> > > > > index 0000000..2d4f917 > >> >> > > > > --- /dev/null > >> >> > > > > +++ b/Documentation/ABI/testing/sysfs-platform-fpga-dfl-fme-mgr > >> >> > > > > @@ -0,0 +1,8 @@ > >> >> > > > > +What: /sys/bus/platform/devices/fpga-dfl-fme-mgr.0/interface_id > >> >> > > > > +Date: November 2017 > >> >> > > > > +KernelVersion: 4.15 > >> >> > > > > +Contact: Wu Hao > >> >> > > > > +Description: Read-only. It returns interface id of partial reconfiguration > >> >> > > > > + hardware. Userspace could use this information to check if > >> >> > > > > + current hardware is compatible with given image before FPGA > >> >> > > > > + programming. > >> >> > > > > >> >> > > > I'm a little confused by this. I can understand that the PR bitstream > >> >> > > > has a dependency on the FPGA's static image, but I don't understand > >> >> > > > the dependency of the bistream on the hardware that is used to program > >> >> > > > the bitstream to the FPGA. > >> >> > > > >> >> > > Sorry for the confusion, the interface_id is used to indicate the version of > >> >> > > the hardware for partial reconfiguration (it's part of the static image of > >> >> > > the FPGA device). Will improve the description on this. > >> >> > >> >> I'm not sure userland should be making the call on whether what you're > >> >> trying to load is compatible or not. I guess I was worried that you might take down a PR region that you could've avoided. On second thought unless the kernel could extract that info somehow from the bitstream before programming this is probably anyway not possible, since the only one that knows the id -> bitstream mapping is userland. Hao's comments further down outline well enough that the hardware can deal with incompatible bitstreams. So ignore my comments ;-) > >> > >> Could you explain more about what your concern was about this (unless > >> Hao has covered it below)? > >> > >> It makes sense to me in this use case at least since userspace has a > >> pile of images and is choosing which one to load. > >> > >> >> Isn't there a way to check this in > >> >> your PR reconfiguration handler in-kernel? > >> > > >> > Hi Moritz > >> > > >> > Actually with current driver interface, doing a partial reconfiguration with an > >> > incompatible image, then driver will report PR failure with error code > >> > FPGA_MGR_STATUS_INCOMPATIBLE_IMAGE_ERR as hardware checks it, but anyway user > >> > needs to know hardware interface_id information to find or re-generated correct > >> > images. I think it's more flexible to leave it to userspace on using this > >> > information exposed by driver. : ) > >> > > >> > Thanks > >> > Hao > >> > > >> >> > >> >> > > > >> >> > > >> >> > The interface_id expresses the compatibility of the static region with PR > >> >> > bitstreams generated for it. It changes every time a new static region is > >> >> > generated. > >> > >> In the near future the DFL framework will be used with SoC's that have > >> a hard FPGA PR manager (that's not part of the static region). The > >> hard FPGA manager driver won't know anything about the static region. > >> > >> >> > > >> >> > Would it make more sense to have the interface_id exposed as part of the FME > >> >> > device (which represents the static region)? I'm not sure - it kind of also > >> >> > makes sense here, where you would have all the information in one place (if the > >> >> > interface_id matches, I can use this component to program a bitstream). > >> > >> According to the intel-fpga.txt document, the identifier for the > >> static image is at > >> > >> /sys/class/fpga_region/regionX/fpga-dfl-fme.n/bitstream_id > > > > Hi Alan > > Hi Hao, > > > > > This bitstream_id refects the full static region version. As you know, PR is > > only a sub feature of the FME functional unit, it's possible that we have > > different static region (different bitstream_id) but it has the exact same > > PR sub feature under the FME, only changes on other sub features or function > > units. > > OK, thanks for that explanation. That makes sense but could have > easily been different. Please document this somewhere. > > Alan Moritz