Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2283968ybh; Fri, 24 Jul 2020 08:56:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyaDSZmNNvKdVCsCNIB71nvLgB7ivzCyF4f7egTR7K1DyzeY39owDoMAHbVUtK0JNB8LA47 X-Received: by 2002:a05:6402:1d0a:: with SMTP id dg10mr9118139edb.110.1595606175665; Fri, 24 Jul 2020 08:56:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595606175; cv=none; d=google.com; s=arc-20160816; b=wnulWRbbnc5SuvFOV2oWgg5e6QdLsHK/IoSHsA4Oe6G1faXTFltO+PJifadMZMK6qB To6T+c+Q5almPEBFM19OKSXX9haOwYPKHOvSeuEpYYzm1n/qmPQQ52MkIsN6gwIGeROy vcmuXlkyrjX3LiJJKwumwDl4x4htUlfGWS2nDyjUZXDlCIhvroPrxLzfUdKezloTBJXt rsepIXK7rdAxhtZ4FxbaPSV73OkgX6dHW/oCXsjJBI+7zvc7cppW0lpoihMN4ujYJQVV YhcJWyf9sM66kXn/MArlXd5zrB6RfrmRlHccbcyjD0NujUZRS064cmRV/8V8DlQNsFRL VXIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=JUNEhmBfKpy2KbfYTAbm688K/A9TvnM4OOs3p41gM5M=; b=gIm+RWMMJqEhLWkUjAhF+A5foltIfo2Awad3/uu4Nh8VW4uXxrS7ZS0xgblHCOM3j1 gi+Ck1n6vX8R+pL/kkDXz9UmDSgZ85hRNEH+qZrhoWsEXR+w0xEaxU8jf8MIC2w7wyLV STuP2C5E5vVRHPr+QQpeoaJt/pSJfe+HBSjsOr0bibXanDsU9oUgxF3lZStj9VgrgnRD nF76Txf1xb9Sloj2AkUm2jxfnK8B8RTgeG/OOsq//cWp9NW4EnvMLsuSSgGvAL6sTkrr AogNX3zNrKLF/zq4htv5J7sifh9XcwYpqfnJxQTqZTueMHstibYUoi57frRelIuBVO+e XPxQ== 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w6si726193ejc.605.2020.07.24.08.55.52; Fri, 24 Jul 2020 08:56:15 -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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726701AbgGXPzi (ORCPT + 99 others); Fri, 24 Jul 2020 11:55:38 -0400 Received: from mga09.intel.com ([134.134.136.24]:55400 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726381AbgGXPzi (ORCPT ); Fri, 24 Jul 2020 11:55:38 -0400 IronPort-SDR: /6KniTZdBd/UbPhVH0OXkVJCdLuspm5UhuhaOLvaqikyrgPINLzICV7qz5XaC0Et1OWY1AvL5u 4WuDIgXfwtfg== X-IronPort-AV: E=McAfee;i="6000,8403,9692"; a="152013967" X-IronPort-AV: E=Sophos;i="5.75,391,1589266800"; d="scan'208";a="152013967" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jul 2020 08:55:37 -0700 IronPort-SDR: TXx5h+ln0r1Ie1dc4I8gPGRdq3qXEmqlJcCmRyhYQ+7Cy0j5+5XK3EUjfVqunD/G43REfnvzkR hy58pVJxluwQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,391,1589266800"; d="scan'208";a="433118864" Received: from marshy.an.intel.com ([10.122.105.159]) by orsmga004.jf.intel.com with ESMTP; 24 Jul 2020 08:55:36 -0700 From: richard.gong@linux.intel.com To: mdf@kernel.org Cc: linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org, trix@redhat.com, dinguyen@kernel.org, richard.gong@linux.intel.com, Richard Gong Subject: [RESEND PATCHv1] fpga: stratix10-soc: make FPGA task un-interruptible Date: Fri, 24 Jul 2020 11:10:09 -0500 Message-Id: <1595607009-2065-1-git-send-email-richard.gong@linux.intel.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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