From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 4 Aug 2020 09:43:58 -0700 From: Moritz Fischer Subject: Re: [RESEND PATCHv1] fpga: stratix10-soc: make FPGA task un-interruptible Message-ID: <20200804164358.GB1499313@epycbox.lan> References: <1595607009-2065-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: <1595607009-2065-1-git-send-email-richard.gong@linux.intel.com> To: richard.gong@linux.intel.com Cc: mdf@kernel.org, linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org, trix@redhat.com, dinguyen@kernel.org, Richard Gong List-ID: On Fri, Jul 24, 2020 at 11:10:09AM -0500, richard.gong@linux.intel.com wrote: > From: Richard Gong > > When CTRL+C occurs during the process of FPGA reconfiguration, the FPGA > reconfiguration process stops and the user can't perform a new FPGA > reconfiguration properly. > > Set FPGA task to be not interruptible so that the user can properly > perform FPGA reconfiguration after CTRL+C event. > > Signed-off-by: Richard Gong > Reviewed-by: Tom Rix > --- > drivers/fpga/stratix10-soc.c | 23 +++-------------------- > 1 file changed, 3 insertions(+), 20 deletions(-) > > diff --git a/drivers/fpga/stratix10-soc.c b/drivers/fpga/stratix10-soc.c > index 44b7c56..657a70c 100644 > --- a/drivers/fpga/stratix10-soc.c > +++ b/drivers/fpga/stratix10-soc.c > @@ -196,17 +196,13 @@ static int s10_ops_write_init(struct fpga_manager *mgr, > if (ret < 0) > goto init_done; > > - ret = wait_for_completion_interruptible_timeout( > + ret = wait_for_completion_timeout( > &priv->status_return_completion, S10_RECONFIG_TIMEOUT); > if (!ret) { > dev_err(dev, "timeout waiting for RECONFIG_REQUEST\n"); > ret = -ETIMEDOUT; > goto init_done; > } > - if (ret < 0) { > - dev_err(dev, "error (%d) waiting for RECONFIG_REQUEST\n", ret); > - goto init_done; > - } > > ret = 0; > if (!test_and_clear_bit(SVC_STATUS_OK, &priv->status)) { > @@ -318,7 +314,7 @@ static int s10_ops_write(struct fpga_manager *mgr, const char *buf, > */ > wait_status = 1; /* not timed out */ > if (!priv->status) > - wait_status = wait_for_completion_interruptible_timeout( > + wait_status = wait_for_completion_timeout( > &priv->status_return_completion, > S10_BUFFER_TIMEOUT); > > @@ -340,13 +336,6 @@ static int s10_ops_write(struct fpga_manager *mgr, const char *buf, > ret = -ETIMEDOUT; > break; > } > - if (wait_status < 0) { > - ret = wait_status; > - dev_err(dev, > - "error (%d) waiting for svc layer buffers\n", > - ret); > - break; > - } > } > > if (!s10_free_buffers(mgr)) > @@ -372,7 +361,7 @@ static int s10_ops_write_complete(struct fpga_manager *mgr, > if (ret < 0) > break; > > - ret = wait_for_completion_interruptible_timeout( > + ret = wait_for_completion_timeout( > &priv->status_return_completion, timeout); > if (!ret) { > dev_err(dev, > @@ -380,12 +369,6 @@ static int s10_ops_write_complete(struct fpga_manager *mgr, > ret = -ETIMEDOUT; > break; > } > - if (ret < 0) { > - dev_err(dev, > - "error (%d) waiting for RECONFIG_COMPLETED\n", > - ret); > - break; > - } > /* Not error or timeout, so ret is # of jiffies until timeout */ > timeout = ret; > ret = 0; > -- > 2.7.4 > Sorry that one slipped through the cracks, will apply to for-next. Thanks! From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4889AC433DF for ; Tue, 4 Aug 2020 16:44:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 27590208A9 for ; Tue, 4 Aug 2020 16:44:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596559441; bh=pTyprHUqbLWe2hAnAvazg8DR/XhJsdiBmZaR0P315wk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=epNPlWOUyBvfxI07U9+06OYp9HEkHOs/9VOFjckXvTzw38STRRsgbxvQw0lpfgHso U95IP3GHzSmSluhIV5n9ACFz1m/Zcv1EKimPPKzn/DKkz/iPX6mH9liQu49Uv5atW5 MeLH8zJi6v/MOM9bBVxDxfeZkEbznT/jrmPrxYBE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726086AbgHDQoA (ORCPT ); Tue, 4 Aug 2020 12:44:00 -0400 Received: from mail-pj1-f65.google.com ([209.85.216.65]:40183 "EHLO mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725904AbgHDQoA (ORCPT ); Tue, 4 Aug 2020 12:44:00 -0400 Received: by mail-pj1-f65.google.com with SMTP id d4so2470009pjx.5; Tue, 04 Aug 2020 09:43:59 -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=yuWZSG0s7bzdgOA+0VPUa0Lp1EJmf3kTDXCdwURyIzM=; b=lT68BkXSIOmXOr67Tm0FV4KnPqK64pqfPFVCSRp7qO/wC8l3Ug/goXok+7RCCK31MZ l4S1tUzKY5iWdIJuPoY0QLvDt2Qp9Q3Gfv5v3BCZmClFRY07spOABF9KnGe1Oeok5QIj q3/U8uKZ97SsM0o5Nj5vdD5FAbyJVDsYM8+XaVE8mbf5aUhTqgAtMi87TLo3eYKUQnGV zitN57NvtBBflO3wwBX18zFVLJ5wovTDe88zkKt0jGL+Yxg1U+pN/fVpmesxtvP6ENwi u84qOf2IEF8M07Esu4yXERslKGxm69VxEoa3wMF6Y7DceKpFI86nGRcmEvOLVr4FXkWB m1CQ== X-Gm-Message-State: AOAM533YEEOsV3egvO3PHpFVg+0e4ZXU5SvmGoZfSJnLUgE2s+b0guxg psNNOFbmjFEbi1jhvrcIgEk= X-Google-Smtp-Source: ABdhPJwQAdJMl4TUvT7CbHM8MU9xR/EullcnuFrqc2v93iFTMiBqfiMICZh3PHM4XFs4o0SBNpcVTw== X-Received: by 2002:a17:90b:2388:: with SMTP id mr8mr5740417pjb.64.1596559439463; Tue, 04 Aug 2020 09:43:59 -0700 (PDT) Received: from localhost ([2601:647:5b00:1161:a4cc:eef9:fbc0:2781]) by smtp.gmail.com with ESMTPSA id d14sm15649659pfn.161.2020.08.04.09.43.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Aug 2020 09:43:58 -0700 (PDT) Date: Tue, 4 Aug 2020 09:43:58 -0700 From: Moritz Fischer To: richard.gong@linux.intel.com Cc: mdf@kernel.org, linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org, trix@redhat.com, dinguyen@kernel.org, Richard Gong Subject: Re: [RESEND PATCHv1] fpga: stratix10-soc: make FPGA task un-interruptible Message-ID: <20200804164358.GB1499313@epycbox.lan> References: <1595607009-2065-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: <1595607009-2065-1-git-send-email-richard.gong@linux.intel.com> Sender: linux-fpga-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fpga@vger.kernel.org Message-ID: <20200804164358.GNTbnuKyHYkHqFHI8CQMYiTEshK4ZOJI1MNGvM9IsuY@z> On Fri, Jul 24, 2020 at 11:10:09AM -0500, richard.gong@linux.intel.com wrote: > From: Richard Gong > > When CTRL+C occurs during the process of FPGA reconfiguration, the FPGA > reconfiguration process stops and the user can't perform a new FPGA > reconfiguration properly. > > Set FPGA task to be not interruptible so that the user can properly > perform FPGA reconfiguration after CTRL+C event. > > Signed-off-by: Richard Gong > Reviewed-by: Tom Rix > --- > drivers/fpga/stratix10-soc.c | 23 +++-------------------- > 1 file changed, 3 insertions(+), 20 deletions(-) > > diff --git a/drivers/fpga/stratix10-soc.c b/drivers/fpga/stratix10-soc.c > index 44b7c56..657a70c 100644 > --- a/drivers/fpga/stratix10-soc.c > +++ b/drivers/fpga/stratix10-soc.c > @@ -196,17 +196,13 @@ static int s10_ops_write_init(struct fpga_manager *mgr, > if (ret < 0) > goto init_done; > > - ret = wait_for_completion_interruptible_timeout( > + ret = wait_for_completion_timeout( > &priv->status_return_completion, S10_RECONFIG_TIMEOUT); > if (!ret) { > dev_err(dev, "timeout waiting for RECONFIG_REQUEST\n"); > ret = -ETIMEDOUT; > goto init_done; > } > - if (ret < 0) { > - dev_err(dev, "error (%d) waiting for RECONFIG_REQUEST\n", ret); > - goto init_done; > - } > > ret = 0; > if (!test_and_clear_bit(SVC_STATUS_OK, &priv->status)) { > @@ -318,7 +314,7 @@ static int s10_ops_write(struct fpga_manager *mgr, const char *buf, > */ > wait_status = 1; /* not timed out */ > if (!priv->status) > - wait_status = wait_for_completion_interruptible_timeout( > + wait_status = wait_for_completion_timeout( > &priv->status_return_completion, > S10_BUFFER_TIMEOUT); > > @@ -340,13 +336,6 @@ static int s10_ops_write(struct fpga_manager *mgr, const char *buf, > ret = -ETIMEDOUT; > break; > } > - if (wait_status < 0) { > - ret = wait_status; > - dev_err(dev, > - "error (%d) waiting for svc layer buffers\n", > - ret); > - break; > - } > } > > if (!s10_free_buffers(mgr)) > @@ -372,7 +361,7 @@ static int s10_ops_write_complete(struct fpga_manager *mgr, > if (ret < 0) > break; > > - ret = wait_for_completion_interruptible_timeout( > + ret = wait_for_completion_timeout( > &priv->status_return_completion, timeout); > if (!ret) { > dev_err(dev, > @@ -380,12 +369,6 @@ static int s10_ops_write_complete(struct fpga_manager *mgr, > ret = -ETIMEDOUT; > break; > } > - if (ret < 0) { > - dev_err(dev, > - "error (%d) waiting for RECONFIG_COMPLETED\n", > - ret); > - break; > - } > /* Not error or timeout, so ret is # of jiffies until timeout */ > timeout = ret; > ret = 0; > -- > 2.7.4 > Sorry that one slipped through the cracks, will apply to for-next. Thanks!