Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2808860ybk; Tue, 12 May 2020 08:37:43 -0700 (PDT) X-Google-Smtp-Source: APiQypKkP9d3OKN/GdHLnfb7HqXcqZPKdzao3wvjw3VcBzfFYhlwCLkJz0yop/9zpqlLcnt3+jnU X-Received: by 2002:a50:e806:: with SMTP id e6mr19045158edn.153.1589297863289; Tue, 12 May 2020 08:37:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589297863; cv=none; d=google.com; s=arc-20160816; b=qoAi14/CG09Hu8tBe2ka8vkz/W8SeddLRDe5fs9TU41/4ZFgtsQrAjaUzD16ib5ISq yGOH8VFs9Ayb4lNfpMDOYSCNfvBXGb2G1w5BQ09LgrYgAuYkSyGlideThtLPP3BaVX8R Pf1Sw6xSKxr4YA1MvceKWicbKrk6u5S2LhX3fNCZTbUAt2GnzLdszUzsZPrNI7TVhrtx DUhJ0tbzY7+GR37hnl6lUTkBMcjM8/YG39Pv2QPko1+MyvLP35kkTETSHT65xLCyaD+u GnrIVTvN5g2/UCbb6Di+UwMyyG0IZJwuIduptbk+CNq8fzYIyAHINdgEqbUz7UDfe2Nh Hn9w== 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=IACEJSbgjfxq+BYzs3zD2rIKVKj69qiCzKfaSwCOxxY=; b=WjrC9ohSJLRQzt0x68xpZNgBhe2DeNeAJZCCK8E7woVr1yvTjqFDDI0jqzrd8s7x8z PX54uPw2ClR4JZ7XwUvBK265P2j4UwKU68fG9wi6lLC03ckF/oX26zxk9It/FiZwbOF3 /IxxAYGGZCgNdG0PJAUCHzSHBDiEreiUTFJtVjGPwrLCTaiy/jgqMePKX56tcZ09m3bg tRxtxFZ4vPOtgXNzh9lWhYy9Le6NNdoz84d+1c5nkhITpgYnS0ZD55opDCYveM+Mf7HD wB/vI67nlGjeEjoiqewAc1tqyuzmNp9Ay2Q+fnb4ub8Ul/9ko7d86xYcKlHNE4LMOOuR pfWQ== 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 a13si5211924edr.32.2020.05.12.08.37.17; Tue, 12 May 2020 08:37:43 -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 S1727777AbgELPfS (ORCPT + 99 others); Tue, 12 May 2020 11:35:18 -0400 Received: from mail-pg1-f170.google.com ([209.85.215.170]:43064 "EHLO mail-pg1-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725912AbgELPfR (ORCPT ); Tue, 12 May 2020 11:35:17 -0400 Received: by mail-pg1-f170.google.com with SMTP id l12so6305832pgr.10; Tue, 12 May 2020 08:35:17 -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=IACEJSbgjfxq+BYzs3zD2rIKVKj69qiCzKfaSwCOxxY=; b=X16CMivvHqmZTgSQfVc3AGk1IN6v9Vkw4EQeOBQxxarQYLYEZBF0eEH2j0KN55ABkE +gHAFTpHgwib8cF17R/slUgpJKdiNfhezfIrpkUtwH3Ae4G9UeTa91j+oc5sUR2OSuWN mOMpXYcoigTPgAZxI3bHpDAo4qO2nJPFmH0ux6SsdfDRjmJvtN1IToP1In1jFRfNDdL2 PXLvUBaE8FM/w1zsud793tfqhgVpmMmdhWVNrhexYX7qDTqHTpjz6zltP21UMb2XGgpA T4sNM3s5v1gqnSgHxvTNHiga2L+v5dSIEs09wJ0euiVu5AU7eH8f57SraL/bh/shMM/i d1pw== X-Gm-Message-State: AGi0PublHAheXejQDynzkILH9Zvxpcw2DRX/+/yaNH43E2mC4Fuwa2bC mtQAuXzH2wXObYTydqngDRZP7peDHr0= X-Received: by 2002:aa7:9d02:: with SMTP id k2mr21122894pfp.269.1589297716947; Tue, 12 May 2020 08:35:16 -0700 (PDT) Received: from localhost ([2601:647:5b00:1161:a4cc:eef9:fbc0:2781]) by smtp.gmail.com with ESMTPSA id j7sm13150420pjy.9.2020.05.12.08.35.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 May 2020 08:35:15 -0700 (PDT) Date: Tue, 12 May 2020 08:35:14 -0700 From: Moritz Fischer To: richard.gong@linux.intel.com Cc: mdf@kernel.org, linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org, dinguyen@kernel.org, Richard Gong Subject: Re: [PATCHv1] fpga: stratix10-soc: remove the pre-set reconfiguration condition Message-ID: <20200512153514.GA125665@epycbox.lan> References: <1589290051-30246-1-git-send-email-richard.gong@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1589290051-30246-1-git-send-email-richard.gong@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Richard, On Tue, May 12, 2020 at 08:27:31AM -0500, 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. > > Also add an error message if the configuration request is failure. > > Signed-off-by: Richard Gong > --- > drivers/fpga/stratix10-soc.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/fpga/stratix10-soc.c b/drivers/fpga/stratix10-soc.c > index 44b7c56..2da8a40 100644 > --- a/drivers/fpga/stratix10-soc.c > +++ b/drivers/fpga/stratix10-soc.c > @@ -182,12 +182,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 = 1; Have you considered: ctype.flags = BIT(COMMAND_RECONFIG_FLAG_PARTIAL); instead (assuming 1, lines up with BIT(COMMAND_RECONFIG_FLAG_PARTIAL)? If not: Can you define a constant? > } else { > dev_dbg(dev, "Requesting full reconfiguration.\n"); > + ctype.flags = 0; > } > > reinit_completion(&priv->status_return_completion); > @@ -210,6 +210,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; > } > -- > 2.7.4 > Cheers, Moritz