Received: by 10.223.176.5 with SMTP id f5csp219908wra; Mon, 5 Feb 2018 20:27:36 -0800 (PST) X-Google-Smtp-Source: AH8x2244KkbaENhtaI3WQadv+svV7kWWV4OJ2bKm/ocTgiUHJWG4Mo44Y8ABrWN1x3q3yKdbNz4s X-Received: by 10.101.68.202 with SMTP id g10mr937097pgs.210.1517891256163; Mon, 05 Feb 2018 20:27:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517891256; cv=none; d=google.com; s=arc-20160816; b=xGa3mWba1ZykKGjwSjylPjxlDQr/tUhtV99Fcl0xJ47dHLFWhNSjzqj7EFWxnSix6+ 4ir4BH6XnZkAf55WivffxkFtufQKukGcghQrHByDE4q8e3NGngKRR/U/kEAyCGhuGHMq UUl0xBWJyWt1Np/7J9QnoaWm4IECSDGbaYiD/mghFbZwHI7tHpiiLQeHAmoXD8mWxlCm wpkARsCAHh5ysnUNo1DmZvslsNCPwLLwJ53lvYaNoOQpCg3mlkU8yYyR8F+tek6CMIqV u0KwcRZbxxmcgFW9WIMZY+PgiJswMRMA0vI9wofbLr/ulfRs0/bm/avieIHe6PMCAkkK GtuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dmarc-filter :arc-authentication-results; bh=yUNPQ5XeMZ9ku8QNOsjq4lA5ISbzAZbocMt3jqTLZ1E=; b=hRppE30aMExKBH1aTeUmXCiCceSKDpxiG+g9j1OQ6WqmGij5ukP3Ex7XKL+ksBRsUd Yo95vaPZ9laHR276KOJnxndao2fEgC/7M5TJd8M7MvLd3tfEK4p5f1N6BGvV9oWK1Sr5 9mo9Ot9cPcxQApXpYs/p0PvZZ7kVAB71SmW9gUEdPKXW3dFMDsOVSeiGbuHqsrlxMDf1 ToT8g03aPZvvLIHdLeN9Zt5wS4i4GA5jzh36OVlg/QLHOYxF26il+82HyjeOnNedIsm4 B7F9cVf6DbFE9iyJMSlxac/vVLaTKBAC6h22xhp9lksQ83+yoMPaXO2TAc5suaPLVcDu QrxA== 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 b1-v6si902739plc.260.2018.02.05.20.27.21; Mon, 05 Feb 2018 20:27:36 -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 S1752161AbeBFE0n (ORCPT + 99 others); Mon, 5 Feb 2018 23:26:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:59974 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752496AbeBFE0g (ORCPT ); Mon, 5 Feb 2018 23:26:36 -0500 Received: from mail-ua0-f176.google.com (mail-ua0-f176.google.com [209.85.217.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 226B121734; Tue, 6 Feb 2018 04:26:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 226B121734 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=atull@kernel.org Received: by mail-ua0-f176.google.com with SMTP id z3so364201uae.12; Mon, 05 Feb 2018 20:26:36 -0800 (PST) X-Gm-Message-State: APf1xPC2biZ5vzlvyy3o6y/6z7yiqcWGFWB+wS0vL5CLO3jpb05EIODN uOnDTo/vCQelkDV/I1jcm4nd0S/ODS/fnb2Qnoc= X-Received: by 10.176.68.35 with SMTP id m32mr1153262uam.39.1517891195267; Mon, 05 Feb 2018 20:26:35 -0800 (PST) MIME-Version: 1.0 Received: by 10.159.60.79 with HTTP; Mon, 5 Feb 2018 20:25:54 -0800 (PST) In-Reply-To: <20180206014700.GA3883@hao-dev> 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> <20180204093706.GA26184@hao-dev> <20180205183644.GA52136@eluebber-mac02.local> <20180206014700.GA3883@hao-dev> From: Alan Tull Date: Mon, 5 Feb 2018 22:25:54 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 14/21] fpga: dfl: add fpga manager platform driver for FME To: Wu Hao Cc: "Luebbers, Enno" , Moritz Fischer , 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 5, 2018 at 7:47 PM, Wu Hao wrote: > On Mon, Feb 05, 2018 at 10:36:45AM -0800, Luebbers, Enno wrote: >> Hi Hao, >> >> On Sun, Feb 04, 2018 at 05:37:06PM +0800, Wu Hao wrote: >> > 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. >> > > > >> > > >> > > 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. >> > > >> > > 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). >> > >> > Hi Enno >> > >> > Yes, this interface is under fpga-dfl-fme-mgr.0, and fpga-dfl-fme-mgr.0 is >> > under fpga-dfl-fme.0. It's part of the FME device for sure. From another >> > point of view, it means if anyone wants to do PR on this Intel FPGA device, >> > he needs to find the FME device firstly, and then check if any fpga manager >> > created under this FME device, if yes, check the interface_id before PR via >> > the FME device node ioctl. >> >> That sounds good, thank you! >> >> > >> > > >> > > Sorry for my limited understanding of the infrastructure - would this same >> > > "fpga-dfl-fme-mgr.0" be used for PR if we had multiple PR regions? In that case >> > > it would need to expose multiple interface_ids (or we'd have to track both >> > > interface IDs and an identifier for the target PR region). >> > >> > Yes, the fpga manager could be shared with different PR regions. >> > >> > Sorry, I'm not sure where we need to expose multiple interface_ids and why. >> >> It's basically a question of how to determine bitstream compatibility - either, >> there's a separate interface_id per reconfigurable region, or there is a single >> interface_id for the entire device. Both make sense from a certain perspective. >> >> If there are multiple interface_ids per device (one per region), the driver >> would need to expose all of them. If there's only a single one, the driver only >> exposes that one ID - compatibility would be determined by looking at both that >> single interface_id _and_ the identifier/number of the targeted region. >> >> I would prefer a separate interface_id per region - it seems more generic and >> flexible. Hi Enno, I agree with this. > > It's possible to have per region interface_id (or even both per dev interface_id > and per region interface_id at the same time), but per FME PR sub feature > implementation, it supports multiple PR regions, but only provide one interface > id, so at least in this case, it's not per-region information per my > understanding. We can consider it later when hardware really supports it. : ) Hi Hao, I understand that in the case of this PR hardware, the region to program is selected when the region_id to program is written to a PR hardware control register. For another example, Arria10 has a hard PR hardware and the PR bitstream lands in the area of the FPGA for which it was compiled. In that case, for the PR bitstream to be compatible with a PR region, the layout of the edge connections also needs to be compatible, so compatibility is per-region in that case instead of per-PR hardware. And besides, as I said yesterday, the hard PR hardware would not know what the static region ID is when this framework is used with such a device. That's why I think making the id per-region may be more future proof, even if it may see unnecessary in the case of the original blue bits this was written for. Alan