Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp2226468ybm; Sun, 31 May 2020 12:53:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwruE7dRIJ1kqqJN9kq8aVKmaIQ9Y++WLCcT4LjpfdHOIXXw3z3by/iQnAXkt8nFA687Zmq X-Received: by 2002:aa7:de0e:: with SMTP id h14mr18868608edv.82.1590954837324; Sun, 31 May 2020 12:53:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590954837; cv=none; d=google.com; s=arc-20160816; b=LcXiUBONFAN5ToRfGHL+hbXsFORlXXm5WJ8aWN9spaLPg2miZcNeVDsi9OIUnD4N9u cJEsH0GLvBdu5FMmVlEuobcoMegb3CXxLykgo+ZI0TgozQ2KxE5gp94RRu1pPsH2azq1 SGNb1koOBH/LqmQacoaicKQfh/erwIKKf323IbiWbKBs8zf4pFc7advvmV9uZEss97FQ K2lHRh80xEQArpU16isuge6QUJxNkxsmwN7v0mZZZ/w0S4xuikdXdF2NHF2a94Nml0HS hPGlGBM12eficz+2+LaUexyxrPlAUlQHK371am6QkfzGyr7628Mdjtuv4nLz1YA+YOw4 6pxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=4shVeq4P49QY+lf67oVac1QZQRNqssGFZQ4bP+zIwn0=; b=dIl9JViNqVHsDUAs4P/R16WsDV0JnMsUOQcwjtztXEpbAG9VK9rxES8YIjzzTmxpVX /B1x+0LIeQD6aZevNKbYIVPfdjehnRC3rPwGElbT+ikNduWGVaWbSRTofH6g2QSsN1sk 9NDQmJwlY8kTx09e7/VkYaD4YCPQr24YepAAE/7e+ZIlxDzgYGjjAwJ3w18Gsv7JF4+f +Of8Y4I+Cx+wDJ7+QEWsFo52vAWziLUSuPhO52/Ay55cWD2sLVBY89fJwK84BUQSnwhv hjNfyk4dK06wzP6vlibpRCX9OziCBLOkwvlAkUrzxnCyTP2sTjEJSXWXUzFzBRAR1JK6 keFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t13si9984551edi.528.2020.05.31.12.53.34; Sun, 31 May 2020 12:53:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728355AbgEaTtb (ORCPT + 99 others); Sun, 31 May 2020 15:49:31 -0400 Received: from mail-pg1-f178.google.com ([209.85.215.178]:43343 "EHLO mail-pg1-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726882AbgEaTta (ORCPT ); Sun, 31 May 2020 15:49:30 -0400 Received: by mail-pg1-f178.google.com with SMTP id 185so2504029pgb.10; Sun, 31 May 2020 12:49:30 -0700 (PDT) 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; bh=4shVeq4P49QY+lf67oVac1QZQRNqssGFZQ4bP+zIwn0=; b=qcfA1AUrC+ztxFWUd52+fKk7vSxfD/Mah+2gd1EqrlG4/0p3xuELsmUiCmEBNuhB8A C3g2YxLwgRWM0i7Dfa9q9ty4mdrG1jtRteWxmLf3RVq3Vm5nqLcs2LHm81RKzzkkSUXB yRyh/L9gCwL5GalQgjmT4B8Tbfxky+/7joYAdzPZ9svd5SFst66Z/KcYBwuCvLtzTxZQ DZSf8zsgEgdbYRYwvmhXhW3l/Lj0zWiFdBC3JHYPfeBxiBNDIziLqXNcFRkjddoJoNAX uH4glytqaYIrsYSTHCntN7BcIrFYXYpN+LJhOI0JFD5iEiKYxaaxz+cB/0IjpAGnXfKU 4BAw== X-Gm-Message-State: AOAM5336CvlaExIvRZo5gLTS02bnIYf0ALVWyJtjS2SWDpZ46SbRncA9 AskkX7Tf4xEhJvPU0UKctZA= X-Received: by 2002:a62:342:: with SMTP id 63mr16981848pfd.229.1590954569787; Sun, 31 May 2020 12:49:29 -0700 (PDT) Received: from localhost ([2601:647:5b00:1161:a4cc:eef9:fbc0:2781]) by smtp.gmail.com with ESMTPSA id v5sm5787722pjy.4.2020.05.31.12.49.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 May 2020 12:49:28 -0700 (PDT) Date: Sun, 31 May 2020 12:49:27 -0700 From: Moritz Fischer To: Richard Gong Cc: mdf@kernel.org, linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org, dinguyen@kernel.org, Richard Gong Subject: Re: [PATCHv2] fpga: stratix10-soc: remove the pre-set reconfiguration condition Message-ID: <20200531194927.GA1622@epycbox.lan> References: <1589553303-7341-1-git-send-email-richard.gong@linux.intel.com> <1d9b21df-7421-b25e-5139-f297e24d99d4@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1d9b21df-7421-b25e-5139-f297e24d99d4@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 29, 2020 at 08:15:15AM -0500, Richard Gong wrote: > Hi Moritz, > > Sorry for asking. > > When you get chance, can you review my version 2 patch submitted on > 05/15/20? > > Regards, > Richard > > On 5/15/20 9:35 AM, richard.gong@linux.intel.com wrote: > > From: Richard Gong > > > > The reconfiguration mode is pre-set by driver as the full reconfiguration. > > As a result, user have to change code and recompile the drivers if he or > > she wants to perform a partial reconfiguration. Removing the pre-set > > reconfiguration condition so that user can select full or partial > > reconfiguration via overlay device tree without recompiling the drivers. Can you help me understand? See comment below, I'm not sure how this change changes the behavior. > > > > Also add an error message if the configuration request is failure. > > > > Signed-off-by: Richard Gong > > --- > > v2: define and use constant values > > --- > > drivers/fpga/stratix10-soc.c | 9 +++++++-- > > 1 file changed, 7 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/fpga/stratix10-soc.c b/drivers/fpga/stratix10-soc.c > > index 44b7c56..4d52a80 100644 > > --- a/drivers/fpga/stratix10-soc.c > > +++ b/drivers/fpga/stratix10-soc.c > > @@ -14,9 +14,13 @@ > > /* > > * FPGA programming requires a higher level of privilege (EL3), per the SoC > > * design. > > + * SoC firmware supports full and partial reconfiguration. Consider: "The SoC firmware supports full and partial reconfiguration." > > */ > > #define NUM_SVC_BUFS 4 > > #define SVC_BUF_SIZE SZ_512K > > +#define FULL_RECONFIG_FLAG 0 > > +#define PARTIAL_RECONFIG_FLAG 1 > > + > > /* Indicates buffer is in use if set */ > > #define SVC_BUF_LOCK 0 > > @@ -182,12 +186,12 @@ static int s10_ops_write_init(struct fpga_manager *mgr, > > uint i; > > int ret; > > - ctype.flags = 0; > > if (info->flags & FPGA_MGR_PARTIAL_RECONFIG) { > > dev_dbg(dev, "Requesting partial reconfiguration.\n"); > > - ctype.flags |= BIT(COMMAND_RECONFIG_FLAG_PARTIAL); > > + ctype.flags = PARTIAL_RECONFIG_FLAG; > > } else { > > dev_dbg(dev, "Requesting full reconfiguration.\n"); > > + ctype.flags = FULL_RECONFIG_FLAG; > > } Am I missing something here: Doesn't this do the same as before? Before: If info->flags & FPGA_MGR_PARTIAL_RECONFIG -> ctype.flags = 0 | BIT(COMMAND_RECONFIG_FLAG_PARTIAL) -> 1 and ctype->flags = FULL_RECONFIG -> 0 else. Now: If info->flags & FPGA_MGR_PARTIAL_RECONFIG -> ctype.flags = PARTIAL_RECONFIG_FLAG -> 1 ctype->flags = FULL_REECONFIG_FLAG -> 0 else. Am I missing something here? If I don't set the flag for partial reconfig I'd end up with full reconfiguration in both cases? If I do set the flag, I get partial reconfiguration in both cases? > > reinit_completion(&priv->status_return_completion); > > @@ -210,6 +214,7 @@ static int s10_ops_write_init(struct fpga_manager *mgr, > > ret = 0; > > if (!test_and_clear_bit(SVC_STATUS_OK, &priv->status)) { > > + dev_err(dev, "RECONFIG_REQUEST failed\n"); > > ret = -ETIMEDOUT; > > goto init_done; > > } > > Thanks, Moritz